diff --git a/android/app/build.gradle b/android/app/build.gradle
index fee774f..c497b2d 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -58,11 +58,6 @@ android {
// signingConfig signingConfigs.release
// }
}
- lintOptions {
- disable 'InvalidPackage'
- checkReleaseBuilds false
- abortOnError false
- }
}
flutter {
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 1c99814..6cd7334 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -37,9 +37,9 @@
-
-
+
+
diff --git a/android/app/src/main/res/ic_launcher.png b/android/app/src/main/res/ic_launcher.png
deleted file mode 100644
index 7325a57..0000000
Binary files a/android/app/src/main/res/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
index ab4708f..db77bb4 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-ldpi/ic_launcher.png b/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
deleted file mode 100644
index 36a6abb..0000000
Binary files a/android/app/src/main/res/mipmap-ldpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
index c36cfc6..17987b7 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
index eb524ff..09d4391 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
index 4ee0905..d5f1c8d 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index b13fdb6..4d6372e 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/assets/icons/sms.png b/assets/icons/sms.png
deleted file mode 100644
index 617b2c6..0000000
Binary files a/assets/icons/sms.png and /dev/null differ
diff --git a/lib/constants/api.dart b/lib/constants/api.dart
new file mode 100644
index 0000000..4f06a4d
--- /dev/null
+++ b/lib/constants/api.dart
@@ -0,0 +1,41 @@
+import 'environment/environment.dart';
+
+class API {
+ static const tokenKey = 'Telephony-Manage-Token';
+
+ ///HOST
+ static String get host {
+ if (DevEV.instance.dev) {
+ return 'http://10.0.2.2:8088';
+ } else {
+ return 'https://api.yunyunwenche.com';
+ }
+ }
+
+ static String get imageHost {
+ if (DevEV.instance.dev) {
+ return 'http://10.0.2.2:8088';
+ } else {
+ return 'https://static.yunyunwenche.com';
+ }
+ }
+ static const int networkTimeOut = 10000;
+
+ static String get baseURL => '$host';
+
+ static _Manager manager = _Manager();
+ static _Pay pay = _Pay();
+}
+class _Manager {
+ String get login => '/manage/login';
+ String get logout => '/manage/login/logout';
+ String get captcha => '/manage/captcha';
+ String get info => '/manage/user/info';
+}
+
+class _Pay {
+ String get wxpay => '/manage/pay/wxpay';
+ String get alipay => '/manage/pay/alipay';
+ String get wxCallback => '/callback/wxpay/notify';
+ String get aliCallback => '/callback/alipay/notify';
+}
\ No newline at end of file
diff --git a/lib/environment/environment.dart b/lib/constants/environment/environment.dart
similarity index 100%
rename from lib/environment/environment.dart
rename to lib/constants/environment/environment.dart
diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart
index 06adb78..377f5e6 100644
--- a/lib/gen/assets.gen.dart
+++ b/lib/gen/assets.gen.dart
@@ -35,9 +35,6 @@ class $AssetsIconsGen {
/// File path: assets/icons/privacy.png
AssetGenImage get privacy => const AssetGenImage('assets/icons/privacy.png');
- /// File path: assets/icons/sms.png
- AssetGenImage get sms => const AssetGenImage('assets/icons/sms.png');
-
/// File path: assets/icons/switch1.png
AssetGenImage get switch1 => const AssetGenImage('assets/icons/switch1.png');
diff --git a/lib/main.dart b/lib/main.dart
index ddce297..1cc55b9 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,6 +1,5 @@
-// import 'dart:async';
-import 'dart:async';
+import 'dart:async';
import 'package:bot_toast/bot_toast.dart';
import 'package:call_log/call_log.dart';
@@ -12,9 +11,11 @@ import 'package:flutter_sms/flutter_sms.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:power_logger/power_logger.dart';
+import 'package:project_telephony/providers/user_provider.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:telephony/telephony.dart';
+import 'package:project_telephony/utils/hive_store.dart';
void _sendSMS(String message, List recipients) async {
try{
@@ -35,6 +36,7 @@ void main() async {
await initializeService();
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
+
}
Future initializeService() async {
@@ -113,8 +115,11 @@ class _MyAppState extends State {
@override
void initState() {
super.initState();
- // PowerLogger.start(context, debug: true);
final service = FlutterBackgroundService();
+ Future.delayed(const Duration(milliseconds: 0), () async {
+ //Hive.initFlutter;
+ await HiveStore.init();
+ });
final inbox = Telephony.instance.getInboxSms();
// JPush jPush=JPush();
// jPush.setup(
@@ -137,6 +142,7 @@ class _MyAppState extends State {
// openAppSettings();
// });
}
+
// onMessage(SmsMessage message) async {
// setState(() {
// _message = message.body ?? "Error reading message body.";
@@ -160,32 +166,37 @@ class _MyAppState extends State {
@override
Widget build(BuildContext context) {
- return MediaQuery(
- data: MediaQueryData.fromWindow(WidgetsBinding.instance.window),
- child: ScreenUtilInit(
- designSize: const Size(750, 1334),
- builder: (context, child) {
- return AnnotatedRegion(
- value: const SystemUiOverlayStyle(
- statusBarColor: Colors.transparent, //状态栏背景色
- statusBarIconBrightness: Brightness.dark),
- child: GetMaterialApp(
- // get.testmode=true,
- debugShowCheckedModeBanner: false,
- home: const TabNavigator(),
- builder: (context, child) {
- // ScreenUtil.setContext(context);
- return MediaQuery(
- //设置文字大小不随系统设置改变
- data: MediaQueryData.fromWindow(
- WidgetsBinding.instance!.window)
- .copyWith(textScaleFactor: 1.0),
- child: BotToastInit().call(context, child),
- );
- },
- navigatorObservers: [BotToastNavigatorObserver()],
- ));
- },
- ));
+ return MultiProvider(
+ providers: [
+ ChangeNotifierProvider(create: (context) => UserProvider()),
+ ],
+ child: MediaQuery(
+ data: MediaQueryData.fromWindow(WidgetsBinding.instance!.window),
+ child: ScreenUtilInit(
+ designSize: const Size(750, 1334),
+ builder: (context, child) {
+ return AnnotatedRegion(
+ value: const SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent, //状态栏背景色
+ statusBarIconBrightness: Brightness.dark),
+ child: GetMaterialApp(
+ // get.testmode=true,
+ debugShowCheckedModeBanner: false,
+ home: const TabNavigator(),
+ builder: (context, child) {
+ // ScreenUtil.setContext(context);
+ return MediaQuery(
+ //设置文字大小不随系统设置改变
+ data: MediaQueryData.fromWindow(
+ WidgetsBinding.instance!.window)
+ .copyWith(textScaleFactor: 1.0),
+ child: BotToastInit().call(context, child),
+ );
+ },
+ navigatorObservers: [BotToastNavigatorObserver()],
+ ));
+ },
+ )),
+ );
}
}
diff --git a/lib/model/login_info_model.dart b/lib/model/login_info_model.dart
new file mode 100644
index 0000000..6e9b19a
--- /dev/null
+++ b/lib/model/login_info_model.dart
@@ -0,0 +1,41 @@
+import 'package:equatable/equatable.dart';
+import 'package:json_annotation/json_annotation.dart';
+part 'login_info_model.g.dart';
+
+
+@JsonSerializable()
+class LoginInfo extends Equatable {
+ final String token;
+ final User user;
+
+ factory LoginInfo.fromJson(Map json) =>
+ _$LoginInfoFromJson(json);
+
+ const LoginInfo({
+ required this.token,
+ required this.user,
+ });
+
+ @override
+ List