# Conflicts:
#	lib/constants/api.dart
#	lib/ui/widget/scaffold_theme_widget.dart
master
戴余标 2 years ago
commit bd61a99d53

@ -55,6 +55,12 @@ class _App {
///
String get trialVip => '/app/user/trialVip';
///
String get updateSelect =>'/app/update/select';
///ban
String get updateAdd => '/manage/update/add';
///
String get psdAdd=>'/app/register';

@ -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<MyApp> {
routes: {
"/TabNavigator":(context)=>const TabNavigator()
},
home: Loading(),//const TabNavigator(),
home: const Loading(),//const TabNavigator(),
builder: (context, child) {
// ScreenUtil.setContext(context);
return MediaQuery(

@ -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<String, dynamic> json) =>_$ContantListModelFromJson(json);
const ContantListModel({
required this.id,
required this.content,
required this.is_checked,
required this.isChecked,
});
@override
List<Object?> get props => [id,content,is_checked];
List<Object?> get props => [id,content,isChecked];
}

@ -10,5 +10,5 @@ ContantListModel _$ContantListModelFromJson(Map<String, dynamic> 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,
);

@ -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<String, dynamic> json) =>_$ExcludePnModelFromJson(json);
const ExcludePnModel({
required this.phone,
required this.remark,
});
@override
List<Object?> get props => [phone,remark];
}

@ -1,13 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'exclude_pn_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ExcludePnModel _$ExcludePnModelFromJson(Map<String, dynamic> json) =>
ExcludePnModel(
phone: json['phone'] as String,
remark: json['remark'] as String,
);

@ -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<PhoneNumModel> list;
factory MassListModel.fromJson(Map<String, dynamic> json) =>_$MassListModelFromJson(json);
MassListModel({
required this.title,
required this.time,
required this.state,
required this.list,
});
@override
List<Object?> get props => [title,time,state,list];
}

@ -1,15 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'mass_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MassListModel _$MassListModelFromJson(Map<String, dynamic> json) =>
MassListModel(
title: json['title'] as String,
time: json['time'] as String,
state: json['state'] as bool,
list: json['list'] as List<PhoneNumModel>,
);

@ -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';

@ -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: ''));

@ -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';

@ -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';

@ -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';

@ -97,7 +97,6 @@ class _TextTemplateState extends State<TextTemplate> {
_getListContent(String item, int index) {
return GestureDetector(
onTap: () async {
final prefs = await SharedPreferences.getInstance();
if (item != "自定义短信模版") {
// BotToast.showText(text: item);
widget.callback(item);

@ -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';

@ -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<CallLogEntry> entry = await CallLog.query();
phoneNum = entry.first.number;
callRecords = entry.first.duration;
print(phoneNum);
// if()
switch (numberSet) {

@ -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';

@ -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 {

@ -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<HomePage> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
initXUpdate();
//
WidgetsBinding.instance.addObserver(this);
_listenForPermissionStatus();
@ -55,11 +49,52 @@ class _HomePageState extends State<HomePage> 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,
///postjson
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<String, dynamic> message) async {
// print(message);
// setState(() {
// _message = "$message";
// });
// });
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -124,7 +159,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
// }
_warning() {
return Offstage(
offstage: (sms && plone && callLog && addressBook && kg),
child: GestureDetector(
onTap: () {
@ -212,63 +246,66 @@ class _HomePageState extends State<HomePage> 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(

@ -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 {

@ -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';

@ -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<PhoneSetPage> {
List<Contact>? contact;
List<String> numbers = [];
List<String>? numList = [];
DateTime? _lastTap;
final EasyRefreshController _refreshController = EasyRefreshController();
List setList = [
{

@ -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';

@ -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();

@ -9,13 +9,11 @@ import 'package:flutter/services.dart';
import 'package:project_telephony/ui/login/login_psd_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 '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart';
import '../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<TabNavigator>
// 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<TabNavigator>
List<BottomNavigationBarItem> _bottomNav = <BottomNavigationBarItem>[
_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)
];

@ -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';

@ -1,4 +1,4 @@
import 'dart:ffi';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.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';

@ -7,13 +7,6 @@ import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.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';

@ -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:

@ -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

Loading…
Cancel
Save