更改隐私政策

hmxc
张萌 3 years ago
parent 29350221f6
commit 5785f00245

@ -380,10 +380,11 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.akuCommunityManager; PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.manage;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Profile; name = Profile;
@ -509,11 +510,12 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.akuCommunityManager; PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.manage;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
@ -532,10 +534,11 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.akuCommunityManager; PRODUCT_BUNDLE_IDENTIFIER = com.akucommunity.manage;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;

@ -4,34 +4,6 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>NSContactsUsageDescription</key>
<string>we need contact access rights.</string>
<key>NSCalendarsUsageDescription</key>
<string>we need calendar access rights.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>we need photo access rights.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>we need bluetooth access rights</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>we need bluetooth access rights</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>we need photo access rights.</string>
<key>NSCameraUsageDescription</key>
<string>we need camera access rights.</string>
<key>NSAppleMusicUsageDescription</key>
<string>we need music access rights.</string>
<key>NSMotionUsageDescription</key>
<string>we need motion access rights.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>we need speech recognition access rights.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>we need location access rights.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>we need location access rights.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>we need location access rights.</string>
<key>CFBundleName</key>
<string>bee</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -50,6 +22,37 @@
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>we need music access rights.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>we need bluetooth access rights</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>we need bluetooth access rights</string>
<key>NSCalendarsUsageDescription</key>
<string>we need calendar access rights.</string>
<key>NSCameraUsageDescription</key>
<string>we need camera access rights.</string>
<key>NSContactsUsageDescription</key>
<string>we need contact access rights.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>we need location access rights.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>we need location access rights.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>we need location access rights.</string>
<key>NSMotionUsageDescription</key>
<string>we need motion access rights.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>we need photo access rights.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>we need photo access rights.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>we need speech recognition access rights.</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
@ -69,10 +72,5 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict> </dict>
</plist> </plist>

@ -1,26 +1,24 @@
// Dart imports: // Dart imports:
import 'dart:io'; import 'dart:io';
// Project imports:
import 'package:aku_community_manager/const/api.dart';
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/user/user_info_model.dart'; import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/models/user/user_profile_model.dart';
import 'package:aku_community_manager/provider/message_provider.dart'; import 'package:aku_community_manager/provider/message_provider.dart';
import 'package:aku_community_manager/utils/hive_store.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_community_manager/utils/websocket/web_socket_util.dart'; import 'package:aku_community_manager/utils/websocket/web_socket_util.dart';
import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/user/user_profile_model.dart';
import 'package:aku_community_manager/utils/hive_store.dart';
import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
// //
class UserProvider extends ChangeNotifier { class UserProvider extends ChangeNotifier {
bool _isLogin = false; bool _isLogin = false;
@ -36,7 +34,7 @@ class UserProvider extends ChangeNotifier {
_profileModel = await updateProfile(); _profileModel = await updateProfile();
_infoModel = await updateUserInfo(); _infoModel = await updateUserInfo();
if (isLogin) { if (isLogin) {
WebSocketUtil().setUser(infoModel!.id.toString()); WebSocketUtil().setUser(_infoModel?.id.toString() ?? '');
WebSocketUtil().startWebSocket(); WebSocketUtil().startWebSocket();
} }
// await setCurrentHouse((_userDetailModel?.estateNames?.isEmpty ?? true) // await setCurrentHouse((_userDetailModel?.estateNames?.isEmpty ?? true)
@ -46,8 +44,10 @@ class UserProvider extends ChangeNotifier {
} }
UserProfileModel? _profileModel; UserProfileModel? _profileModel;
UserProfileModel? get profileModel => _profileModel; UserProfileModel? get profileModel => _profileModel;
UserInfoModel? _infoModel; UserInfoModel? _infoModel;
UserInfoModel? get infoModel => _infoModel; UserInfoModel? get infoModel => _infoModel;
///profile ///profile

@ -1,25 +1,20 @@
// Dart imports: // Dart imports:
import 'dart:ui'; import 'dart:ui';
// Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:extended_text/extended_text.dart';
import 'package:get/route_manager.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/agreements/agreement_page.dart';
import 'package:aku_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_community_manager/ui/login/login_sms_page.dart'; import 'package:aku_community_manager/ui/login/login_sms_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
// Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
LoginPage({Key? key}) : super(key: key); LoginPage({Key? key}) : super(key: key);
@ -139,58 +134,58 @@ class _LoginPageState extends State<LoginPage> {
), ),
], ],
), ),
bottom: Container( // bottom: Container(
height: 110.w, // height: 110.w,
alignment: Alignment.center, // alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 40.w), // padding: EdgeInsets.symmetric(vertical: 40.w),
child: ExtendedText.rich( // child: ExtendedText.rich(
TextSpan( // TextSpan(
style: TextStyle( // style: TextStyle(
color: AppStyle.minorTextColor, // color: AppStyle.minorTextColor,
fontSize: 22.sp, // fontSize: 22.sp,
), // ),
children: [ // children: [
TextSpan( // TextSpan(
text: '登录即代表您已同意我们的', // text: '登录即代表您已同意我们的',
), // ),
ExtendedWidgetSpan( // ExtendedWidgetSpan(
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
Get.to(() => AgreementPage()); // Get.to(() => AgreementPage());
}, // },
child: Text( // child: Text(
'《服务协议》', // '《服务协议》',
style: TextStyle( // style: TextStyle(
color: AppStyle.secondaryColor, // color: AppStyle.secondaryColor,
fontSize: 22.sp, // fontSize: 22.sp,
), // ),
), // ),
), // ),
), // ),
TextSpan( // TextSpan(
text: '', // text: '',
), // ),
ExtendedWidgetSpan( // ExtendedWidgetSpan(
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
Get.to(() => PrivacyPage()); // Get.to(() => PrivacyPage());
}, // },
child: Text( // child: Text(
'《隐私政策》', // '《隐私政策》',
style: TextStyle( // style: TextStyle(
color: AppStyle.secondaryColor, // color: AppStyle.secondaryColor,
fontSize: 22.sp, // fontSize: 22.sp,
), // ),
), // ),
), // ),
), // ),
TextSpan( // TextSpan(
text: '', // text: '',
), // ),
], // ],
), // ),
), // ),
), // ),
); );
} }
} }

