Compare commits

..

5 Commits

Author SHA1 Message Date
YangYuhao
d7679f5587 增加无网拦截 2023-07-10 09:25:10 +08:00
YangYuhao
998090ac78 Merge remote-tracking branch 'origin/main' into main 2023-07-10 09:23:57 +08:00
YangYuhao
c86bbfa28d Merge remote-tracking branch 'origin/main' into main 2023-07-08 11:21:16 +08:00
YangYuhao
91a4a5b438 Merge remote-tracking branch 'origin/main' into main 2023-07-08 11:11:59 +08:00
YangYuhao
96d660965b android 图标调整 小优化 2023-07-08 09:15:51 +08:00
53 changed files with 273 additions and 194 deletions

View File

@ -43,6 +43,10 @@ android {
} }
signingConfigs { signingConfigs {
// ndk {
// abiFilters 'armeabi-v7a','arm64-v8a'
// ldLibs "log"
// }
debug { debug {
storeFile file('../leyuan.jks') storeFile file('../leyuan.jks')
storePassword 'leyuan' storePassword 'leyuan'
@ -72,6 +76,10 @@ android {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
project.ext.enableFlutterNullSafety = false
}
debug{
project.ext.enableFlutterNullSafety = false
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 197 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -1,9 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter_install_app/flutter_install_app.dart'; import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../network/dio_manager.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import 'state.dart'; import 'state.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';

View File

@ -30,7 +30,7 @@ class AboutappPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: '关于圈子',), appBar: const MyAppBar(centerTitle: '关于圈子',),
body: Scaffold( body: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
// Replace with your desired color // Replace with your desired color
@ -41,12 +41,16 @@ class AboutappPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( GestureDetector(onTap: (){
// showToast("13");
},
child:Image.asset(
getBaseImage("icon_login"), // Replace with your image path getBaseImage("icon_login"), // Replace with your image path
width: 100.sp, width: 100.sp,
height: 100.sp, height: 100.sp,
fit: BoxFit.contain, fit: BoxFit.contain,
), ) ,)
,
SizedBox(height: 20.sp), SizedBox(height: 20.sp),
Text( Text(
'圈子', '圈子',
@ -101,11 +105,11 @@ class AboutappPage extends StatelessWidget {
Text( Text(
'用户协议', '用户协议',
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
Spacer(), const Spacer(),
Image( Image(
image: AssetImage(getHomeImage("icon_in")), image: AssetImage(getHomeImage("icon_in")),
width: 24.sp, width: 24.sp,
@ -123,14 +127,14 @@ class AboutappPage extends StatelessWidget {
}, },
child: Row( child: Row(
children: [ children: [
Text( const Text(
'隐私政策', '隐私政策',
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: Color(0xFFF7FAFA),
fontSize: 16, fontSize: 16,
), ),
), ),
Spacer(), const Spacer(),
Image( Image(
image: AssetImage(getHomeImage("icon_in")), image: AssetImage(getHomeImage("icon_in")),
width: 24.sp, width: 24.sp,
@ -151,11 +155,11 @@ class AboutappPage extends StatelessWidget {
Text( Text(
'版本更新', '版本更新',
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
Spacer(), const Spacer(),
Container( Container(
width: 6.sp, width: 6.sp,
height: 5.sp, height: 5.sp,
@ -168,11 +172,11 @@ class AboutappPage extends StatelessWidget {
Text( Text(
logic.version, logic.version,
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
SizedBox(width: 8), SizedBox(width: 8.sp),
Image( Image(
image: AssetImage(getHomeImage("icon_in")), image: AssetImage(getHomeImage("icon_in")),
width: 24.sp, width: 24.sp,

View File

@ -1,5 +1,4 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import 'state.dart'; import 'state.dart';

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../components/my_app_bar.dart'; import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';

View File

@ -5,24 +5,19 @@ import 'dart:typed_data';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_luban/flutter_luban.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import 'package:video_thumbnail/video_thumbnail.dart'; import 'package:video_thumbnail/video_thumbnail.dart';
import '../../common/Widgets/open_vip_tip/view.dart'; import '../../common/Widgets/open_vip_tip/view.dart';
import '../../common/errorcode.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/qiniu.dart'; import '../../util/qiniu.dart';
import '../login/complete_material/logic.dart';
import '../select_circle/logic.dart'; import '../select_circle/logic.dart';
import 'state.dart'; import 'state.dart';
import '../../common/config.dart'; import '../../common/config.dart';
@ -131,7 +126,7 @@ class Call_outLogic extends GetxController {
print(myBean.toString()); print(myBean.toString());
var data = await DioManager.instance.post(url: Api.SendShout, params: { var data = await DioManager.instance.post(url: Api.SendShout, params: {
'album': myBean, 'album': myBean,
'content': textEditingController.text, 'content': textEditingController.text.trim(),
'interest_id': numbers[0].id, 'interest_id': numbers[0].id,
'use_queen': isCheck ? 1 : 0, 'use_queen': isCheck ? 1 : 0,
}); });

View File

@ -294,8 +294,8 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
GestureDetector( GestureDetector(
behavior:HitTestBehavior.opaque, behavior:HitTestBehavior.opaque,
onTap: (){ onTap: (){
showToast("点个鸡毛,星哥还没做"); // showToast("点个鸡毛,星哥还没做");
Get.toNamed(AppRoutes.FriendsActivity,arguments: '3'); // Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
}, },
child: Row( child: Row(
children: [ children: [
@ -323,10 +323,10 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
SizedBox( SizedBox(
width: 8.sp, width: 8.sp,
), ),
Image.asset( // Image.asset(
getCircleImage('play'), // getCircleImage('play'),
width: 20.sp, // width: 20.sp,
) // )
], ],
) )
], ],

View File

@ -6,7 +6,6 @@ import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../util/SharedPreferencesHelper.dart'; import '../../../util/SharedPreferencesHelper.dart';

View File

@ -1,4 +1,3 @@
import 'dart:ffi';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -21,7 +20,11 @@ class FriendslistLogic extends GetxController {
super.onInit(); super.onInit();
initList(); initList();
} }
void dispose() {
refreshController.dispose();
super.dispose();
}
initList() async { initList() async {
if (page == 1) { if (page == 1) {
lists.clear(); lists.clear();

View File

@ -51,11 +51,12 @@ class FriendslistPage extends StatelessWidget {
Widget ListItem(UserInfo item,int index) { Widget ListItem(UserInfo item,int index) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){ onTap: (){
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
}, },
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 21), margin: const EdgeInsets.only(bottom: 21),
child: Row( child: Row(
children: [ children: [
Stack(children: [ Stack(children: [
@ -107,7 +108,7 @@ class FriendslistPage extends StatelessWidget {
), ),
SizedBox(height: 8.sp), SizedBox(height: 8.sp),
Container( SizedBox(
width: 150.sp, width: 150.sp,
child: Text( child: Text(
item.signature, item.signature,
@ -117,7 +118,7 @@ class FriendslistPage extends StatelessWidget {
], ],
), ),
// Pla // Pla
Spacer(), const Spacer(),
GestureDetector(onTap: (){ GestureDetector(onTap: (){
logic.setLike(index); logic.setLike(index);

View File

@ -1,4 +1,3 @@
import 'dart:ffi';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -9,7 +8,11 @@ import '../../util/util.dart';
import 'state.dart'; import 'state.dart';
class LikelistLogic extends GetxController { class LikelistLogic extends GetxController {
void dispose() {
refreshController.dispose();
super.dispose();
}
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final LikelistState state = LikelistState(); final LikelistState state = LikelistState();

View File

@ -55,12 +55,13 @@ class LikelistPage extends StatelessWidget {
Widget ListItem(UserListItem item, int index) { Widget ListItem(UserListItem item, int index) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity, Get.toNamed(AppRoutes.UserInfoActivity,
arguments: item.user.id.toString()); arguments: item.user.id.toString());
}, },
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 21), margin: EdgeInsets.only(bottom: 21.sp),
child: Row( child: Row(
children: [ children: [
Stack( Stack(
@ -82,10 +83,10 @@ class LikelistPage extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
right: 0, right: 0.sp,
left: 0, left: 0.sp,
bottom: 0, bottom: 0.sp,
child: item.isLike child: item.user.vip!=0
? Image( ? Image(
image: AssetImage(getBaseImage("vip")), image: AssetImage(getBaseImage("vip")),
width: 44.sp, width: 44.sp,
@ -131,15 +132,15 @@ class LikelistPage extends StatelessWidget {
logic.setLike(index); logic.setLike(index);
}, },
child: Container( child: Container(
width: 75, width: 75.sp,
height: 28, height: 28.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFF4D7C), color: Color(0xFFFF4D7C),
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Center( child: Center(
child: Text(item.isLike ? "互相关注" : "关注", child: Text(item.isLike ? "互相关注" : "关注",
style: TextStyle(fontSize: 14, color: Colors.white)), style: TextStyle(fontSize: 14.sp, color: Colors.white)),
), ),
), ),
), ),
@ -159,7 +160,7 @@ class LikelistPage extends StatelessWidget {
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17.sp),
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(141, 255, 248, 1.0),
@ -175,7 +176,7 @@ class LikelistPage extends StatelessWidget {
ageMsg, ageMsg,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10.sp,
), ),
), ),
), ),

View File

@ -9,7 +9,6 @@ import 'package:image_picker/image_picker.dart';
import '../../../common/config.dart'; import '../../../common/config.dart';
import '../../../network/api.dart'; import '../../../network/api.dart';
import '../../../util/device.dart';
import '../../../util/qiniu.dart'; import '../../../util/qiniu.dart';
import '../../minefragment/logic.dart'; import '../../minefragment/logic.dart';
import '../../select_circle/logic.dart'; import '../../select_circle/logic.dart';
@ -168,8 +167,8 @@ class Complete_materialLogic extends GetxController {
'orientation': state.orientationId, //Int 'orientation': state.orientationId, //Int
// 'lat': location.latitude, // 'lat': location.latitude,
// 'lng': location.longitude, // 'lng': location.longitude,
'nickname': state.textEditingController.text, 'nickname': state.textEditingController.text.trim(),
'signature': state.descEditingController.text, 'signature': state.descEditingController.text.trim(),
}); });
var bean = BaseResponse<String>.fromJson(data, (data) => data); var bean = BaseResponse<String>.fromJson(data, (data) => data);
if (bean.code == 200) { if (bean.code == 200) {

View File

@ -6,12 +6,28 @@ import 'package:circle_app/util/util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../network/api.dart'; import '../../../network/api.dart';
import '../../../util/SharedPreferencesHelper.dart'; import '../../../util/SharedPreferencesHelper.dart';
import 'state.dart'; import 'state.dart';
class LoginLogic extends GetxController { class LoginLogic extends GetxController {
@override
void onInit() async{
// TODO: implement onInit
super.onInit();
SharedPreferences sharedPreferences =await SharedPreferences.getInstance();
String loginPhone = await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE)??"";
print(loginPhone);
phoneEditingController.text = loginPhone;
if (GetUtils.isPhoneNumber(loginPhone)&& loginPhone.length==11) {
isPhoto = true;
}
update();
}
bool isPhoto = false;
final LoginState state = LoginState(); final LoginState state = LoginState();
TextEditingController phoneEditingController = TextEditingController(); TextEditingController phoneEditingController = TextEditingController();
TextEditingController codeEditingController = TextEditingController(); TextEditingController codeEditingController = TextEditingController();
@ -24,8 +40,21 @@ class LoginLogic extends GetxController {
starDownTimer() { starDownTimer() {
if (sendCodeBtn == false && seconds == 60) { if (sendCodeBtn == false && seconds == 60) {
getCode(); getCode();
}
}
Future<void> getCode() async {
var data = await DioManager.instance.post(url: Api.sendCode, params: {"phone": phoneEditingController.text});
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
showToast(bean.msg);
if(bean.code==200){
if(kDebugMode){
codeEditingController.text = bean.data!.code.toString();
update();
}
sendCodeBtn = true; sendCodeBtn = true;
t = Timer.periodic(Duration(milliseconds: 1000), (timer) { t = Timer.periodic(const Duration(milliseconds: 1000), (timer) {
seconds--; seconds--;
if (seconds == 0) { if (seconds == 0) {
t?.cancel(); // t?.cancel(); //
@ -35,18 +64,7 @@ class LoginLogic extends GetxController {
update(); update();
}); });
} }
}
Future<void> getCode() async {
var data = await DioManager.instance.post(url: Api.sendCode, params: {"phone": phoneEditingController.text});
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
showToast(bean.msg);
if(kDebugMode){
if(bean.code==200){
codeEditingController.text = bean.data!.code.toString();
update();
}
}
} }
@override @override
@ -69,6 +87,7 @@ class LoginLogic extends GetxController {
var bean = BaseResponse<LoginData>.fromJson(data, (data) => LoginData.fromJson(data)); var bean = BaseResponse<LoginData>.fromJson(data, (data) => LoginData.fromJson(data));
if (bean.code == 200) { if (bean.code == 200) {
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, phoneEditingController.text);
sharedPreferences.setString(SharedPreferencesHelper.AUTHORIZATION,bean.data!.Authorization.toString()); sharedPreferences.setString(SharedPreferencesHelper.AUTHORIZATION,bean.data!.Authorization.toString());
}); });
@ -78,6 +97,7 @@ class LoginLogic extends GetxController {
return; return;
} else if (bean.code == 30002) { } else if (bean.code == 30002) {
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, phoneEditingController.text);
sharedPreferences.setString(SharedPreferencesHelper.AUTHORIZATION,bean.data!.Authorization.toString()); sharedPreferences.setString(SharedPreferencesHelper.AUTHORIZATION,bean.data!.Authorization.toString());
}); });

View File

@ -1,3 +1,5 @@
import 'dart:math';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -13,7 +15,7 @@ class LoginPage extends StatelessWidget {
final state = Get final state = Get
.find<LoginLogic>() .find<LoginLogic>()
.state; .state;
bool isPhoto = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -57,9 +59,9 @@ class LoginPage extends StatelessWidget {
child: TextField( child: TextField(
onChanged: (msg){ onChanged: (msg){
if (GetUtils.isPhoneNumber(msg)&& msg.length==11) { if (GetUtils.isPhoneNumber(msg)&& msg.length==11) {
isPhoto = true; logic.isPhoto = true;
}else{ }else{
isPhoto = false; logic.isPhoto = false;
} }
logic.update(); logic.update();
}, },
@ -129,7 +131,7 @@ class LoginPage extends StatelessWidget {
right: 0, right: 0,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if(isPhoto){ if(logic.isPhoto){
logic.starDownTimer(); logic.starDownTimer();
} }
}, },
@ -138,7 +140,7 @@ class LoginPage extends StatelessWidget {
width: 76.sp, width: 76.sp,
height: 29.sp, height: 29.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
color:isPhoto ? Color(0xFF21BEAB) : Colors.white30, color:logic.isPhoto ? Color(0xFF21BEAB) : Colors.white30,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
29.sp / 2) 29.sp / 2)
), ),

View File

@ -5,7 +5,6 @@ import '../../network/dio_manager.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import '../userinfo/logic.dart';
import 'state.dart'; import 'state.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';

View File

@ -1,4 +1,3 @@
import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';
@ -26,8 +25,9 @@ class MinefragmentPage extends StatelessWidget {
.padding .padding
.top; .top;
return GetBuilder<MinefragmentLogic>(builder: (logic) { return GetBuilder<MinefragmentLogic>(
return Scaffold( builder: (logic) {
return Scaffold(
body: Container( body: Container(
width: Get.width, width: Get.width,
height: Get.height, height: Get.height,
@ -63,10 +63,8 @@ class MinefragmentPage extends StatelessWidget {
} }
Widget _CircleLiveView(MinefragmentLogic logic) { Widget _CircleLiveView(MinefragmentLogic logic) {
return Container( return Column(
child: Column( children: [_CircleItemView(logic), _HelpItemView(), _SetUpItemView()],
children: [_CircleItemView(logic), _HelpItemView(), _SetUpItemView()],
),
); );
} }
@ -91,7 +89,7 @@ class MinefragmentPage extends StatelessWidget {
height: 24.sp, height: 24.sp,
), ),
SizedBox(width: 10.sp), SizedBox(width: 10.sp),
Text( const Text(
"设置", "设置",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -132,7 +130,7 @@ class MinefragmentPage extends StatelessWidget {
height: 24.sp, height: 24.sp,
), ),
SizedBox(width: 10.sp), SizedBox(width: 10.sp),
Text( const Text(
"帮助与反馈", "帮助与反馈",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -172,7 +170,7 @@ class MinefragmentPage extends StatelessWidget {
height: 24.sp, height: 24.sp,
), ),
SizedBox(width: 10.sp), SizedBox(width: 10.sp),
Text( const Text(
"我的圈子", "我的圈子",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -182,7 +180,7 @@ class MinefragmentPage extends StatelessWidget {
children: [ children: [
Text( Text(
logic.JoinedCircle, logic.JoinedCircle,
style: TextStyle(color: Colors.white30), style: const TextStyle(color: Colors.white30),
), ),
Image( Image(
image: AssetImage(getHomeImage("icon_in")), image: AssetImage(getHomeImage("icon_in")),
@ -211,34 +209,32 @@ class MinefragmentPage extends StatelessWidget {
onTap: () { onTap: () {
Get.toNamed(AppRoutes.FriendsActivity); Get.toNamed(AppRoutes.FriendsActivity);
}, },
child: Container( child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Text(
Text( logic.like_count.toString(),
logic.like_count.toString(), style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 16.sp,
fontSize: 16.sp, ),
), ),
), SizedBox(height: 4.sp),
SizedBox(height: 4.sp), Text(
Text( "我喜欢的",
"我喜欢的", style: TextStyle(
style: TextStyle( shadows: const [
shadows: [ Shadow(
Shadow( color: Color(0x99FF00F8),
color: Color(0x99FF00F8), offset: Offset(2, 2),
offset: Offset(2, 2), blurRadius: 3,
blurRadius: 3, ),
), ],
], color: const Color.fromARGB(255, 247, 250, 250),
color: Color.fromARGB(255, 247, 250, 250), fontSize: 16.sp,
fontSize: 16.sp, ),
), ),
), ],
],
),
), ),
), ),
GestureDetector( GestureDetector(
@ -260,13 +256,11 @@ class MinefragmentPage extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
Container( Text(
child: Text( logic.like_me_count.toString(),
logic.like_me_count.toString(), style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 16.sp,
fontSize: 16.sp,
),
), ),
), ),
], ],
@ -278,14 +272,14 @@ class MinefragmentPage extends StatelessWidget {
Text( Text(
"喜欢我的", "喜欢我的",
style: TextStyle( style: TextStyle(
shadows: [ shadows: const [
Shadow( Shadow(
color: Color(0x99FF00F8), color: Color(0x99FF00F8),
offset: Offset(2, 2), offset: Offset(2, 2),
blurRadius: 3, blurRadius: 3,
), ),
], ],
color: Color.fromARGB(255, 247, 250, 250), color: const Color.fromARGB(255, 247, 250, 250),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
@ -295,8 +289,8 @@ class MinefragmentPage extends StatelessWidget {
right: 0.sp, right: 0.sp,
top: 15.sp, top: 15.sp,
child: Text( child: Text(
logic.like_me_count_new>0 ? "+"+logic.like_me_count_new.toString():"", logic.like_me_count_new>0 ? "+${logic.like_me_count_new}":"",
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
), ),
) )
], ],
@ -320,32 +314,30 @@ class MinefragmentPage extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
Container( Text(
child: Text( logic.recent_visit_count.toString(),
logic.recent_visit_count.toString(), style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 16.sp,
fontSize: 16.sp, ),
),
),
), ),
], ],
), ),
Container( SizedBox(
height: 4.sp, height: 4.sp,
width: 80.sp, width: 80.sp,
), ),
Text( Text(
"最近来访", "最近来访",
style: TextStyle( style: TextStyle(
shadows: [ shadows: const [
Shadow( Shadow(
color: Color(0x99FF00F8), color: Color(0x99FF00F8),
offset: Offset(2, 2), offset: Offset(2, 2),
blurRadius: 3, blurRadius: 3,
), ),
], ],
color: Color.fromARGB(255, 247, 250, 250), color: const Color.fromARGB(255, 247, 250, 250),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
@ -355,8 +347,8 @@ class MinefragmentPage extends StatelessWidget {
right: 0.sp, right: 0.sp,
top: 15.sp, top: 15.sp,
child: Text( child: Text(
logic.recent_visit_count_new>0 ? "+"+logic.recent_visit_count_new.toString():"", logic.recent_visit_count_new>0 ? "+${logic.recent_visit_count_new}":"",
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
), ),
) )
], ],
@ -375,7 +367,7 @@ class MinefragmentPage extends StatelessWidget {
await Get.toNamed(AppRoutes.UserInfoActivity, arguments: ""); await Get.toNamed(AppRoutes.UserInfoActivity, arguments: "");
logic.onInit(); logic.onInit();
}, },
child: Container( child: SizedBox(
width: Get.width, width: Get.width,
height: 65.sp, height: 65.sp,
child: Row( child: Row(
@ -440,7 +432,7 @@ class MinefragmentPage extends StatelessWidget {
} }
}, },
child:logic.userInfoBean==null ? Container( child:logic.userInfoBean==null ? SizedBox(
width: 63.sp, width: 63.sp,
height: 63.sp, height: 63.sp,
): CachedNetworkImage( ): CachedNetworkImage(
@ -464,7 +456,7 @@ class MinefragmentPage extends StatelessWidget {
Text( Text(
logic.name, logic.name,
style: TextStyle( style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0), color: const Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
@ -473,7 +465,7 @@ class MinefragmentPage extends StatelessWidget {
Text( Text(
logic.enterHomeInfoMsg, logic.enterHomeInfoMsg,
style: TextStyle( style: TextStyle(
color: Color.fromRGBO(247, 250, 250, 1.0), color: const Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
@ -495,7 +487,7 @@ class MinefragmentPage extends StatelessWidget {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(141, 255, 248, 1.0),
Color.fromRGBO(181, 211, 255, 1.0), Color.fromRGBO(181, 211, 255, 1.0),

View File

@ -56,9 +56,9 @@ class MyfeedbacklistPage extends StatelessWidget {
fontSize: 14.0.sp, fontSize: 14.0.sp,
),), ),),
Container( Container(
margin: EdgeInsets.only(bottom: 12.0,top: 12.sp), margin: EdgeInsets.only(bottom: 12.0.sp,top: 12.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0.sp),
color: Color(0xff282733), color: Color(0xff282733),
), ),
child: Column( child: Column(

View File

@ -256,8 +256,8 @@ class _OffaccountState extends State<OffaccountPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.black.withOpacity(0.6), color: Colors.black.withOpacity(0.6),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(20), topLeft: Radius.circular(20.sp),
topRight: Radius.circular(20), topRight: Radius.circular(20.sp),
), ),
), ),
child: Column( child: Column(
@ -300,7 +300,7 @@ class _OffaccountState extends State<OffaccountPage> {
child: Container( child: Container(
width: Get.width, width: Get.width,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 16), padding: EdgeInsets.symmetric(vertical: 16.sp),
child: Text( child: Text(
title, title,
style: TextStyle( style: TextStyle(
@ -314,9 +314,9 @@ class _OffaccountState extends State<OffaccountPage> {
Widget buildDivider() { Widget buildDivider() {
return Container( return Container(
height: 0.5, height: 0.5.sp,
color: Color(0xff2E2E3B), color: const Color(0xff2E2E3B),
margin: EdgeInsets.symmetric(horizontal: 16), margin: EdgeInsets.symmetric(horizontal: 16.sp),
); );
} }

View File

@ -43,12 +43,12 @@ class ReportPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 16, top: 16), padding: EdgeInsets.only(left: 16.sp, top: 16.sp),
child: Text( child: Text(
'举报类目', '举报类目',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16, fontSize: 16.sp,
), ),
), ),
), ),
@ -65,10 +65,10 @@ class ReportPage extends StatelessWidget {
'详细截图(请至少上传一张图片,帮助审核处理)', '详细截图(请至少上传一张图片,帮助审核处理)',
style: TextStyle( style: TextStyle(
color: Colors.white70, color: Colors.white70,
fontSize: 16, fontSize: 16.sp,
), ),
), ),
SizedBox(height: 20), SizedBox(height: 20.sp),
// RecyclerViewListView // RecyclerViewListView
// : MyRecyclerViewWidget(), // : MyRecyclerViewWidget(),
Container( Container(
@ -78,13 +78,13 @@ class ReportPage extends StatelessWidget {
'补充说明', '补充说明',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14, fontSize: 14.sp,
), ),
), ),
SizedBox(height: 30), SizedBox(height: 30),
Container( Container(
// margin: EdgeInsets.only(left: 10, right: 10), // margin: EdgeInsets.only(left: 10, right: 10),
height: 200, height: 200.sp,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF4C3E5F), color: Color(0xFF4C3E5F),

View File

@ -3,7 +3,6 @@ import 'package:get/get.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import 'state.dart'; import 'state.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';

View File

@ -1,9 +1,6 @@
import 'dart:ffi';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/circle/state.dart'; import 'package:circle_app/app/circle/state.dart';
import 'package:circle_app/app/circle/widgets/list_logic.dart';
import 'package:circle_app/app/circle/widgets/video_item.dart'; import 'package:circle_app/app/circle/widgets/video_item.dart';
import 'package:circle_app/app/userinfo/widgets/home_call_out_logic.dart'; import 'package:circle_app/app/userinfo/widgets/home_call_out_logic.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';

View File

@ -1,14 +1,18 @@
import 'dart:ffi';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../network/api.dart'; import '../../network/api.dart';
import '../../network/dio_manager.dart'; import '../../network/dio_manager.dart';
import '../../util/util.dart';
import 'state.dart'; import 'state.dart';
class VisitorlistLogic extends GetxController { class VisitorlistLogic extends GetxController {
@override
void dispose() {
refreshController.dispose();
super.dispose();
}
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final VisitorlistState state = VisitorlistState(); final VisitorlistState state = VisitorlistState();

View File

@ -52,6 +52,7 @@ class VisitorlistPage extends StatelessWidget {
Widget ListItem(UserListItem item,int index) { Widget ListItem(UserListItem item,int index) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){ onTap: (){
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.user.id.toString()); Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.user.id.toString());
}, },
@ -79,9 +80,9 @@ class VisitorlistPage extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
right: 0, right: 0.sp,
left: 0, left: 0.sp,
bottom: 0, bottom: 0.sp,
child: item.user.vip!=0 ? child: item.user.vip!=0 ?
Image( Image(
@ -125,8 +126,8 @@ class VisitorlistPage extends StatelessWidget {
}, },
child: Container( child: Container(
width: 60, width: 60.sp,
height: 28, height: 28.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFF4D7C), color: Color(0xFFFF4D7C),
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
@ -151,7 +152,7 @@ class VisitorlistPage extends StatelessWidget {
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17.sp),
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(141, 255, 248, 1.0),
@ -167,7 +168,7 @@ class VisitorlistPage extends StatelessWidget {
ageMsg , ageMsg ,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10.sp,
), ),
), ),
), ),

View File

@ -1,5 +1,4 @@
import 'package:circle_app/app/home/binding.dart';
import 'package:circle_app/app/home/view.dart';
import 'package:circle_app/app/splash/binding.dart'; import 'package:circle_app/app/splash/binding.dart';
import 'package:circle_app/router/app_pages.dart'; import 'package:circle_app/router/app_pages.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';

View File

@ -6,6 +6,7 @@ import 'package:dio/dio.dart';
import '../util/device.dart'; import '../util/device.dart';
import 'api.dart'; import 'api.dart';
import 'package:connectivity/connectivity.dart';
const String baseUrl = Api.baseUrl; const String baseUrl = Api.baseUrl;
@ -43,6 +44,7 @@ class DioManager {
receiveTimeout: Duration(seconds: 30000000000), receiveTimeout: Duration(seconds: 30000000000),
)); ));
_dio!.interceptors.add(LogInterceptor(responseBody: true)); _dio!.interceptors.add(LogInterceptor(responseBody: true));
// _dio!.interceptors.add(ConnectivityInterceptor());
} }
Future download(String urlPath,String savePath,ProgressCallback progressCallback)async{ Future download(String urlPath,String savePath,ProgressCallback progressCallback)async{
@ -153,6 +155,13 @@ class DioManager {
DioMethod.delete: 'delete', DioMethod.delete: 'delete',
DioMethod.put: 'put' DioMethod.put: 'put'
}; };
var connectivityResult = await Connectivity().checkConnectivity();
if(connectivityResult == ConnectivityResult.none){
// showToast("");
return {'code': 404, 'msg': '请检查网络连接是否正常'};
}
try { try {
Response response; Response response;
@ -308,6 +317,22 @@ class BaseResponse<T> {
} }
class ConnectivityInterceptor extends Interceptor {
@override
Future<void> onRequest(
RequestOptions options, RequestInterceptorHandler handler) async {
if (!await isInternetAvailable()) {
showToast("请检查网络连接是否正常");
}
return handler.next(options);
}
Future<bool> isInternetAvailable() async {
var connectivityResult = await Connectivity().checkConnectivity();
return connectivityResult != ConnectivityResult.none;
}
}
class QnTokenData { class QnTokenData {
final String token; final String token;

View File

@ -11,6 +11,9 @@ class SharedPreferencesHelper {
static const AVATAR = 'avatar'; static const AVATAR = 'avatar';
static const NAME = 'name'; static const NAME = 'name';
static const LOGINPHONE = 'loginPhone';
static SharedPreferencesHelper? _instance; static SharedPreferencesHelper? _instance;
static SharedPreferences? _preferences; static SharedPreferences? _preferences;
@ -65,4 +68,5 @@ class SharedPreferencesHelper {
final prefs = preferences; final prefs = preferences;
prefs?.clear(); prefs?.clear();
} }
} }

View File

@ -10,15 +10,12 @@ import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_compress/video_compress.dart'; import 'package:video_compress/video_compress.dart';
import 'SharedPreferencesHelper.dart'; import 'SharedPreferencesHelper.dart';
class Util { class Util {}
}
// //
String getBaseImage(String image) { String getBaseImage(String image) {
return '${Values.base_images}${image}.png'; return '${Values.base_images}${image}.png';
@ -52,8 +49,6 @@ String getCircleImage(String image) {
return '${Values.circle_images}${image}.png'; return '${Values.circle_images}${image}.png';
} }
/// msg: /// msg:
showToast(String msg) { showToast(String msg) {
Fluttertoast.showToast( Fluttertoast.showToast(
@ -63,17 +58,23 @@ showToast(String msg) {
timeInSecForIosWeb: 1, timeInSecForIosWeb: 1,
backgroundColor: Colors.black54, backgroundColor: Colors.black54,
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.0 fontSize: 16.0);
);
} }
loaddingWidget(bool isMore) { loaddingWidget(bool isMore) {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
child: isMore ? const CircularProgressIndicator(color: Color(0xFF07FAFB),) : Container( child: isMore
margin:EdgeInsets.only(top: 4.sp,bottom: 4.sp), ? const CircularProgressIndicator(
child: Text('--到底了--',style: TextStyle(color: Colors.white,fontSize: 13.sp), color: Color(0xFF07FAFB),
),), )
: Container(
margin: EdgeInsets.only(top: 4.sp, bottom: 4.sp),
child: Text(
'--到底了--',
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
),
); );
} }
@ -83,9 +84,17 @@ noResultWidget() {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset(getBaseImage('no_result'),width: 200.sp,), Image.asset(
SizedBox(height: 8.sp,), getBaseImage('no_result'),
Text('正在等待被填充~',style: TextStyle(color: Color(0xffdbdbdb),fontSize: 15.sp),), width: 200.sp,
),
SizedBox(
height: 8.sp,
),
Text(
'正在等待被填充~',
style: TextStyle(color: Color(0xffdbdbdb), fontSize: 15.sp),
),
], ],
), ),
); );
@ -97,11 +106,12 @@ double calculateTextHeight(String value, fontSize, FontWeight fontWeight,
value = filterText(value); value = filterText(value);
TextPainter painter = TextPainter( TextPainter painter = TextPainter(
///AUTOlocale的时候 ///AUTOlocale的时候
locale: WidgetsBinding.instance!.window.locale, locale: WidgetsBinding.instance!.window.locale,
maxLines: maxLines, maxLines: maxLines,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
textScaleFactor: 1, // textScaleFactor: 1,
//
text: TextSpan( text: TextSpan(
text: value, text: value,
style: TextStyle( style: TextStyle(
@ -123,7 +133,6 @@ String filterText(String text) {
return text; return text;
} }
String convertToTenThousand(int number) { String convertToTenThousand(int number) {
if (number >= 10000) { if (number >= 10000) {
double result = number / 10000; double result = number / 10000;
@ -132,15 +141,19 @@ String convertToTenThousand(int number) {
return number.toString(); return number.toString();
} }
} }
pushLoginPage() async{
pushLoginPage() async {
logoutIM(); logoutIM();
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
String loginPhone = sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE);
print(loginPhone);
sharedPreferences.clear(); sharedPreferences.clear();
sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, loginPhone);
}); });
Get.offAllNamed(AppRoutes.Login); Get.offAllNamed(AppRoutes.Login);
} }
String filterSensitiveWords(String input, List<String> sensitiveWords) { String filterSensitiveWords(String input, List<String> sensitiveWords) {
String filteredString = input; String filteredString = input;
for (String word in sensitiveWords) { for (String word in sensitiveWords) {
@ -150,9 +163,8 @@ String filterSensitiveWords(String input, List<String> sensitiveWords) {
return filteredString; return filteredString;
} }
String getAgeCOntent (int gender,int age,int role,int orientation){ String getAgeCOntent(int gender, int age, int role, int orientation) {
return "${getGenderContent(gender)}.${age}.${getRoleContent(role)}.${getOrientationContent(orientation)}"; return "${getGenderContent(gender)}.${age}.${getRoleContent(role)}.${getOrientationContent(orientation)}";
} }
String getGenderContent(int number) { String getGenderContent(int number) {
@ -173,6 +185,7 @@ String getGenderContent(int number) {
return ""; return "";
} }
} }
String getOrientationContent(int number) { String getOrientationContent(int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -193,6 +206,7 @@ String getOrientationContent(int number) {
return ""; return "";
} }
} }
String getRoleContent(int number) { String getRoleContent(int number) {
switch (number) { switch (number) {
case 1: case 1:
@ -212,14 +226,15 @@ String getRoleContent(int number) {
typedef void MyCallback(String path); typedef void MyCallback(String path);
Future<void> compressVideo(String inputPath, String outputPath,MyCallback myCallback) async { Future<void> compressVideo(
String inputPath, String outputPath, MyCallback myCallback) async {
final info = await VideoCompress.compressVideo( final info = await VideoCompress.compressVideo(
inputPath, inputPath,
quality: VideoQuality.MediumQuality, quality: VideoQuality.MediumQuality,
deleteOrigin: false, deleteOrigin: false,
); );
if (info != null&&null!=info.path) { if (info != null && null != info.path) {
print(info.path); print(info.path);
myCallback(info.path!); myCallback(info.path!);
} else { } else {
@ -227,7 +242,6 @@ Future<void> compressVideo(String inputPath, String outputPath,MyCallback myCall
} }
} }
// //
Future<String> getApplicationDocumentsDirectoryPath() async { Future<String> getApplicationDocumentsDirectoryPath() async {
final directory = await getApplicationDocumentsDirectory(); final directory = await getApplicationDocumentsDirectory();
@ -251,14 +265,21 @@ Future<String> getLibraryDirectoryPath() async {
final directory = await getLibraryDirectory(); final directory = await getLibraryDirectory();
return directory.path; return directory.path;
} }
// //
navigateToUserAgreement(){ navigateToUserAgreement() {
Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"用户协议","url":"https://docs.qq.com/doc/DZVV1SkttZGlPUW1H"}); Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "用户协议",
"url": "https://docs.qq.com/doc/DZVV1SkttZGlPUW1H"
});
} }
// //
navigateToPrivacyPolicy(){ navigateToPrivacyPolicy() {
Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"隐私协议","url":"https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1"}); Get.toNamed(AppRoutes.WebViewActivity, arguments: {
'title': "隐私协议",
"url": "https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1"
});
} }
// //

View File

@ -86,6 +86,9 @@ dependencies:
cached_network_image: ^3.2.3 cached_network_image: ^3.2.3
#安装apk #安装apk
flutter_install_app: 1.3.0 flutter_install_app: 1.3.0
#网络拦截
connectivity: ^3.0.6