|
|
@@ -1,8 +1,10 @@
|
|
|
+import 'dart:io';
|
|
|
import 'dart:ui';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
+import 'package:location/resource/colors.gen.dart';
|
|
|
import 'package:location/utils/common_expand.dart';
|
|
|
|
|
|
import '../resource/assets.gen.dart';
|
|
|
@@ -36,8 +38,8 @@ class CheckLocationPermissionView extends Dialog {
|
|
|
Widget build(BuildContext context) {
|
|
|
//图片当做背景
|
|
|
return Container(
|
|
|
- width: 289.w,
|
|
|
- height: 223.w,
|
|
|
+ width: 290.w,
|
|
|
+ height: 230.w,
|
|
|
decoration: BoxDecoration(
|
|
|
image: DecorationImage(
|
|
|
image: Assets.images.bgCheckLocationPermission.provider(),
|
|
|
@@ -56,48 +58,65 @@ class CheckLocationPermissionView extends Dialog {
|
|
|
Text(StringName.dialogRecordLocationHasPermission,
|
|
|
style: TextStyle(fontSize: 15.sp, color: '#404040'.color)),
|
|
|
SizedBox(height: 20.6.w),
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- CheckLocationPermissionDialog.dismiss();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border.all(color: '#AAAAAA'.color, width: 1.w),
|
|
|
- borderRadius: BorderRadius.circular(54.w),
|
|
|
- ),
|
|
|
- width: 109.w,
|
|
|
- height: 40.w,
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- StringName.dialogRecordLocationNotRequest,
|
|
|
- style: TextStyle(fontSize: 14.sp, color: '#AAAAAA'.color),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(width: 16.w),
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- onRequestPermissionClick.call();
|
|
|
- CheckLocationPermissionDialog.dismiss();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- decoration: getPrimaryBtnDecoration(54.w),
|
|
|
- width: 109.w,
|
|
|
- height: 40.w,
|
|
|
- child: Center(
|
|
|
- child: Text(StringName.dialogRecordLocationRequest,
|
|
|
- style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- )
|
|
|
+ if (Platform.isIOS) buildIosBtnView() else buildAndroidBtnView(),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ Widget buildIosBtnView() {
|
|
|
+ return Container(
|
|
|
+ width: 229.w,
|
|
|
+ height: 40.w,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.colorPrimary,
|
|
|
+ borderRadius: BorderRadius.circular(54.w),
|
|
|
+ ),
|
|
|
+ child: Center(
|
|
|
+ child: Text(StringName.nextStep,
|
|
|
+ style: TextStyle(fontSize: 14.sp, color: ColorName.white))));
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildAndroidBtnView() {
|
|
|
+ return Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ CheckLocationPermissionDialog.dismiss();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(color: '#AAAAAA'.color, width: 1.w),
|
|
|
+ borderRadius: BorderRadius.circular(54.w),
|
|
|
+ ),
|
|
|
+ width: 109.w,
|
|
|
+ height: 40.w,
|
|
|
+ child: Center(
|
|
|
+ child: Text(
|
|
|
+ StringName.dialogRecordLocationNotRequest,
|
|
|
+ style: TextStyle(fontSize: 14.sp, color: '#AAAAAA'.color),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(width: 16.w),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ onRequestPermissionClick.call();
|
|
|
+ CheckLocationPermissionDialog.dismiss();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: getPrimaryBtnDecoration(54.w),
|
|
|
+ width: 109.w,
|
|
|
+ height: 40.w,
|
|
|
+ child: Center(
|
|
|
+ child: Text(StringName.dialogRecordLocationRequest,
|
|
|
+ style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|