From 2351baca1316c7dcb57b7db6483c8c0f70b96696 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Mon, 26 Sep 2022 14:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 6 + lib/main.dart | 4 +- lib/model/contant_list_model.dart | 6 +- lib/model/contant_list_model.g.dart | 2 +- lib/model/exclude_pn_model.dart | 19 --- lib/model/exclude_pn_model.g.dart | 13 -- lib/model/mass_list_model.dart | 24 --- lib/model/mass_list_model.g.dart | 15 -- lib/model/network/api_client.dart | 4 - lib/providers/phone_num_provider.dart | 4 - lib/telephony.json | 11 ++ lib/ui/TextMe/address_book.dart | 1 - lib/ui/TextMe/call_list_page.dart | 1 - lib/ui/TextMe/text_me_page.dart | 1 - lib/ui/TextMe/text_template.dart | 1 - lib/ui/exclude/exclude_single_page.dart | 2 - lib/ui/home/call.dart | 2 - lib/ui/home/calling_idle_list.dart | 3 - lib/ui/home/content_connect_page.dart | 2 - lib/ui/home/home_page.dart | 153 +++++++++++------- .../home/set/func/exclude_contacts_func.dart | 2 - .../set/phone_num_list/call_records_list.dart | 3 - lib/ui/home/set/phone_set_page.dart | 3 - lib/ui/home/set/specify_phone_page.dart | 1 - lib/ui/loading.dart | 8 +- lib/ui/login/login_page.dart | 2 - lib/ui/tab_navigator.dart | 10 +- lib/ui/user/content_authority_page.dart | 2 - lib/ui/user/members_page.dart | 2 +- lib/ui/user/user_page.dart | 2 - lib/ui/widget/appdialog.dart | 2 - lib/ui/widget/scaffold_theme_widget.dart | 10 -- pubspec.lock | 9 +- pubspec.yaml | 6 +- 34 files changed, 139 insertions(+), 197 deletions(-) delete mode 100644 lib/model/exclude_pn_model.dart delete mode 100644 lib/model/exclude_pn_model.g.dart delete mode 100644 lib/model/mass_list_model.dart delete mode 100644 lib/model/mass_list_model.g.dart create mode 100644 lib/telephony.json diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 412388c..ba9eb3d 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -54,6 +54,12 @@ class _App { ///会员体验 String get trialVip => '/app/user/trialVip'; + + ///版本更新 + String get updateSelect =>'/app/update/select'; + + ///ban + String get updateAdd => '/manage/update/add'; } class _Content { diff --git a/lib/main.dart b/lib/main.dart index 3be61bd..a7c9aed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'dart:io'; import 'package:bot_toast/bot_toast.dart'; @@ -7,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_xupdate/flutter_xupdate.dart'; import 'package:fluwx/fluwx.dart'; import 'package:get/get_navigation/src/root/get_material_app.dart'; @@ -92,7 +94,7 @@ class _MyAppState extends State { routes: { "/TabNavigator":(context)=>const TabNavigator() }, - home: Loading(),//const TabNavigator(), + home: const Loading(),//const TabNavigator(), builder: (context, child) { // ScreenUtil.setContext(context); return MediaQuery( diff --git a/lib/model/contant_list_model.dart b/lib/model/contant_list_model.dart index ddab7f8..c62e21e 100644 --- a/lib/model/contant_list_model.dart +++ b/lib/model/contant_list_model.dart @@ -7,15 +7,15 @@ part 'contant_list_model.g.dart'; class ContantListModel extends Equatable{ final int id; final String content; - final int is_checked; + final int isChecked; factory ContantListModel.fromJson(Map json) =>_$ContantListModelFromJson(json); const ContantListModel({ required this.id, required this.content, - required this.is_checked, + required this.isChecked, }); @override - List get props => [id,content,is_checked]; + List get props => [id,content,isChecked]; } \ No newline at end of file diff --git a/lib/model/contant_list_model.g.dart b/lib/model/contant_list_model.g.dart index 05e351a..6d3f2ca 100644 --- a/lib/model/contant_list_model.g.dart +++ b/lib/model/contant_list_model.g.dart @@ -10,5 +10,5 @@ ContantListModel _$ContantListModelFromJson(Map json) => ContantListModel( id: json['id'] as int, content: json['content'] as String, - is_checked: json['is_checked'] as int, + isChecked: json['is_checked'] as int, ); diff --git a/lib/model/exclude_pn_model.dart b/lib/model/exclude_pn_model.dart deleted file mode 100644 index f0fe4b9..0000000 --- a/lib/model/exclude_pn_model.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -part 'exclude_pn_model.g.dart'; - - -@JsonSerializable() -class ExcludePnModel extends Equatable{ - final String? phone; - final String? remark; - factory ExcludePnModel.fromJson(Map json) =>_$ExcludePnModelFromJson(json); - - - const ExcludePnModel({ - required this.phone, - required this.remark, - }); - @override - List get props => [phone,remark]; -} \ No newline at end of file diff --git a/lib/model/exclude_pn_model.g.dart b/lib/model/exclude_pn_model.g.dart deleted file mode 100644 index 55ec5fe..0000000 --- a/lib/model/exclude_pn_model.g.dart +++ /dev/null @@ -1,13 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'exclude_pn_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -ExcludePnModel _$ExcludePnModelFromJson(Map json) => - ExcludePnModel( - phone: json['phone'] as String, - remark: json['remark'] as String, - ); diff --git a/lib/model/mass_list_model.dart b/lib/model/mass_list_model.dart deleted file mode 100644 index 79c33c6..0000000 --- a/lib/model/mass_list_model.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:json_annotation/json_annotation.dart'; -import 'package:equatable/equatable.dart'; -import 'package:project_telephony/model/phone_num_model.dart'; -part 'mass_list_model.g.dart'; - - -@JsonSerializable() -class MassListModel extends Equatable{ - final String title; - final String time; - bool state; - final List list; - factory MassListModel.fromJson(Map json) =>_$MassListModelFromJson(json); - - - MassListModel({ - required this.title, - required this.time, - required this.state, - required this.list, - }); - @override - List get props => [title,time,state,list]; -} \ No newline at end of file diff --git a/lib/model/mass_list_model.g.dart b/lib/model/mass_list_model.g.dart deleted file mode 100644 index 8d9a754..0000000 --- a/lib/model/mass_list_model.g.dart +++ /dev/null @@ -1,15 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mass_list_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -MassListModel _$MassListModelFromJson(Map json) => - MassListModel( - title: json['title'] as String, - time: json['time'] as String, - state: json['state'] as bool, - list: json['list'] as List, - ); diff --git a/lib/model/network/api_client.dart b/lib/model/network/api_client.dart index a5d6145..59a57b7 100644 --- a/lib/model/network/api_client.dart +++ b/lib/model/network/api_client.dart @@ -1,13 +1,9 @@ - - import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:platform/platform.dart'; - import '../../constants/api.dart'; import '../../utils/inner_model/base_list_model.dart'; import '../../utils/toast/cloud_toast.dart'; -// import 'base_list_model.dart'; import 'base_model.dart'; import 'net_interceptor.dart'; diff --git a/lib/providers/phone_num_provider.dart b/lib/providers/phone_num_provider.dart index e006ae0..6aabb28 100644 --- a/lib/providers/phone_num_provider.dart +++ b/lib/providers/phone_num_provider.dart @@ -7,10 +7,6 @@ import 'package:project_telephony/utils/hive_store.dart'; import '../model/hive/phone_model.dart'; - - - -// // await HiveStore.dataBox?.add(PhoneModel(name: full.displayName,phone:full.phones.first.number, state: false)); // phoneList=HiveStore.dataBox?.get(PhoneModel()); // HiveStore.dataBox?.add(PhoneNumberHive(state: false,phoneList: phoneList,title:"未分组联系人",time: '')); diff --git a/lib/telephony.json b/lib/telephony.json new file mode 100644 index 0000000..4277d74 --- /dev/null +++ b/lib/telephony.json @@ -0,0 +1,11 @@ +{ + "code": 0, + "msg": "操作成功", + "updateStatus": 1, + "versionCode": 2, + "versionName": "2.0.0", + "modifyContent": "1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。", + "downloadUrl": "https://www.dxbs.vip/dxbs.apk", + "apkSize": "204", + "apkMd5": "2ee1d380ffec372c3a3d92e1b8e384fd" +} \ No newline at end of file diff --git a/lib/ui/TextMe/address_book.dart b/lib/ui/TextMe/address_book.dart index 6ac25fa..c5efe19 100644 --- a/lib/ui/TextMe/address_book.dart +++ b/lib/ui/TextMe/address_book.dart @@ -1,4 +1,3 @@ -import 'package:flustars/flustars.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; diff --git a/lib/ui/TextMe/call_list_page.dart b/lib/ui/TextMe/call_list_page.dart index 07fdd21..8636e43 100644 --- a/lib/ui/TextMe/call_list_page.dart +++ b/lib/ui/TextMe/call_list_page.dart @@ -5,7 +5,6 @@ import 'package:project_telephony/utils/hive_store.dart'; import '../../base/base_style.dart'; import '../../model/hive/phone_model.dart'; -import '../../utils/user_tool.dart'; import '../exclude/exclude_contacts_page.dart'; import '../exclude/exclude_single_page.dart'; diff --git a/lib/ui/TextMe/text_me_page.dart b/lib/ui/TextMe/text_me_page.dart index 0c37086..9316084 100644 --- a/lib/ui/TextMe/text_me_page.dart +++ b/lib/ui/TextMe/text_me_page.dart @@ -9,7 +9,6 @@ import 'package:project_telephony/utils/toast/cloud_toast.dart'; import 'package:velocity_x/velocity_x.dart'; import '../../utils/user_tool.dart'; -import '../login/login_page.dart'; import '../widget/plone_back_button.dart'; import 'address_book.dart'; diff --git a/lib/ui/TextMe/text_template.dart b/lib/ui/TextMe/text_template.dart index c40d18a..dd1b088 100644 --- a/lib/ui/TextMe/text_template.dart +++ b/lib/ui/TextMe/text_template.dart @@ -97,7 +97,6 @@ class _TextTemplateState extends State { _getListContent(String item, int index) { return GestureDetector( onTap: () async { - final prefs = await SharedPreferences.getInstance(); if (item != "自定义短信模版") { // BotToast.showText(text: item); widget.callback(item); diff --git a/lib/ui/exclude/exclude_single_page.dart b/lib/ui/exclude/exclude_single_page.dart index 58fbc9a..090705c 100644 --- a/lib/ui/exclude/exclude_single_page.dart +++ b/lib/ui/exclude/exclude_single_page.dart @@ -1,9 +1,7 @@ import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:get/get_core/src/get_main.dart'; import 'package:project_telephony/model/hive/phone_model.dart'; import 'package:project_telephony/ui/widget/scaffold_theme_widget.dart'; import 'package:velocity_x/velocity_x.dart'; diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index c573fd2..7beac65 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -42,7 +42,6 @@ void onStart(ServiceInstance service) async { DartPluginRegistrant.ensureInitialized(); int flag = 0; String? phoneNum = ""; - int? callRecords = 0; String callState; service.on('stopService').listen((event) { service.stopSelf(); @@ -67,7 +66,6 @@ void onStart(ServiceInstance service) async { if (flag != 0) { final Iterable entry = await CallLog.query(); phoneNum = entry.first.number; - callRecords = entry.first.duration; print(phoneNum); // if() switch (numberSet) { diff --git a/lib/ui/home/calling_idle_list.dart b/lib/ui/home/calling_idle_list.dart index d3a78a6..0940ecc 100644 --- a/lib/ui/home/calling_idle_list.dart +++ b/lib/ui/home/calling_idle_list.dart @@ -2,9 +2,6 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:project_telephony/extensions/num_ext.dart'; import 'package:project_telephony/utils/headers.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/ui/home/content_connect_page.dart b/lib/ui/home/content_connect_page.dart index 8f4f46d..73d8366 100644 --- a/lib/ui/home/content_connect_page.dart +++ b/lib/ui/home/content_connect_page.dart @@ -5,8 +5,6 @@ import 'package:project_telephony/ui/home/calling_idle_list.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/utils/headers.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - import 'package:tab_indicator_styler/tab_indicator_styler.dart'; class ContentConnectPage extends StatefulWidget { diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index e68188c..3db1310 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -1,22 +1,15 @@ import 'dart:async'; - import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter_background_service/flutter_background_service.dart'; -import 'package:package_info/package_info.dart'; - +import 'package:flutter_xupdate/flutter_xupdate.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:project_telephony/ui/home/content_connect_page.dart'; import 'package:project_telephony/ui/home/content_refuse_page.dart'; import 'package:project_telephony/ui/home/set/phone_set_page.dart'; import 'package:project_telephony/ui/user/privacy_rights_page.dart'; -import 'package:project_telephony/ui/widget/appdialog.dart'; - -import 'package:project_telephony/ui/widget/plone_bottom.dart'; - import 'package:project_telephony/utils/headers.dart'; - -import '../tab_navigator.dart'; +import '../../utils/toast/cloud_toast.dart'; import '../user/privacy_rights_page.dart'; class HomePage extends StatefulWidget { @@ -28,7 +21,7 @@ class HomePage extends StatefulWidget { bool sms = false; bool plone = false; -bool addressBook=false; +bool addressBook = false; bool kg = false; final service = FlutterBackgroundService(); @@ -38,6 +31,7 @@ class _HomePageState extends State with WidgetsBindingObserver { @override void initState() { super.initState(); + initXUpdate(); //页面初始化的时候,添加一个状态的监听者 WidgetsBinding.instance.addObserver(this); _listenForPermissionStatus(); @@ -55,11 +49,52 @@ class _HomePageState extends State with WidgetsBindingObserver { sms = await Permission.sms.request().isGranted; plone = await Permission.phone.request().isGranted; callLog = await Permission.callLog.request().isGranted; - addressBook= await Permission.contacts.request().isGranted; + addressBook = await Permission.contacts.request().isGranted; kg = await service.isRunning(); setState(() {}); } + ///初始化 + void initXUpdate() { + FlutterXUpdate.init( + + ///是否输出日志 + debug: true, + + ///是否使用post请求 + isPost: false, + + ///post请求是否是上传json + isPostJson: false, + + ///请求响应超时时间 + timeout: 25000, + + ///是否开启自动模式 + isWifiOnly: false, + + ///是否开启自动模式 + isAutoMode: false, + + ///需要设置的公共参数 + supportSilentInstall: false, + + ///在下载过程中,如果点击了取消的话,是否弹出切换下载方式的重试提示弹窗 + enableRetry: false) + .then((value) { + // CloudToast.show("初始化成功: $value"); + }).catchError((error) { + print(error); + }); + // FlutterXUpdate.setErrorHandler( + // onUpdateError: (Map message) async { + // print(message); + // setState(() { + // _message = "$message"; + // }); + // }); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -124,7 +159,6 @@ class _HomePageState extends State with WidgetsBindingObserver { // } _warning() { return Offstage( - offstage: (sms && plone && callLog && addressBook && kg), child: GestureDetector( onTap: () { @@ -212,63 +246,66 @@ class _HomePageState extends State with WidgetsBindingObserver { _getSet() { return GestureDetector( - onTap: (){ - Navigator.of(context) - .push( - MaterialPageRoute(builder: (_) => const PhoneSetPage()), - ) - .then((val) => _listenForPermissionStatus()); - - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 42.w, vertical: 20.w), - decoration: BoxDecoration( - color: const Color(0xFFF2F9FF), - border: Border.all(color: const Color(0xFF1890FF), width: 2.w), - borderRadius: BorderRadius.circular(16.w)), - child: Row( - children: [ - SizedBox( - width: 48.w, - height: 48.w, - child: Image.asset(Assets.icons.set.path), - ), - 16.wb, - Text( - "短信发送号码设置", - style: TextStyle(fontSize: 28.sp, color: const Color(0xFF1890FF)), - ), - 190.wb, - SizedBox( - width: 48.w, - height: 48.w, - child: const Icon( - Icons.chevron_right, - color: Color(0xFF1890FF), + onTap: () { + Navigator.of(context) + .push( + MaterialPageRoute(builder: (_) => const PhoneSetPage()), + ) + .then((val) => _listenForPermissionStatus()); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 42.w, vertical: 20.w), + decoration: BoxDecoration( + color: const Color(0xFFF2F9FF), + border: Border.all(color: const Color(0xFF1890FF), width: 2.w), + borderRadius: BorderRadius.circular(16.w)), + child: Row( + children: [ + SizedBox( + width: 48.w, + height: 48.w, + child: Image.asset(Assets.icons.set.path), ), - ), - ], - ), - ), - ); + 16.wb, + Text( + "短信发送号码设置", + style: + TextStyle(fontSize: 28.sp, color: const Color(0xFF1890FF)), + ), + 190.wb, + SizedBox( + width: 48.w, + height: 48.w, + child: const Icon( + Icons.chevron_right, + color: Color(0xFF1890FF), + ), + ), + ], + ), + )); } + // void checkUpdateDefault() { + // FlutterXUpdate.checkUpdate(url: 'https://gitee.com/xuexiangjys/XUpdate/raw/master/jsonapi/update_test.json'); + // } _getContainer(String title, String text, String image, Color cl1, Color cl2) { return GestureDetector( - - onTap: () async{ + onTap: () async { + FlutterXUpdate.checkUpdate( + url:''); // PackageInfo packageInfo = await PackageInfo.fromPlatform(); // String version = packageInfo.version;//版本号 // String buildNumber = packageInfo.buildNumber;//版本构建号 // print(version); // print(buildNumber); // print(title); - if (title == "接听后") { - Get.to(() => const ContentConnectPage()); - } else { - Get.to(() => const ContentRefusePage()); - // print("未接听"); - } + // if (title == "接听后") { + // Get.to(() => const ContentConnectPage()); + // } else { + // Get.to(() => const ContentRefusePage()); + // // print("未接听"); + // } }, child: Container( decoration: BoxDecoration( diff --git a/lib/ui/home/set/func/exclude_contacts_func.dart b/lib/ui/home/set/func/exclude_contacts_func.dart index 2c472c2..14e8bac 100644 --- a/lib/ui/home/set/func/exclude_contacts_func.dart +++ b/lib/ui/home/set/func/exclude_contacts_func.dart @@ -2,9 +2,7 @@ import 'package:project_telephony/constants/api.dart'; import 'package:project_telephony/model/network/api_client.dart'; import 'package:project_telephony/model/network/base_model.dart'; import 'package:project_telephony/utils/inner_model/base_list_model.dart'; - import '../../../../model/exclude_phone_model.dart'; -import '../../../../model/exclude_pn_model.dart'; import '../../../../utils/toast/cloud_toast.dart'; class ExcludeFunc { diff --git a/lib/ui/home/set/phone_num_list/call_records_list.dart b/lib/ui/home/set/phone_num_list/call_records_list.dart index 089c4b5..462ac86 100644 --- a/lib/ui/home/set/phone_num_list/call_records_list.dart +++ b/lib/ui/home/set/phone_num_list/call_records_list.dart @@ -3,12 +3,9 @@ import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:project_telephony/base/base_style.dart'; -import 'package:project_telephony/constants/api.dart'; -import 'package:project_telephony/model/network/api_client.dart'; import 'package:project_telephony/ui/home/set/func/exclude_contacts_func.dart'; import 'package:project_telephony/utils/headers.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import '../../../../model/exclude_pn_model.dart'; import '../../../../model/phone_num_model.dart'; import '../../../../utils/toast/cloud_toast.dart'; import '../../../widget/scaffold_theme_widget.dart'; diff --git a/lib/ui/home/set/phone_set_page.dart b/lib/ui/home/set/phone_set_page.dart index 95706c3..158048e 100644 --- a/lib/ui/home/set/phone_set_page.dart +++ b/lib/ui/home/set/phone_set_page.dart @@ -1,8 +1,6 @@ -import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter_background_service/flutter_background_service.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:project_telephony/ui/home/set/func/exclude_contacts_func.dart'; import 'package:project_telephony/ui/home/set/specify_phone_page.dart'; import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/user_tool.dart'; @@ -28,7 +26,6 @@ class _PhoneSetPageState extends State { List? contact; List numbers = []; List? numList = []; - DateTime? _lastTap; final EasyRefreshController _refreshController = EasyRefreshController(); List setList = [ { diff --git a/lib/ui/home/set/specify_phone_page.dart b/lib/ui/home/set/specify_phone_page.dart index 4d4ea83..29467d2 100644 --- a/lib/ui/home/set/specify_phone_page.dart +++ b/lib/ui/home/set/specify_phone_page.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:project_telephony/constants/api.dart'; import 'package:project_telephony/model/network/api_client.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:project_telephony/ui/exclude/exclude_contacts_page.dart'; import 'package:project_telephony/ui/exclude/exclude_single_page.dart'; import 'package:project_telephony/ui/home/set/phone_num_list/call_records_list.dart'; diff --git a/lib/ui/loading.dart b/lib/ui/loading.dart index d44c146..030e2c4 100644 --- a/lib/ui/loading.dart +++ b/lib/ui/loading.dart @@ -1,18 +1,16 @@ -import 'package:flutter/foundation.dart'; + import 'package:flutter/material.dart'; -import 'package:project_telephony/ui/login/login_page.dart'; import 'package:project_telephony/ui/tab_navigator.dart'; import 'dart:async'; - import 'package:project_telephony/utils/headers.dart'; import 'package:provider/provider.dart'; import '../providers/user_provider.dart'; -import '../utils/hive_store.dart'; + class Loading extends StatefulWidget { - Loading({Key? key}) : super(key: key); + const Loading({Key? key}) : super(key: key); @override _LoadingState createState() => _LoadingState(); diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index f24b7b5..c5529c9 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -8,13 +8,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.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 '../../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 bb10aad..f20dced 100644 --- a/lib/ui/tab_navigator.dart +++ b/lib/ui/tab_navigator.dart @@ -1,11 +1,7 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; - import 'package:project_telephony/ui/user/user_page.dart'; import 'package:project_telephony/utils/headers.dart'; - - -import '../utils/hive_store.dart'; import 'TextMe/text_me_page.dart'; import 'home/home_page.dart'; @@ -35,7 +31,7 @@ class _TabNavigatorState extends State // await HiveStore.init(); // }); // , const TextMePage() - _pages = [const HomePage() , const TextMePage(),const UserPage()]; + _pages = [const HomePage() ,const UserPage()]; _tabController = TabController( length: _pages.length, vsync: this, initialIndex: widget.index ?? 0); } @@ -63,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) ]; diff --git a/lib/ui/user/content_authority_page.dart b/lib/ui/user/content_authority_page.dart index b2573f5..98ed967 100644 --- a/lib/ui/user/content_authority_page.dart +++ b/lib/ui/user/content_authority_page.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; - import '../../base/base_style.dart'; import '../widget/plone_back_button.dart'; diff --git a/lib/ui/user/members_page.dart b/lib/ui/user/members_page.dart index a8dca61..f9301ea 100644 --- a/lib/ui/user/members_page.dart +++ b/lib/ui/user/members_page.dart @@ -1,4 +1,4 @@ -import 'dart:ffi'; + import 'package:bot_toast/bot_toast.dart'; import 'package:flustars/flustars.dart'; diff --git a/lib/ui/user/user_page.dart b/lib/ui/user/user_page.dart index 9006a9b..1fd483c 100644 --- a/lib/ui/user/user_page.dart +++ b/lib/ui/user/user_page.dart @@ -6,8 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_background_service/flutter_background_service.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_update_dialog/update_dialog.dart'; - import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/ui/login/login_page.dart'; import 'package:project_telephony/ui/tab_navigator.dart'; diff --git a/lib/ui/widget/appdialog.dart b/lib/ui/widget/appdialog.dart index 2d527c0..9b0729d 100644 --- a/lib/ui/widget/appdialog.dart +++ b/lib/ui/widget/appdialog.dart @@ -3,8 +3,6 @@ import 'package:flutter/material.dart'; import 'package:project_telephony/utils/headers.dart'; -import 'package:project_telephony/utils/user_tool.dart'; - import '../../constants/api.dart'; import '../../model/network/api_client.dart'; import '../../utils/toast/cloud_toast.dart'; diff --git a/lib/ui/widget/scaffold_theme_widget.dart b/lib/ui/widget/scaffold_theme_widget.dart index b6b0159..35c2790 100644 --- a/lib/ui/widget/scaffold_theme_widget.dart +++ b/lib/ui/widget/scaffold_theme_widget.dart @@ -1,18 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:project_telephony/model/sms_content_model.dart'; -import 'package:project_telephony/utils/user_tool.dart'; -import 'package:provider/provider.dart'; import '../../base/base_style.dart'; -import '../../constants/api.dart'; -import '../../model/network/api_client.dart'; -import '../../model/network/base_model.dart'; -import '../../model/user_info_model.dart'; -import '../../providers/user_provider.dart'; -import '../../utils/toast/cloud_toast.dart'; -import '../user/content_details_page.dart'; import '../widget/plone_back_button.dart'; import '../widget/plone_bottom.dart'; diff --git a/pubspec.lock b/pubspec.lock index 90052e4..573522a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -275,7 +275,7 @@ packages: source: hosted version: "2.1.1" dio: - dependency: transitive + dependency: "direct main" description: name: dio url: "https://pub.dartlang.org" @@ -447,6 +447,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_xupdate: + dependency: "direct main" + description: + name: flutter_xupdate + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" fluwx: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 31056bb..6af7518 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.0.0+2 +version: 1.0.0+1 environment: sdk: ">=2.16.0 <3.0.0" @@ -101,6 +101,10 @@ dependencies: flutter_sms: ^2.3.3 # 弹出框 flutter_update_dialog: ^2.0.0 +# http + dio: ^4.0.6 +# 版本跟新 + flutter_xupdate: ^2.0.3 ## 生成适配器 # hive_generator: ^1.1.3 # # jdk