77 lines
2.5 KiB
Dart
77 lines
2.5 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
import 'logic.dart';
|
|
|
|
class ModulesPage extends GetView<ModulesLogic> {
|
|
const ModulesPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Row(
|
|
spacing: 5.w,
|
|
children: [
|
|
Text('سامانه جامع رصدیار', style: AppFonts.yekan18Bold.copyWith(color: Colors.white)),
|
|
Assets.logos.finalLogo.image(width: 40.w, height: 40.h),
|
|
],
|
|
),
|
|
centerTitle: true,
|
|
backgroundColor: AppColor.blueNormal,
|
|
),
|
|
body: Stack(
|
|
fit: StackFit.expand,
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Positioned.fill(
|
|
child: Column(
|
|
children: [
|
|
SizedBox(height: 24.h),
|
|
SliderWidget(widgetTag: "up"),
|
|
|
|
Expanded(
|
|
child: GridView.builder(
|
|
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 24.h),
|
|
itemBuilder: (context, index) {
|
|
final module = controller.moduleList[index];
|
|
return CardIcon(
|
|
title: module.title,
|
|
icon: module.icon,
|
|
borderColor: module.borderColor,
|
|
backgroundColor: module.backgroundColor,
|
|
titleColor: module.titleColor,
|
|
onTap: () => controller.onTapCard(module.module, index),
|
|
);
|
|
},
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 3,
|
|
mainAxisSpacing: 24.h,
|
|
crossAxisSpacing: 16.w,
|
|
),
|
|
physics: BouncingScrollPhysics(),
|
|
itemCount: controller.moduleList.length,
|
|
),
|
|
),
|
|
|
|
SliderWidget(height: 160, widgetTag: "down"),
|
|
SizedBox(height: 30.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),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|