master
王亚玲 2 years ago
parent e9a50f1496
commit 4884014ddf

@ -195,7 +195,7 @@ class UserProvider extends ChangeNotifier {
var base = await apiClient.request(API.exclude.find); var base = await apiClient.request(API.exclude.find);
if (base.code == 0) { if (base.code == 0) {
await prefs.remove('exclude'); await prefs.remove('exclude');
await prefs.setStringList('exclude', base.data ?? [] as List<String>); await prefs.setStringList('exclude', base.data ?? []);
service.invoke("stopService"); service.invoke("stopService");
if (prefs.getBool('kg') ?? false) { if (prefs.getBool('kg') ?? false) {
Future.delayed(const Duration(seconds: 1), () async { Future.delayed(const Duration(seconds: 1), () async {

@ -77,6 +77,7 @@ class _TextMePageState extends State<TextMePage> {
}, "请输入短信内容...", _controller), }, "请输入短信内容...", _controller),
32.hb, 32.hb,
_getBox('收信号码', "通讯录中选择", () { _getBox('收信号码', "通讯录中选择", () {
_phoneController.text="";
Get.to(() => AddressBook( Get.to(() => AddressBook(
number: (List<String> content) { number: (List<String> content) {
for (int i = 0; i < content.length; i++) { for (int i = 0; i < content.length; i++) {
@ -113,7 +114,7 @@ class _TextMePageState extends State<TextMePage> {
// Telephony.sendSms(to: phoneNum!, message: idle); // Telephony.sendSms(to: phoneNum!, message: idle);
} }
}else{ }else{
CloudToast.show(""); CloudToast.show("您还未开通会员");
} }
}, },
border: _controller.text.isEmpty || border: _controller.text.isEmpty ||

@ -36,7 +36,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
// initXUpdate(); // initXUpdate();
// //
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
Future.delayed(const Duration(milliseconds: 500),(){
_listenForPermissionStatus(); _listenForPermissionStatus();
});
setState(() {}); setState(() {});
} }
@ -53,7 +56,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
callLog = await Permission.callLog.request().isGranted; callLog = await Permission.callLog.request().isGranted;
addressBook = await Permission.contacts.request().isGranted; addressBook = await Permission.contacts.request().isGranted;
kg = await service.isRunning(); kg = await service.isRunning();
setState(() {}); // setState(() {});
} }
getUpdate() async { getUpdate() async {
@ -71,7 +74,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
context: context, context: context,
builder: (context) { builder: (context) {
return AlertDialog( return AlertDialog(
title: Text("版本更新"), title: const Text("版本更新"),
content: Text(res.modifyContent), content: Text(res.modifyContent),
actions: [ actions: [
_getBox('跳转官网下载', () async { _getBox('跳转官网下载', () async {

@ -1,5 +1,4 @@
import 'dart:async'; import 'dart:async';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.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/user/set_password_page.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:provider/provider.dart';
import '../../base/base_style.dart'; import '../../base/base_style.dart';
import '../../constants/api.dart'; import '../../constants/api.dart';
import '../../constants/environment/environment.dart'; import '../../constants/environment/environment.dart';
import '../../model/network/api_client.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/toast/cloud_toast.dart';
import '../../utils/user_tool.dart'; import '../../utils/user_tool.dart';
import '../tab_navigator.dart'; import '../tab_navigator.dart';

@ -31,7 +31,7 @@ class _TabNavigatorState extends State<TabNavigator>
// await HiveStore.init(); // await HiveStore.init();
// }); // });
// , const TextMePage() // , const TextMePage()
_pages = [const HomePage() ,const UserPage()]; _pages = [const HomePage() , const TextMePage(),const UserPage()];
_tabController = TabController( _tabController = TabController(
length: _pages.length, vsync: this, initialIndex: widget.index ?? 0); length: _pages.length, vsync: this, initialIndex: widget.index ?? 0);
} }
@ -59,8 +59,8 @@ class _TabNavigatorState extends State<TabNavigator>
List<BottomNavigationBarItem> _bottomNav = <BottomNavigationBarItem>[ List<BottomNavigationBarItem> _bottomNav = <BottomNavigationBarItem>[
_buildBottomBar("首页", Assets.icons.homeNoSelected.path, _buildBottomBar("首页", Assets.icons.homeNoSelected.path,
Assets.icons.homeSelected.path), Assets.icons.homeSelected.path),
// _buildBottomBar("群发", Assets.icons.nomass.path, _buildBottomBar("群发", Assets.icons.nomass.path,
// Assets.icons.mass.path), Assets.icons.mass.path),
_buildBottomBar( _buildBottomBar(
"我的", Assets.icons.myNoselected.path, Assets.icons.mySelected.path) "我的", Assets.icons.myNoselected.path, Assets.icons.mySelected.path)
]; ];

Loading…
Cancel
Save