android的闪屏 logo name 修改bug 新增计算距离方法 修改清除缓存 没有清除本地存储的文件 上传图片不走压缩
@ -28,7 +28,7 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
|
||||
<application
|
||||
android:label="circle_app"
|
||||
android:label="微乐园"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
|
||||
|
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 146 KiB |
@ -1,12 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<item>
|
||||
<!-- 设置背景颜色 -->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
android:src="@mipmap/launch_back" />
|
||||
</item>
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:top="141dp"-->
|
||||
<!-- android:left="37dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
|
||||
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:top="141dp"-->
|
||||
<!-- android:left="157dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:top="191dp"-->
|
||||
<!-- android:left="157dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:bottom="100dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- android:gravity="bottom|center_horizontal"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
|
||||
</layer-list>
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<item>
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item>
|
||||
<item>
|
||||
<bitmap
|
||||
android:width="120dp"
|
||||
android:height="120dp"
|
||||
android:gravity="top"
|
||||
android:src="@mipmap/icon_img"
|
||||
/>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 461 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 23 KiB |
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/icon_img.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/logo.png
Normal file
|
After Width: | Height: | Size: 1012 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 25 KiB |
BIN
circle_app/assets/images/base/launch_image.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
circle_app/assets/images/login/icon_logo_name.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
@ -32,7 +32,7 @@ class Call_outPage extends StatelessWidget {
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: '世界喊话',
|
||||
centerTitle: '圈内喊话',
|
||||
actionWdiget: Image.asset(
|
||||
getCircleImage('push'),
|
||||
width: 54.sp,
|
||||
|
||||
@ -136,7 +136,7 @@ class User {
|
||||
String? nickname;
|
||||
int? orientation;
|
||||
int? role;
|
||||
int? vip;
|
||||
int vip = 0;
|
||||
|
||||
User(
|
||||
{this.avatar,
|
||||
@ -149,7 +149,7 @@ class User {
|
||||
this.nickname,
|
||||
this.orientation,
|
||||
this.role,
|
||||
this.vip});
|
||||
this.vip=0});
|
||||
|
||||
User.fromJson(Map<String, dynamic> json) {
|
||||
avatar = json['avatar'];
|
||||
|
||||
@ -633,7 +633,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
lists.user!.vip==null|| lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
@ -661,8 +661,8 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
|
||||
lists.user!.role!, lists.user!.orientation!),
|
||||
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
|
||||
lists.user!.role??0, lists.user!.orientation??0),
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
@ -928,7 +928,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
lists.user!.vip==null|| lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
@ -957,8 +957,8 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
|
||||
lists.user!.role!, lists.user!.orientation!),
|
||||
getAgeCOntent(lists.user!.gender??0, lists.user!.age??0,
|
||||
lists.user!.role??0, lists.user!.orientation??0),
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
|
||||
@ -44,7 +44,7 @@ class HomeLogic extends GetxController {
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if(bean.isSuccess()&&bean.data.update==1){
|
||||
showReportDialog(Get.context!,bean.data.constraint==0,bean.data);
|
||||
// showReportDialog(Get.context!,bean.data.constraint==0,bean.data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -121,6 +121,9 @@ class Complete_materialLogic extends GetxController {
|
||||
if (state.textEditingController.text.isEmpty) {
|
||||
showToast('请输入您的昵称');
|
||||
return;
|
||||
} else if(state.textEditingController.text.length<2){
|
||||
showToast('昵称不能低于两个字');
|
||||
return;
|
||||
} else if(state.textEditingController.text.length>6){
|
||||
showToast('昵称最多输入6个字');
|
||||
return;
|
||||
|
||||
@ -34,6 +34,12 @@ class LoginPage extends StatelessWidget {
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 180.sp,
|
||||
child: Image.asset(getBaseImage("ic_launcher"),width: 120.sp,height: 120.sp,)),
|
||||
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
|
||||
@ -15,9 +15,11 @@ class SplashLogic extends GetxController {
|
||||
@override
|
||||
void onInit() async{
|
||||
super.onInit();
|
||||
// await Future.delayed(Duration(seconds: 30));
|
||||
if((await getAuthorization()).isEmpty){
|
||||
pushLoginPage();
|
||||
}else{
|
||||
|
||||
var data =
|
||||
await DioManager.instance.put(url: Api.refreshToken,params:{});
|
||||
var bean = BaseResponse<LoginData>.fromJson(data, (data) => LoginData.fromJson(data));
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../util/util.dart';
|
||||
@ -14,15 +15,89 @@ class SplashPage extends StatelessWidget {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(getBaseImage("home_back")),
|
||||
image: AssetImage('assets/images/base/launch_image.webp'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Container(),),
|
||||
body: Stack(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Positioned(
|
||||
top: 117.sp,
|
||||
left: 37.sp,
|
||||
child: Row(children: [
|
||||
Center(
|
||||
child: Image.asset(getBaseImage("ic_launcher"),width: 100.sp,height: 100.sp,),
|
||||
),
|
||||
Column(children: [
|
||||
Center(
|
||||
child: Image.asset(getLoginImage("icon_logo_name"),width: 203.sp,),
|
||||
),
|
||||
|
||||
Center(
|
||||
child: Text(
|
||||
'小众圈子的快乐家园',
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCFFFFFF),
|
||||
fontSize: 20.sp,
|
||||
// shadows: [
|
||||
// Shadow(
|
||||
// color: Color(0xFFC92BFF),
|
||||
// offset: Offset(0, 1.2),
|
||||
// blurRadius: 3.0,
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
),
|
||||
),
|
||||
],)
|
||||
],)),
|
||||
|
||||
|
||||
Positioned(
|
||||
bottom: 74.sp,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'总有一个小众圈子适合你',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: Color(0xFF02FCFB), // Set the default text color
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
],),),
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class GradientText extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0xFF0AEBED), Color(0xFFE62CFF)],
|
||||
).createShader(bounds);
|
||||
},
|
||||
child: Text(
|
||||
'总有一个小众圈子适合你',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color: Color(0xFF02FCFB), // Set the default text color
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -17,8 +17,7 @@ class UserinfoPage extends StatefulWidget {
|
||||
_MyTabbedScreenState createState() => _MyTabbedScreenState();
|
||||
}
|
||||
|
||||
class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
class _MyTabbedScreenState extends State<UserinfoPage> with SingleTickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
late PageController _pageController;
|
||||
|
||||
|
||||
@ -13,13 +13,40 @@ class CacheUtil {
|
||||
//打印每个缓存文件的路径
|
||||
print(file.path);
|
||||
});*/
|
||||
print('临时目录大小: ' + value.toString());
|
||||
return _renderSize(value);
|
||||
var filePath = await getApplicationSupportDirectoryPath();
|
||||
Directory directory = Directory(filePath); // 替换为您想要获取大小的目录路径
|
||||
int totalSize = 0;
|
||||
|
||||
if (directory.existsSync()) {
|
||||
await for (var entity in directory.list(recursive: true)) {
|
||||
if (entity is File) {
|
||||
totalSize += await entity.length();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(totalSize<600000){
|
||||
return _renderSize(value);
|
||||
}
|
||||
print('临时目录大小: ' + value.toString()+"\\\\"+totalSize.toString());
|
||||
return _renderSize(value+totalSize);
|
||||
} catch (err) {
|
||||
print(err);
|
||||
}
|
||||
}
|
||||
|
||||
getDirectorySize(Directory directory) async {
|
||||
int totalSize = 0;
|
||||
|
||||
if (directory.existsSync()) {
|
||||
await for (var entity in directory.list(recursive: true)) {
|
||||
if (entity is File) {
|
||||
totalSize += await entity.length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return totalSize;
|
||||
}
|
||||
///递归方式删除目录
|
||||
static Future<Null> delDir(FileSystemEntity file) async {
|
||||
try {
|
||||
@ -79,7 +106,21 @@ class CacheUtil {
|
||||
final _tempDir = await getTemporaryDirectory();
|
||||
double value = await _getTotalSizeOfFilesInDir(_tempDir);
|
||||
print("$value");
|
||||
if (value.toInt() <= 0) {
|
||||
|
||||
var filePath = await getApplicationSupportDirectoryPath();
|
||||
Directory directory = Directory(filePath); // 替换为您想要获取大小的目录路径
|
||||
int totalSize = 0;
|
||||
|
||||
if (directory.existsSync()) {
|
||||
await for (var entity in directory.list(recursive: true)) {
|
||||
if (entity is File) {
|
||||
totalSize += await entity.length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (value.toInt() <= 0&&totalSize<=0) {
|
||||
showToast("暂无缓存");
|
||||
|
||||
// Get.back();
|
||||
@ -87,9 +128,23 @@ class CacheUtil {
|
||||
// Get.back();
|
||||
//showToast("正在清理中···");
|
||||
SmartDialog.showLoading(msg: "正在清理中···");
|
||||
Future.delayed(Duration(seconds: 2), () async {
|
||||
var filePath = await getApplicationSupportDirectoryPath();
|
||||
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
//删除缓存目录
|
||||
await delDir(_tempDir);
|
||||
// File(filePath).delete();
|
||||
|
||||
if (await directory.exists()) {
|
||||
await for (var entity in directory.list(recursive: false)) {
|
||||
if (entity is File) {
|
||||
await entity.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
await loadCache();
|
||||
SmartDialog.dismiss();
|
||||
showToast("清理缓存成功");
|
||||
|
||||
@ -12,8 +12,8 @@ import 'package:fluwx/fluwx.dart' as fluwx;
|
||||
//注册微信
|
||||
void initWxApi() {
|
||||
fluwx.registerWxApi(
|
||||
appId: "wx6c6f4c89465dac4b",
|
||||
universalLink: "dcc5bd5012a417eb585684700fbd1307",
|
||||
appId: "wxab2387c2198f01e1",
|
||||
universalLink: "https://www.leyuan666.com/",
|
||||
);
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@ Future<void> openWxPay(PaymentData data, WxPayCallback callback) async {
|
||||
showToast("微信支付成功");
|
||||
callback(true, null);
|
||||
} else {
|
||||
print(event.errStr);
|
||||
showToast(event.errStr ?? "微信支付失败");
|
||||
callback(false, event.errStr);
|
||||
}
|
||||
|
||||
50
circle_app/lib/util/location.dart
Normal file
@ -0,0 +1,50 @@
|
||||
import 'dart:math';
|
||||
|
||||
double calculateLineDistance(LatLng var0, LatLng var1) {
|
||||
if (var0 != null && var1 != null) {
|
||||
try {
|
||||
double var2 = var0.longitude;
|
||||
double var4 = var0.latitude;
|
||||
double var6 = var1.longitude;
|
||||
double var8 = var1.latitude;
|
||||
var2 *= 0.01745329251994329;
|
||||
var4 *= 0.01745329251994329;
|
||||
var6 *= 0.01745329251994329;
|
||||
var8 *= 0.01745329251994329;
|
||||
double var10 = sin(var2);
|
||||
double var12 = sin(var4);
|
||||
double var14 = cos(var2);
|
||||
double var16 = cos(var4);
|
||||
double var18 = sin(var6);
|
||||
double var20 = sin(var8);
|
||||
double var22 = cos(var6);
|
||||
double var24 = cos(var8);
|
||||
List<double> var28 = [0, 0, 0];
|
||||
List<double> var29 = [0, 0, 0];
|
||||
var28[0] = var16 * var14;
|
||||
var28[1] = var16 * var10;
|
||||
var28[2] = var12;
|
||||
var29[0] = var24 * var22;
|
||||
var29[1] = var24 * var18;
|
||||
var29[2] = var20;
|
||||
return (asin(sqrt((var28[0] - var29[0]) * (var28[0] - var29[0]) + (var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])) / 2.0) * 1.27420015798544E7).toDouble();
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
return 0.0;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Exception("非法坐标值");
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LatLng {
|
||||
double longitude;
|
||||
double latitude;
|
||||
|
||||
LatLng(this.longitude, this.latitude);
|
||||
}
|
||||
@ -67,7 +67,8 @@ void upDataImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback
|
||||
}
|
||||
}
|
||||
var path = await getApplicationSupportDirectoryPath();
|
||||
if(isImageJpgOrPng(pickedFile.path)){
|
||||
//if(isImageJpgOrPng(pickedFile.path)){
|
||||
if(false){
|
||||
CompressObject compressObject = CompressObject(
|
||||
imageFile:File(pickedFile.path), //image
|
||||
path:path, //compress to path
|
||||
|
||||