Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
38ab3c161b
@ -30,7 +30,6 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<!--允许麦克风权限,用于录音发送-->
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
|
||||
@ -64,7 +64,7 @@ post_install do |installer|
|
||||
# 'PERMISSION_CONTACTS=1',
|
||||
|
||||
## dart: PermissionGroup.camera
|
||||
# 'PERMISSION_CAMERA=1',
|
||||
'PERMISSION_CAMERA=1',
|
||||
|
||||
## dart: PermissionGroup.microphone
|
||||
# 'PERMISSION_MICROPHONE=1',
|
||||
@ -73,7 +73,7 @@ post_install do |installer|
|
||||
# 'PERMISSION_SPEECH_RECOGNIZER=1',
|
||||
|
||||
## dart: PermissionGroup.photos
|
||||
# 'PERMISSION_PHOTOS=1',
|
||||
'PERMISSION_PHOTOS=1',
|
||||
|
||||
# dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
|
||||
'PERMISSION_LOCATION=1',
|
||||
|
||||
@ -145,6 +145,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.mineSetPage);
|
||||
}),
|
||||
//上架审核
|
||||
F.appFlavor == Flavor.sky
|
||||
? Container()
|
||||
: mineItem('images/mine/icon_mine_main_vip.png',
|
||||
@ -152,11 +153,13 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.valueAddedServicesPage);
|
||||
}),
|
||||
mineItem('images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr,
|
||||
() {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.lockMallPage);
|
||||
}),
|
||||
F.appFlavor == Flavor.sky
|
||||
? Container()
|
||||
: mineItem(
|
||||
'images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.lockMallPage);
|
||||
}),
|
||||
mineItem('images/mine/icon_mine_main_about.png',
|
||||
TranslationLoader.lanKeys!.about!.tr, () {
|
||||
Get.back();
|
||||
|
||||
@ -43,48 +43,42 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.avatar!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 100.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: ClipOval(
|
||||
child: state.mineInfoData.value.headUrl != null
|
||||
? CachedNetworkImage(
|
||||
imageUrl: Uri.encodeFull(
|
||||
state.mineInfoData.value.headUrl!),
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
placeholder: (context, url) => Image.asset(
|
||||
'images/controls_user.png',
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
))
|
||||
: Image.asset(
|
||||
'images/controls_user.png',
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
action: () async {
|
||||
//安卓平台下首次进入应用需向用户告知获取权限用途弹窗
|
||||
if (Platform.isAndroid) {
|
||||
AppFirstEnterHandle()
|
||||
.getAppFirstEnter(context, isAgreeCamera);
|
||||
var getFlag = await Storage.getString(isAgreeCamera);
|
||||
if (getFlag == isAgreeCamera) {
|
||||
requestCameraPermission();
|
||||
}
|
||||
} else {
|
||||
requestCameraPermission();
|
||||
}
|
||||
},
|
||||
)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.avatar!.tr,
|
||||
rightTitle: "",
|
||||
allHeight: 100.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: ClipOval(
|
||||
child: state.image != null
|
||||
? Image.file(
|
||||
File(state.image!.path),
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
)
|
||||
: Image.asset(
|
||||
'images/controls_user.png',
|
||||
width: 72.w,
|
||||
height: 72.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
action: () async {
|
||||
//安卓平台下首次进入应用需向用户告知获取权限用途弹窗
|
||||
if (Platform.isAndroid) {
|
||||
AppFirstEnterHandle()
|
||||
.getAppFirstEnter(context, isAgreeCamera);
|
||||
var getFlag = await Storage.getString(isAgreeCamera);
|
||||
if (getFlag == isAgreeCamera) {
|
||||
_openModalBottomSheet();
|
||||
}
|
||||
} else {
|
||||
_openModalBottomSheet();
|
||||
}
|
||||
},
|
||||
),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
|
||||
rightTitle: state.mineInfoData.value.nickname != null
|
||||
@ -189,7 +183,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
if (status.isGranted) {
|
||||
// 如果权限已经被授予,执行您的相机操作
|
||||
// 这里可以调用打开相机的方法或者跳转到相机页面等
|
||||
_openModalBottomSheet();
|
||||
selectCamera();
|
||||
} else {
|
||||
// 如果权限尚未被授予,请求相机权限
|
||||
// 此处会显示系统权限请求对话框
|
||||
@ -197,28 +191,53 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
|
||||
if (status.isGranted) {
|
||||
// 如果用户授予了相机权限,执行您的相机操作
|
||||
_openModalBottomSheet();
|
||||
selectCamera();
|
||||
} else {
|
||||
// 如果用户拒绝了相机权限,您可以提供适当的提示
|
||||
// 或者引导用户手动授予权限
|
||||
_showPermissinDialog();
|
||||
showPermissionDeniedDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future _showPermissinDialog() async {
|
||||
Future<void> requestPhotoPermission() async {
|
||||
// 检查是否已经授予相机权限
|
||||
PermissionStatus status = await Permission.photos.status;
|
||||
|
||||
if (status.isGranted) {
|
||||
// 如果权限已经被授予,执行您的相机操作
|
||||
// 这里可以调用打开相机的方法或者跳转到相机页面等
|
||||
selectImage();
|
||||
} else {
|
||||
// 如果权限尚未被授予,请求相机权限
|
||||
// 此处会显示系统权限请求对话框
|
||||
status = await Permission.photos.request();
|
||||
|
||||
if (status.isGranted) {
|
||||
// 如果用户授予了相机权限,执行您的相机操作
|
||||
selectImage();
|
||||
} else {
|
||||
// 如果用户拒绝了相机权限,您可以提供适当的提示
|
||||
// 或者引导用户手动授予权限
|
||||
showPermissionDeniedDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 显示权限被永久拒绝的提示对话框
|
||||
void showPermissionDeniedDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Permission Required'),
|
||||
content: const Text(
|
||||
'You need to grant camera permission to use this feature.'),
|
||||
title: const Text('权限被拒绝'),
|
||||
content: const Text('请手动在系统设置中开启相册权限以继续使用应用。'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('OK'),
|
||||
child: const Text('去设置'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
openAppSettings(); // 打开系统设置页面
|
||||
Navigator.of(context).pop(); // 关闭对话框
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -240,9 +259,11 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
int getSelectIndex = value;
|
||||
if (getSelectIndex == 0) {
|
||||
//拍照选项
|
||||
selectCamera();
|
||||
// selectCamera();
|
||||
requestCameraPermission();
|
||||
} else if (getSelectIndex == 1) {
|
||||
selectImage();
|
||||
// selectImage();
|
||||
requestPhotoPermission();
|
||||
}
|
||||
},
|
||||
);
|
||||
@ -278,4 +299,24 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
// child: state.mineInfoData.value.headUrl != null
|
||||
// ? CachedNetworkImage(
|
||||
// imageUrl: Uri.encodeFull(
|
||||
// state.mineInfoData.value.headUrl!),
|
||||
// width: 72.w,
|
||||
// height: 72.w,
|
||||
// fit: BoxFit.fill,
|
||||
// placeholder: (context, url) => Image.asset(
|
||||
// 'images/controls_user.png',
|
||||
// width: 72.w,
|
||||
// height: 72.w,
|
||||
// fit: BoxFit.fill,
|
||||
// ))
|
||||
// : Image.asset(
|
||||
// 'images/controls_user.png',
|
||||
// width: 72.w,
|
||||
// height: 72.w,
|
||||
// fit: BoxFit.fill,
|
||||
// ),
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
|
||||
version: 1.0.11+20240309
|
||||
version: 1.0.15+20240313
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
@ -140,6 +140,7 @@ dependencies:
|
||||
#侧滑删除
|
||||
flutter_slidable: ^3.0.1
|
||||
audio_service: ^0.18.12
|
||||
app_settings: ^5.1.1
|
||||
|
||||
system_settings: ^2.0.0
|
||||
dev_dependencies:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user