fix jpush cast error

hmxc
小赖 3 years ago
parent e5888eb860
commit a0c1b8b6a7

@ -1,3 +1,4 @@
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
@ -74,6 +75,31 @@ List<AO> appObjects = [
AO('借还管理', R.ASSETS_APPLICATIONS_BORROW_PNG, () => SelectBorrowReturnPage()), AO('借还管理', R.ASSETS_APPLICATIONS_BORROW_PNG, () => SelectBorrowReturnPage()),
AO('一键报警', R.ASSETS_APPLICATIONS_POLICE_PNG, () => AlarmPage()), AO('一键报警', R.ASSETS_APPLICATIONS_POLICE_PNG, () => AlarmPage()),
AO('设施预约', R.ASSETS_ICONS_TOOL_FACILITY_PNG, () => PickFacilityPage()), AO('设施预约', R.ASSETS_ICONS_TOOL_FACILITY_PNG, () => PickFacilityPage()),
AO(
'小区教育',
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
() => BeeScaffold(title: '小区教育'),
),
AO(
'健康运动',
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
() => BeeScaffold(title: '健康运动'),
),
AO(
'家政服务',
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
() => BeeScaffold(title: '家政服务'),
),
AO(
'居家养老',
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
() => BeeScaffold(title: '居家养老'),
),
AO(
'物业租赁',
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
() => BeeScaffold(title: '物业租赁'),
),
]; ];
List<AO> userAppObjects = [ List<AO> userAppObjects = [
@ -123,6 +149,11 @@ List<String> _smartManagerApp = [
'借还管理', '借还管理',
'一键报警', '一键报警',
'设施预约', '设施预约',
'小区教育',
'健康运动',
'家政服务',
'居家养老',
'物业租赁',
]; ];
/// ///

@ -38,8 +38,9 @@ class MainInitialize {
static Future initJPush() async { static Future initJPush() async {
if (kIsWeb || Platform.isMacOS) return; if (kIsWeb || Platform.isMacOS) return;
JPush jpush = new JPush(); JPush jpush = new JPush();
Function(Map<String, dynamic> message) jPushLogger(String type) { Future<dynamic> Function(Map<String, dynamic>? message)? jPushLogger(
return (Map<String, dynamic> message) async { String type) {
return (Map<String, dynamic>? message) async {
LoggerData.addData({ LoggerData.addData({
'type': type, 'type': type,
'message': message, 'message': message,
@ -48,9 +49,9 @@ class MainInitialize {
} }
jpush.addEventHandler( jpush.addEventHandler(
onReceiveNotification: jPushLogger('onReceiveNotification') as Future<dynamic> Function(Map<String, dynamic>?)?, onReceiveNotification: jPushLogger('onReceiveNotification'),
onOpenNotification: jPushLogger('onOpenNotification') as Future<dynamic> Function(Map<String, dynamic>?)?, onOpenNotification: jPushLogger('onOpenNotification'),
onReceiveMessage: jPushLogger('onReceiveMessage') as Future<dynamic> Function(Map<String, dynamic>?)?, onReceiveMessage: jPushLogger('onReceiveMessage'),
); );
jpush.setup( jpush.setup(
appKey: "6a2c6507e3e8b3187ac1c9f9", appKey: "6a2c6507e3e8b3187ac1c9f9",

@ -1,3 +1,4 @@
import 'package:aku_community/ui/profile/order/order_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -72,8 +73,7 @@ class _PersonalIndexState extends State<PersonalIndex>
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image( image: API.image(
userProvider.userInfoModel?.imgUrl ?? userProvider.userInfoModel?.imgUrl ?? ''),
''),
height: 106.w, height: 106.w,
width: 106.w, width: 106.w,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -161,6 +161,32 @@ class _PersonalIndexState extends State<PersonalIndex>
); );
} }
Widget _orderButton({
required String name,
required String path,
required int index,
}) {
return MaterialButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(path, height: 50.w, width: 50.w),
10.hb,
Text(
name,
style: TextStyle(
color: Color(0xFF333333),
fontSize: 22.sp,
),
),
],
),
onPressed: () {
Get.to(() => OrderPage(initIndex: index));
},
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double _statusHeight = MediaQuery.of(context).padding.top; final double _statusHeight = MediaQuery.of(context).padding.top;
@ -175,6 +201,42 @@ class _PersonalIndexState extends State<PersonalIndex>
child: CustomScrollView( child: CustomScrollView(
slivers: <Widget>[ slivers: <Widget>[
_sliverAppBar(_statusHeight), _sliverAppBar(_statusHeight),
SliverToBoxAdapter(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_containerBar('我的订单'),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
),
shrinkWrap: true,
children: [
_orderButton(
name: '待付款',
path: R.ASSETS_ICONS_USER_ICON_DFK_PNG,
index: 1,
),
_orderButton(
name: '待收货',
path: R.ASSETS_ICONS_USER_ICON_DSH_PNG,
index: 2,
),
_orderButton(
name: '待评价',
path: R.ASSETS_ICONS_USER_ICON_DPJ_PNG,
index: 3,
),
_orderButton(
name: '售后',
path: R.ASSETS_ICONS_USER_ICON_SH_PNG,
index: 4,
),
],
),
],
),
),
SliverToBoxAdapter( SliverToBoxAdapter(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

@ -24,10 +24,6 @@ class _MarketPageState extends State<MarketPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
final mediaWidth = MediaQuery.of(context).size.width; final mediaWidth = MediaQuery.of(context).size.width;
print({
'height': MediaQuery.of(context).size.height,
'width': MediaQuery.of(context).size.width,
});
return BeeScaffold( return BeeScaffold(
title: '商城', title: '商城',
body: NestedScrollView( body: NestedScrollView(

@ -0,0 +1,33 @@
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
import 'package:flutter/material.dart';
class OrderPage extends StatefulWidget {
final int initIndex;
OrderPage({Key? key, required this.initIndex}) : super(key: key);
@override
_OrderPageState createState() => _OrderPageState();
}
class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
late TabController _tabController;
List<String> _tabs = ['全部', '待付款', '待收货', '待评价', '售后'];
@override
void initState() {
super.initState();
_tabController = TabController(
length: _tabs.length,
vsync: this,
initialIndex: widget.initIndex,
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '订单',
appBarBottom: BeeTabBar(controller: _tabController, tabs: _tabs),
);
}
}
Loading…
Cancel
Save