@ -213,6 +213,8 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
await Get.to(
() => EngineerRepairDetailPage(repairEngineerId: model.id));
callRefresh(); callRefresh();
}, },
radius: 4, radius: 4,
@ -301,6 +303,8 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {
await Get.to(
() => EngineerRepairDetailPage(repairEngineerId: model.id));
callRefresh(); callRefresh();
}, },
radius: 4, radius: 4,

@ -1,16 +1,15 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_view.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_view.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
class FacilitiesPage extends StatefulWidget { class FacilitiesPage extends StatefulWidget {
final int facilitiesType; final int facilitiesType;
FacilitiesPage({Key? key, required this.facilitiesType}) : super(key: key); FacilitiesPage({Key? key, required this.facilitiesType}) : super(key: key);
@override @override
@ -40,7 +39,7 @@ class _FacilitiesPageState extends State<FacilitiesPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
title: '设施检查', title: widget.facilitiesType == 1 ? '设施检查' : '设备检查',
appBarBottom: PreferredSize( appBarBottom: PreferredSize(
child: AkuTabBar(controller: _tabController!, tabs: _tabs), child: AkuTabBar(controller: _tabController!, tabs: _tabs),
preferredSize: Size.fromHeight(88.w), preferredSize: Size.fromHeight(88.w),

@ -206,7 +206,17 @@ class HouseKeepingCard extends StatelessWidget {
UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.PICK UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.PICK
? AkuMaterialButton( ? AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -243,7 +253,17 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -262,7 +282,17 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -281,7 +311,17 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -300,7 +340,17 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -319,7 +369,17 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async {}, onPressed: () async {
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
callRefresh: callRefresh,
));
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),

@ -1,9 +1,20 @@
// Flutter imports: // Flutter imports:
import 'package:flutter/material.dart'; // Project imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/agreements/agreement_page.dart';
import 'package:aku_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_community_manager/ui/home/home_page.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/hive_store.dart';
// Package imports: // Package imports:
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart' hide Response; import 'package:get/get.dart' hide Response;
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
@ -11,14 +22,6 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/home_page.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/hive_store.dart';
class SplashPage extends StatefulWidget { class SplashPage extends StatefulWidget {
SplashPage({Key? key}) : super(key: key); SplashPage({Key? key}) : super(key: key);
@ -27,19 +30,8 @@ class SplashPage extends StatefulWidget {
} }
class _SplashPageState extends State<SplashPage> { class _SplashPageState extends State<SplashPage> {
Future _originOp() async { TapGestureRecognizer _agreementRecognizer = TapGestureRecognizer();
final userProvider = Provider.of<UserProvider>(context, listen: false); TapGestureRecognizer _privacyRecognizer = TapGestureRecognizer();
//HiveStore
await Hive.initFlutter();
await HiveStore.init();
if (HiveStore.appBox!.containsKey('token')) {
await userProvider.setLogin(HiveStore.appBox!.get('token'));
}
//AMap
// await AmapLocation.instance.init(iosKey: 'ios key');
await Permission.locationWhenInUse.request();
}
Future _initialization() async { Future _initialization() async {
await Firebase.initializeApp(); await Firebase.initializeApp();
@ -50,21 +42,89 @@ class _SplashPageState extends State<SplashPage> {
} }
Future _initOp() async { Future _initOp() async {
await _originOp(); final userProvider = Provider.of<UserProvider>(context, listen: false);
if (HiveStore.appBox!.containsKey('token')) {
await userProvider.setLogin(HiveStore.appBox!.get('token'));
}
//AMap
// await AmapLocation.instance.init(iosKey: 'ios key');
await Permission.locationWhenInUse.request();
final appProvider = Provider.of<AppProvider>(context, listen: false); final appProvider = Provider.of<AppProvider>(context, listen: false);
appProvider.startLocation(); appProvider.startLocation();
} }
Future<bool?> _showLoginVerify() async {
return await showCupertinoDialog(
barrierDismissible: false,
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: Text('隐私政策和用户协议'),
content: RichText(
text: TextSpan(
text: '点击登录即表示您已阅读并同意',
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: '《用户协议》',
style: TextStyle(color: Colors.blue),
recognizer: _agreementRecognizer
..onTap = () {
Get.to(() => AgreementPage());
}),
TextSpan(
text: '《隐私政策》',
style: TextStyle(color: Colors.blue),
recognizer: _privacyRecognizer
..onTap = () {
Get.to(() => PrivacyPage());
}),
TextSpan(
style: TextStyle(color: Colors.black),
text:
'(特别是免除或限制责任、管辖等粗体下划线标注的条款)。如您不同意上述协议的任何条款,您应立即停止登录及使用本软件及服务。')
]),
),
// ),
actions: [
CupertinoDialogAction(
child: Text('同意'),
onPressed: () => Get.back(result: true),
),
CupertinoDialogAction(
child: Text('拒绝'),
onPressed: () => Get.back(result: false),
),
],
);
},
);
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Future.delayed(Duration(milliseconds: 300), () { Future.delayed(Duration(milliseconds: 1000), () async {
//HiveStore
await Hive.initFlutter();
await HiveStore.init();
var agreement = false;
if (HiveStore.appBox!.containsKey('agreement')) {
agreement = await HiveStore.appBox!.get('agreement');
}
if (!agreement) {
var result = await _showLoginVerify();
if (result == null || !result) {
SystemNavigator.pop();
HiveStore.appBox!.put('agreement', false);
} else {
HiveStore.appBox!.put('agreement', true);
}
}
if (mounted) PowerLogger.start(context, debug: DevUtil.isDev); if (mounted) PowerLogger.start(context, debug: DevUtil.isDev);
});
Future.delayed(Duration(milliseconds: 2000), () async {
await _initOp(); await _initOp();
Get.off(() => HomePage());
Get.off(()=>HomePage());
}); });
} }

@ -3,7 +3,7 @@ description: A new Flutter application.
publish_to: "none" publish_to: "none"
version: 1.7.0-dev+13 version: 1.8.1-dev+15
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'

Loading…
Cancel
Save