|
@@ -1,5 +1,3 @@
|
|
|
-import 'dart:ui';
|
|
|
|
|
-
|
|
|
|
|
import 'package:clean/base/base_view.dart';
|
|
import 'package:clean/base/base_view.dart';
|
|
|
import 'package:clean/module/home/home_controller.dart';
|
|
import 'package:clean/module/home/home_controller.dart';
|
|
|
import 'package:clean/resource/assets.gen.dart';
|
|
import 'package:clean/resource/assets.gen.dart';
|
|
@@ -30,17 +28,17 @@ class HomePage extends BaseView<HomeController> {
|
|
|
SafeArea(
|
|
SafeArea(
|
|
|
child: SingleChildScrollView(
|
|
child: SingleChildScrollView(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
- children: [
|
|
|
|
|
- titleCard(),
|
|
|
|
|
- storageCard(),
|
|
|
|
|
- similarCard(),
|
|
|
|
|
- quickPhotoCard(),
|
|
|
|
|
- peopleCard(),
|
|
|
|
|
- locationsCard(),
|
|
|
|
|
- screenshotsAndBlurryCard(),
|
|
|
|
|
- SizedBox(height: 40.h),
|
|
|
|
|
- ],
|
|
|
|
|
- )),
|
|
|
|
|
|
|
+ children: [
|
|
|
|
|
+ titleCard(),
|
|
|
|
|
+ storageCard(),
|
|
|
|
|
+ similarCard(),
|
|
|
|
|
+ quickPhotoCard(),
|
|
|
|
|
+ peopleCard(),
|
|
|
|
|
+ locationsCard(),
|
|
|
|
|
+ screenshotsAndBlurryCard(),
|
|
|
|
|
+ SizedBox(height: 40.h),
|
|
|
|
|
+ ],
|
|
|
|
|
+ )),
|
|
|
),
|
|
),
|
|
|
IgnorePointer(
|
|
IgnorePointer(
|
|
|
child: Assets.images.bgHome.image(
|
|
child: Assets.images.bgHome.image(
|
|
@@ -87,7 +85,7 @@ class HomePage extends BaseView<HomeController> {
|
|
|
width: 328.w,
|
|
width: 328.w,
|
|
|
height: 146.h,
|
|
height: 146.h,
|
|
|
decoration: ShapeDecoration(
|
|
decoration: ShapeDecoration(
|
|
|
- color: Colors.white.withValues(alpha: 0.10000000149011612),
|
|
|
|
|
|
|
+ color: Colors.white.withValues(alpha: 0.10),
|
|
|
shape: RoundedRectangleBorder(
|
|
shape: RoundedRectangleBorder(
|
|
|
borderRadius: BorderRadius.circular(14.r),
|
|
borderRadius: BorderRadius.circular(14.r),
|
|
|
),
|
|
),
|
|
@@ -141,51 +139,50 @@ class HomePage extends BaseView<HomeController> {
|
|
|
CircularChartAnnotation(
|
|
CircularChartAnnotation(
|
|
|
widget: Container(
|
|
widget: Container(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
children: [
|
|
children: [
|
|
|
- Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
- children: [
|
|
|
|
|
- Obx(() {
|
|
|
|
|
- return Text(
|
|
|
|
|
- controller.usedSpacePercentage.toStringAsFixed(0),
|
|
|
|
|
- textAlign: TextAlign.end,
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Colors.white
|
|
|
|
|
- .withValues(alpha: 0.8999999761581421),
|
|
|
|
|
- fontSize: 30.sp,
|
|
|
|
|
- height: 1,
|
|
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
|
|
- ),
|
|
|
|
|
- );
|
|
|
|
|
- }),
|
|
|
|
|
- Text(
|
|
|
|
|
- '%',
|
|
|
|
|
- textAlign: TextAlign.end,
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Colors.white
|
|
|
|
|
- .withValues(alpha: 0.8999999761581421),
|
|
|
|
|
- fontSize: 14.87.r,
|
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ Obx(() {
|
|
|
|
|
+ return Text(
|
|
|
|
|
+ controller.usedSpacePercentage.toStringAsFixed(0),
|
|
|
|
|
+ textAlign: TextAlign.end,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: Colors.white
|
|
|
|
|
+ .withValues(alpha: 0.8999999761581421),
|
|
|
|
|
+ fontSize: 30.sp,
|
|
|
|
|
+ height: 1,
|
|
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
),
|
|
),
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ );
|
|
|
|
|
+ }),
|
|
|
Text(
|
|
Text(
|
|
|
- 'used',
|
|
|
|
|
- textAlign: TextAlign.center,
|
|
|
|
|
|
|
+ '%',
|
|
|
|
|
+ textAlign: TextAlign.end,
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
- color: Colors.white.withValues(
|
|
|
|
|
- alpha: 0.6000000238418579),
|
|
|
|
|
|
|
+ color: Colors.white
|
|
|
|
|
+ .withValues(alpha: 0.8999999761581421),
|
|
|
fontSize: 14.87.r,
|
|
fontSize: 14.87.r,
|
|
|
- height: 1,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
fontWeight: FontWeight.w500,
|
|
|
),
|
|
),
|
|
|
- )
|
|
|
|
|
|
|
+ ),
|
|
|
],
|
|
],
|
|
|
- )),
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ 'used',
|
|
|
|
|
+ textAlign: TextAlign.center,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: Colors.white.withValues(alpha: 0.6000000238418579),
|
|
|
|
|
+ fontSize: 14.87.r,
|
|
|
|
|
+ height: 1,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ )),
|
|
|
horizontalAlignment: ChartAlignment.center,
|
|
horizontalAlignment: ChartAlignment.center,
|
|
|
verticalAlignment: ChartAlignment.center,
|
|
verticalAlignment: ChartAlignment.center,
|
|
|
radius: '0%',
|
|
radius: '0%',
|
|
@@ -254,7 +251,7 @@ class HomePage extends BaseView<HomeController> {
|
|
|
text: controller.totalSpace.toStringAsFixed(1),
|
|
text: controller.totalSpace.toStringAsFixed(1),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
color:
|
|
color:
|
|
|
- Colors.white.withValues(alpha: 0.6000000238418579),
|
|
|
|
|
|
|
+ Colors.white.withValues(alpha: 0.6000000238418579),
|
|
|
fontSize: 13.sp,
|
|
fontSize: 13.sp,
|
|
|
fontWeight: FontWeight.w400,
|
|
fontWeight: FontWeight.w400,
|
|
|
),
|
|
),
|
|
@@ -263,7 +260,7 @@ class HomePage extends BaseView<HomeController> {
|
|
|
text: 'GB',
|
|
text: 'GB',
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
color:
|
|
color:
|
|
|
- Colors.white.withValues(alpha: 0.6000000238418579),
|
|
|
|
|
|
|
+ Colors.white.withValues(alpha: 0.6000000238418579),
|
|
|
fontSize: 13.sp,
|
|
fontSize: 13.sp,
|
|
|
fontWeight: FontWeight.w500,
|
|
fontWeight: FontWeight.w500,
|
|
|
),
|
|
),
|
|
@@ -371,7 +368,7 @@ class HomePage extends BaseView<HomeController> {
|
|
|
margin: EdgeInsets.only(top: 20.h),
|
|
margin: EdgeInsets.only(top: 20.h),
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
decoration: ShapeDecoration(
|
|
decoration: ShapeDecoration(
|
|
|
- color: Colors.white.withValues(alpha: 0.11999999731779099),
|
|
|
|
|
|
|
+ color: Colors.white.withValues(alpha: 0.12),
|
|
|
shape: RoundedRectangleBorder(
|
|
shape: RoundedRectangleBorder(
|
|
|
borderRadius: BorderRadius.circular(16.r),
|
|
borderRadius: BorderRadius.circular(16.r),
|
|
|
),
|
|
),
|
|
@@ -678,17 +675,17 @@ class CleanUpButton extends StatelessWidget {
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
- return Container(
|
|
|
|
|
- width: 94.w,
|
|
|
|
|
- height: 44.h,
|
|
|
|
|
- decoration: ShapeDecoration(
|
|
|
|
|
- color: Color(0xFF0279FB),
|
|
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
|
|
- borderRadius: BorderRadius.circular(10.r),
|
|
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
|
+ onTap: onTap,
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ width: 94.w,
|
|
|
|
|
+ height: 44.h,
|
|
|
|
|
+ decoration: ShapeDecoration(
|
|
|
|
|
+ color: Color(0xFF0279FB),
|
|
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(10.r),
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
- ),
|
|
|
|
|
- child: GestureDetector(
|
|
|
|
|
- onTap: onTap,
|
|
|
|
|
child: Row(
|
|
child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
children: [
|
|
children: [
|
|
@@ -748,9 +745,20 @@ class ImageContainer extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
child: Center(
|
|
child: Center(
|
|
|
- child: Assets.images.iconHomeNoPhoto.image(
|
|
|
|
|
- width: size * 0.45, // 图片的大小相对容器
|
|
|
|
|
- height: size * 0.45,
|
|
|
|
|
|
|
+ child: Center(
|
|
|
|
|
+ child: imagePath == 'iconHomeNoPhoto' // 如果是占位图,则显示默认图
|
|
|
|
|
+ ? Assets.images.iconHomeNoPhoto.image(
|
|
|
|
|
+ // 显示占位图
|
|
|
|
|
+ width: size * 0.45,
|
|
|
|
|
+ height: size * 0.45,
|
|
|
|
|
+ )
|
|
|
|
|
+ : Image.asset(
|
|
|
|
|
+ // 显示动态图片
|
|
|
|
|
+ imagePath,
|
|
|
|
|
+ width: size,
|
|
|
|
|
+ height: size,
|
|
|
|
|
+ fit: BoxFit.cover, // 保持图片的比例
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|