feat : new ui

This commit is contained in:
2025-09-21 14:32:58 +03:30
parent bbd572c579
commit 50d708469c
23 changed files with 872 additions and 502 deletions

View File

@@ -23,9 +23,9 @@ Future<void> main() async {
Get.put<AuthRouteResolver>(AppAuthRouteResolver());
Get.put(AuthMiddleware());
//runApp(MyApp());
runApp(MyApp());
runApp(DevicePreview(builder: (context) => ForDevicePreview(),));
//runApp(DevicePreview(builder: (context) => ForDevicePreview(),));
}
class ForDevicePreview extends StatelessWidget {
@@ -60,7 +60,7 @@ class ForDevicePreview extends StatelessWidget {
}
}
/*class MyApp extends StatelessWidget {
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@@ -90,4 +90,4 @@ class ForDevicePreview extends StatelessWidget {
),
);
}
}*/
}

View File

@@ -21,129 +21,124 @@ class ModulesPage extends GetView<ModulesLogic> {
centerTitle: true,
backgroundColor: AppColor.blueNormal,
),
body: Stack(
fit: StackFit.expand,
alignment: Alignment.center,
children: [
Positioned.fill(
child: Column(
children: [
SizedBox(height: 12.h),
SliderWidget(widgetTag: "up"),
body: ObxValue((loading) {
if (!controller.isLoading.value) {
return buildMainWidget();
}
return buildLoading();
}, controller.isLoading),
);
}
SizedBox(
height: 244.h,
child: GridView.builder(
Container buildLoading() {
return Container(
color: Colors.grey.withValues(alpha: 0.5),
child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal, radius: 30)),
);
}
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 24.h),
itemBuilder: (context, index) {
final module = controller.moduleList[index];
return CardIcon(
title: module.title,
svgIcon: module.icon,
borderColor: module.borderColor,
backgroundColor: module.backgroundColor,
titleColor: module.titleColor,
onTap: () => controller.onTapCard(module.module, index),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 22.h,
crossAxisSpacing: 16.w,
),
physics: NeverScrollableScrollPhysics(),
itemCount: controller.moduleList.length,
),
Column buildMainWidget() {
return Column(
children: [
SizedBox(height: 12.h,),
SliderWidget(widgetTag: "up"),
SizedBox(height: 12.h,),
SizedBox(
height: 278.h,
child: GridView.builder(
padding: EdgeInsetsGeometry.symmetric(horizontal: 16.w),
itemBuilder: (context, index) {
final module = controller.moduleList[index];
return CardIcon(
title: module.title,
svgIcon: module.icon,
borderColor: module.borderColor,
backgroundColor: module.backgroundColor,
titleColor: module.titleColor,
onTap: () => controller.onTapCard(module.module, index),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 22.h,
crossAxisSpacing: 16.w,
),
Container(
height: 107.h,
margin: EdgeInsets.symmetric(horizontal: 16.w),
padding: EdgeInsets.fromLTRB(11.w, 8.h, 8.w, 12.h),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(0.00, 0.50),
end: Alignment(1.00, 0.50),
colors: [const Color(0xFFC9D5FF), Colors.white],
),
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1.w, color: const Color(0xFFD3D3D3)),
),
child: Row(
spacing: 11.w,
children: [
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'آخرین اخبار ',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: Color(0xFF5B5B5B),
height: 1.90,
),
),
ObxValue(
(data) => Text(
data.value ??
'اخبار مربوط به جوجه ریزی استان از آخرین روند مطلع شوید...',
maxLines: 2,
style: AppFonts.yekan12.copyWith(
color: Color(0xFF5B5B5B),
height: 1.5,
overflow: TextOverflow.ellipsis,
),
),
controller.latestNews,
),
],
physics: NeverScrollableScrollPhysics(),
itemCount: controller.moduleList.length,
),
),
Container(
height: 107.h,
margin: EdgeInsets.symmetric(horizontal: 16.w),
padding: EdgeInsets.fromLTRB(11.w, 8.h, 8.w, 12.h),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(0.00, 0.50),
end: Alignment(1.00, 0.50),
colors: [const Color(0xFFC9D5FF), Colors.white],
),
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1.w, color: const Color(0xFFD3D3D3)),
),
child: Row(
spacing: 11.w,
children: [
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'آخرین اخبار ',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: Color(0xFF5B5B5B),
height: 1.90,
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 103.w,
height: 24.h,
alignment: Alignment.center,
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50.r),
),
),
child: Text(
'اطلاعات بیشتر',
textAlign: TextAlign.right,
style: AppFonts.yekan14,
ObxValue(
(data) => Text(
data.value ??
'اخبار مربوط به جوجه ریزی استان از آخرین روند مطلع شوید...',
maxLines: 2,
style: AppFonts.yekan12.copyWith(
color: Color(0xFF5B5B5B),
height: 1.5,
overflow: TextOverflow.ellipsis,
),
),
],
controller.latestNews,
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 103.w,
height: 24.h,
alignment: Alignment.center,
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50.r),
),
),
child: Text(
'اطلاعات بیشتر',
textAlign: TextAlign.right,
style: AppFonts.yekan14,
),
),
],
),
),
SizedBox(height: 12.h),
SliderWidget(height: 160, widgetTag: "down"),
SizedBox(height: 20.h),
],
),
),
ObxValue((loading) {
if (!controller.isLoading.value) return SizedBox.shrink();
return Container(
color: Colors.grey.withValues(alpha: 0.5),
child: Center(
child: CupertinoActivityIndicator(color: AppColor.greenNormal, radius: 30),
],
),
);
}, controller.isLoading),
],
),
);
),
SizedBox(height: 12.h,),
SliderWidget(height: 160, widgetTag: "down"),
],
);
}
}