修改相册权限判断弹窗
This commit is contained in:
parent
7454e89d1b
commit
2f2c34ed1e
@ -1,4 +1,6 @@
|
||||
PODS:
|
||||
- "app_settings (3.0.0+1)":
|
||||
- Flutter
|
||||
- audioplayers_darwin (0.0.1):
|
||||
- Flutter
|
||||
- Bugly (2.5.93)
|
||||
@ -166,6 +168,7 @@ PODS:
|
||||
- WechatOpenSDK-XCFramework (2.0.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- app_settings (from `.symlinks/plugins/app_settings/ios`)
|
||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
|
||||
- connectivity (from `.symlinks/plugins/connectivity/ios`)
|
||||
@ -224,6 +227,8 @@ SPEC REPOS:
|
||||
- WechatOpenSDK-XCFramework
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
app_settings:
|
||||
:path: ".symlinks/plugins/app_settings/ios"
|
||||
audioplayers_darwin:
|
||||
:path: ".symlinks/plugins/audioplayers_darwin/ios"
|
||||
camera_avfoundation:
|
||||
@ -302,6 +307,7 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
app_settings: 54b8813f690b34f757c0bf97a46637bed5acc76c
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da
|
||||
camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb
|
||||
|
||||
@ -381,7 +381,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.2;
|
||||
MARKETING_VERSION = 1.4.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -530,7 +530,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.2;
|
||||
MARKETING_VERSION = 1.4.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -573,7 +573,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.2;
|
||||
MARKETING_VERSION = 1.4.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleapp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
||||
@ -325,6 +325,7 @@ class Call_outLogic extends GetxController {
|
||||
return;
|
||||
}
|
||||
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickVideo(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -1220,6 +1220,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
if (!isOK) {
|
||||
return;
|
||||
}
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
@ -1252,6 +1253,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
return;
|
||||
}
|
||||
await requestStoragePermission();
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
|
||||
@ -358,9 +358,7 @@ class _DiscoverState extends State<Discover>
|
||||
child: Container(
|
||||
// padding: EdgeInsets.all(2.sp),
|
||||
child: Swiper(
|
||||
autoplay: user.images!.length == 1
|
||||
? false
|
||||
: true,
|
||||
autoplay: false,
|
||||
loop: user.images!.length == 1
|
||||
? false
|
||||
: true,
|
||||
|
||||
@ -47,6 +47,7 @@ class ExternalshareLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future getImageFile() async {
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -33,6 +33,7 @@ class FeedbackLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future getImageFile() async {
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -474,7 +474,7 @@ class InvitePage extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
'${logic.directProfit! ?? 0}小票',
|
||||
'${logic.directProfit! ?? 0}票',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 14.sp),
|
||||
@ -505,7 +505,7 @@ class InvitePage extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
'${logic.rebate! ?? 0}小票',
|
||||
'${logic.rebate! ?? 0}票',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 14.sp),
|
||||
@ -535,7 +535,7 @@ class InvitePage extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.sp, left: 20.sp, right: 20.sp),
|
||||
top: 15.sp, left: 20.sp, right: 20.sp,bottom: 10.sp),
|
||||
// height: 135.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x99363542),
|
||||
@ -623,7 +623,7 @@ class InvitePage extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.sp, bottom: 15.sp),
|
||||
top: 15.sp,),
|
||||
child: Text(
|
||||
'查看更多邀请记录>',
|
||||
style: TextStyle(
|
||||
@ -711,7 +711,7 @@ class InvitePage extends StatelessWidget {
|
||||
child: Text(
|
||||
'联系客服结算',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
|
||||
@ -1,15 +1,18 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:app_settings/app_settings.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:flutter_pickers/time_picker/model/pduration.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import '../../../common/Widgets/base_tip_widget.dart';
|
||||
import '../../../common/config.dart';
|
||||
@ -183,6 +186,9 @@ class Complete_materialLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future getImageFile() async {
|
||||
|
||||
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -357,6 +357,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
|
||||
Future<List<V2TimUserFullInfo>> getUserListInfo(
|
||||
List<String> userIdList) async {
|
||||
|
||||
V2TimValueCallback<String> getLoginUserRes =
|
||||
await TencentImSDKPlugin.v2TIMManager.getLoginUser();
|
||||
if (getLoginUserRes.code == 0) {
|
||||
@ -366,6 +367,52 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
0, getLoginUserRes.data!); // getLoginUserRes.data为查询到的登录用户的UserID
|
||||
}
|
||||
}
|
||||
if (userIdList.length > 100) {
|
||||
List<V2TimUserFullInfo> list = [];
|
||||
double count = userIdList.length / 100;
|
||||
int size = count.toInt();
|
||||
|
||||
|
||||
if (count > size) {
|
||||
for (int i = 0; i <= size; i++) {
|
||||
List<V2TimUserFullInfo> dataList = await getUserListData(userIdList.sublist(i + i * 100, i == size ? userIdList.length : (i + 1) * 100));
|
||||
list.addAll(dataList);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < size; i++) {
|
||||
List<V2TimUserFullInfo> dataList = await getUserListData(userIdList.sublist(i + i * 100,(i + 1) * 100 ));
|
||||
list.addAll(dataList);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} else {
|
||||
|
||||
//获取用户资料
|
||||
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getUsersInfo(userIDList: userIdList); //需要查询的用户id列表
|
||||
if (getUsersInfoRes.code == 0) {
|
||||
// 查询成功
|
||||
getUsersInfoRes.data?.forEach((element) {
|
||||
element.allowType; //用户的好友验证方式 0:允许所有人加我好友 1:不允许所有人加我好友 2:加我好友需我确认
|
||||
element.birthday; //用户生日
|
||||
element.customInfo; //用户的自定义状态
|
||||
element.faceUrl; //用户头像 url
|
||||
element.gender; //用户的性别 1:男 2:女
|
||||
element.level; //用户的等级
|
||||
element.nickName; //用户昵称
|
||||
element.role; //用户的角色
|
||||
element.selfSignature; //用户的签名
|
||||
element.userID; //用户 ID
|
||||
});
|
||||
return getUsersInfoRes.data ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
getUserListData(List<String> userIdList) async {
|
||||
//获取用户资料
|
||||
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
|
||||
@ -74,6 +74,7 @@ class ReportLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future getImageFile() async {
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -368,6 +368,7 @@ class UserinfoLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future getImageFile() async {
|
||||
checkPhotosStatus();
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
|
||||
@ -292,7 +292,7 @@ class _UnlockWxTipState extends State<UnlockWxTip> {
|
||||
|
||||
Text(
|
||||
|
||||
"同时对方可获得${price.bonus == 30 ? '一个月' : price.bonus == 90 ? '三个月' : price.bonus == 365 ? '一年' : '3年' }会员时长",
|
||||
price.note ?? '',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFEFD84E), fontSize: 10.0.sp),
|
||||
),
|
||||
@ -397,6 +397,7 @@ class Prices {
|
||||
int? bonus;
|
||||
double? curPrice;
|
||||
String? desc;
|
||||
String? note;
|
||||
int? expireTime;
|
||||
int? expireType;
|
||||
int? id;
|
||||
@ -426,6 +427,7 @@ class Prices {
|
||||
expireTime = json['expireTime'];
|
||||
expireType = json['expireType'];
|
||||
id = json['id'];
|
||||
note = json['note'];
|
||||
itemId = json['itemId'];
|
||||
oldPrice = json['oldPrice'];
|
||||
show = json['show'];
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:app_settings/app_settings.dart';
|
||||
import 'package:circle_app/app/chat/view.dart';
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/app/circle/widgets/discover.dart';
|
||||
@ -12,6 +13,7 @@ import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/eventBus.dart';
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -931,6 +933,39 @@ showVipDialog() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
checkPhotosStatus() async {
|
||||
var status = await Permission.photos.status;
|
||||
if (PermissionStatus.permanentlyDenied == status) {
|
||||
Get.bottomSheet(CupertinoAlertDialog(
|
||||
content:
|
||||
SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[Text("请开启相册权限以上传图片")],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text("确定"),
|
||||
onPressed: (){
|
||||
AppSettings.openAppSettings();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text("取消"),
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pushPage(String action,String param,{String name = ''}) {
|
||||
// public final static String MY_MAIN = "my_main";//我的主页
|
||||
// public final static String MY_USER_HOME = "my_user_home";//我的个人主页
|
||||
|
||||
@ -41,6 +41,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.13.0"
|
||||
app_settings:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: app_settings
|
||||
sha256: e6a34735d4ddb24ca9c5fd7e965ec65c8b611cbd3a329152c294f9e9f4bacb33
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.3.1"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user