diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 9636e7b..499485c 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -195,7 +195,7 @@ class UserProvider extends ChangeNotifier { var base = await apiClient.request(API.exclude.find); if (base.code == 0) { await prefs.remove('exclude'); - await prefs.setStringList('exclude', base.data ?? [] as List); + await prefs.setStringList('exclude', base.data ?? []); service.invoke("stopService"); if (prefs.getBool('kg') ?? false) { Future.delayed(const Duration(seconds: 1), () async { diff --git a/lib/ui/TextMe/text_me_page.dart b/lib/ui/TextMe/text_me_page.dart index 9316084..2f1432d 100644 --- a/lib/ui/TextMe/text_me_page.dart +++ b/lib/ui/TextMe/text_me_page.dart @@ -77,6 +77,7 @@ class _TextMePageState extends State { }, "请输入短信内容...", _controller), 32.hb, _getBox('收信号码', "通讯录中选择", () { + _phoneController.text=""; Get.to(() => AddressBook( number: (List content) { for (int i = 0; i < content.length; i++) { @@ -113,7 +114,7 @@ class _TextMePageState extends State { // Telephony.sendSms(to: phoneNum!, message: idle); } }else{ - CloudToast.show(""); + CloudToast.show("您还未开通会员"); } }, border: _controller.text.isEmpty || diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 23e1441..d7c8929 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -36,7 +36,10 @@ class _HomePageState extends State with WidgetsBindingObserver { // initXUpdate(); //页面初始化的时候,添加一个状态的监听者 WidgetsBinding.instance.addObserver(this); - _listenForPermissionStatus(); + Future.delayed(const Duration(milliseconds: 500),(){ + _listenForPermissionStatus(); + }); + setState(() {}); } @@ -53,7 +56,7 @@ class _HomePageState extends State with WidgetsBindingObserver { callLog = await Permission.callLog.request().isGranted; addressBook = await Permission.contacts.request().isGranted; kg = await service.isRunning(); - setState(() {}); + // setState(() {}); } getUpdate() async { @@ -71,7 +74,7 @@ class _HomePageState extends State with WidgetsBindingObserver { context: context, builder: (context) { return AlertDialog( - title: Text("版本更新"), + title: const Text("版本更新"), content: Text(res.modifyContent), actions: [ _getBox('跳转官网下载', () async { diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 4cd92f8..e5258cd 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -1,5 +1,4 @@ import 'dart:async'; - import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; @@ -10,14 +9,10 @@ import 'package:project_telephony/ui/login/login_psd_page.dart'; import 'package:project_telephony/ui/user/set_password_page.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/utils/headers.dart'; -import 'package:provider/provider.dart'; import '../../base/base_style.dart'; import '../../constants/api.dart'; - import '../../constants/environment/environment.dart'; import '../../model/network/api_client.dart'; -import '../../model/network/base_model.dart'; -import '../../providers/user_provider.dart'; import '../../utils/toast/cloud_toast.dart'; import '../../utils/user_tool.dart'; import '../tab_navigator.dart'; diff --git a/lib/ui/tab_navigator.dart b/lib/ui/tab_navigator.dart index f20dced..1daba06 100644 --- a/lib/ui/tab_navigator.dart +++ b/lib/ui/tab_navigator.dart @@ -31,7 +31,7 @@ class _TabNavigatorState extends State // await HiveStore.init(); // }); // , const TextMePage() - _pages = [const HomePage() ,const UserPage()]; + _pages = [const HomePage() , const TextMePage(),const UserPage()]; _tabController = TabController( length: _pages.length, vsync: this, initialIndex: widget.index ?? 0); } @@ -59,8 +59,8 @@ class _TabNavigatorState extends State List _bottomNav = [ _buildBottomBar("首页", Assets.icons.homeNoSelected.path, Assets.icons.homeSelected.path), - // _buildBottomBar("群发", Assets.icons.nomass.path, - // Assets.icons.mass.path), + _buildBottomBar("群发", Assets.icons.nomass.path, + Assets.icons.mass.path), _buildBottomBar( "我的", Assets.icons.myNoselected.path, Assets.icons.mySelected.path) ];