175 lines
6.9 KiB
Dart
175 lines
6.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
import 'package:gascom/constants/app_theme.dart';
|
|
import 'package:gascom/screens/change_engine_screen.dart';
|
|
import 'package:gascom/screens/change_location.dart';
|
|
import 'package:gascom/screens/document_camera_screen.dart';
|
|
import 'package:gascom/screens/fines_screen.dart';
|
|
import 'package:gascom/screens/notifications_screen.dart';
|
|
import 'package:gascom/screens/pay_monthly_gas.dart';
|
|
import 'package:gascom/screens/service_fees_screen.dart';
|
|
import 'package:gascom/widgets/app_button.dart';
|
|
import 'package:gascom/widgets/home_grid_item.dart';
|
|
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
|
|
|
|
class HomeScreen extends StatefulWidget {
|
|
const HomeScreen({super.key});
|
|
|
|
@override
|
|
State<HomeScreen> createState() => _HomeScreenState();
|
|
}
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
body: SafeArea(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 50,),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SvgPicture.asset(
|
|
width: 160,
|
|
"assets/svgs/logo.svg",
|
|
semanticsLabel: 'Logo',
|
|
),
|
|
InkWell(
|
|
onTap: () => pushScreenWithoutNavBar(context, const NotificationsScreen()),
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 10),
|
|
child: SvgPicture.asset(
|
|
"assets/svgs/notification.svg",
|
|
semanticsLabel: 'Menu',
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 40,),
|
|
Row(
|
|
children: [
|
|
SizedBox(
|
|
width: MediaQuery.sizeOf(context).width * 0.65,
|
|
child: const Divider(
|
|
color: AppTheme.yellowColor,
|
|
thickness: 3,
|
|
height: 0,
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: MediaQuery.sizeOf(context).width * 0.35,
|
|
child: const Divider(
|
|
color: AppTheme.secondaryColor,
|
|
thickness: 1,
|
|
height: 0,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 30,),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
"الخدمات",
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
SizedBox(
|
|
width: 140,
|
|
height: 32,
|
|
child: AppButton(
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, const ServiceFeesScreen());
|
|
},
|
|
label: "رسوم الخدمات",
|
|
isElevated: false
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 30,),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: GridView(
|
|
shrinkWrap: true,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 3,
|
|
crossAxisSpacing: 20,
|
|
mainAxisSpacing: 5,
|
|
childAspectRatio: MediaQuery.sizeOf(context).width / (MediaQuery.sizeOf(context).height / 1.3),
|
|
),
|
|
children: [
|
|
HomeGridItem(
|
|
title: "طلب حصة",
|
|
svgPath: "assets/svgs/gas_station.svg",
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, PayMonthlyGas());
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "غرامات",
|
|
svgPath: "assets/svgs/dollar_flag.svg",
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, const FinesScreen());
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "تحويل موقع",
|
|
svgPath: "assets/svgs/location_pin.svg",
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, const ChangeLocationScreen());
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "تبديل محرك",
|
|
svgPath: "assets/svgs/settings.svg",
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, const ChangeEngineScreen());
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "تجديد بطاقة الحصة الوقودية",
|
|
svgPath: "assets/svgs/profile_paper.svg",
|
|
onPressed: () {
|
|
pushScreenWithoutNavBar(context, const DocumentCameraScreen(title: "تجديد دفتر", description: "لتجديد الدفتر يرجى ارفاق صورة للدفتر الحالي, ضع الدفتر في المربع، وتاكد من وجود اضاءة جيدة ثم اضغط التقاط.",));
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "تغيير مخول",
|
|
svgPath: "assets/svgs/user_sync.svg",
|
|
onPressed: () {
|
|
}
|
|
),
|
|
HomeGridItem(
|
|
title: "الدعم الفني",
|
|
svgPath: "assets/svgs/headphone.svg",
|
|
onPressed: () {}
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
)
|
|
)
|
|
);
|
|
}
|
|
} |