From 7ad1c05bdb90aa2a010d0d40cc14735bde370041 Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Mon, 16 Nov 2020 15:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dart_tool/package_config.json | 2 +- .../notification_setting_dialog.dart | 55 ++++++++++++++++++- lib/pages/home_page/home_page.dart | 10 +++- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 0d72e23..8da4c5d 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -650,7 +650,7 @@ "languageVersion": "2.8" } ], - "generated": "2020-11-16T03:42:31.306535Z", + "generated": "2020-11-16T05:49:00.255241Z", "generator": "pub", "generatorVersion": "2.8.2" } diff --git a/lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart b/lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart index d40d6c1..0831fba 100644 --- a/lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart +++ b/lib/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart @@ -1,3 +1,5 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class NotificationSettingDialog extends StatefulWidget { @@ -23,9 +25,56 @@ class _NotificationSettingDialogContainerState extends State<_NotificationSettingDialogContainer> { @override Widget build(BuildContext context) { - return Center( - child: Container( - width: 280, + return Scaffold( + backgroundColor: Colors.transparent, + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 280, + // height: 382, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + + ), + child: Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + topRight: Radius.circular(10)), + child: CachedNetworkImage( + imageUrl: + 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1456601714,1347673110&fm=26&gp=0.jpg', + ), + ), + Text('开启推送通知'), + ], + ), + ), + GestureDetector( + child: Container( + width: 30, + height: 30, + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Color(0x70606060), + borderRadius: BorderRadius.circular(15), + ), + child: Center( + child: Icon( + Icons.close, + color: Colors.white, + ), + ), + ), + onTap: () { + Navigator.pop(context); + }, + ) + ], ), ); } diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index 7a451bb..5359e6d 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -4,11 +4,12 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart'; import 'package:zhiying_base_widget/utils/contants.dart'; import 'package:zhiying_comm/models/base/base_tab_model.dart'; import 'package:zhiying_comm/util/image_util.dart'; -import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/util/update/app_update_util.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; class HomePage extends StatefulWidget { HomePage({Key key}) : super(key: key); @@ -40,7 +41,10 @@ class _HomePageState extends State { super.initState(); } - + @override + void didChangeDependencies() { + super.didChangeDependencies(); + } @override Widget build(BuildContext context) { @@ -126,6 +130,8 @@ class _HomePageState extends State { } Future _checkLimit(BaseTabModel model) async { + showCupertinoDialog( + context: context, builder: (_) => NotificationSettingDialog()); if (model.requiredLogin == '1') { UserInfoModel user = await Provider.of(context, listen: false)