feat : dynamic form navigation

This commit is contained in:
2025-04-26 16:50:19 +03:30
parent 6e6d2b22f6
commit c10ddaf0d5
11 changed files with 568 additions and 369 deletions

View File

@@ -1,10 +1,8 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
import 'package:inspection/presentation/registration_of_violation/logic.dart';
import 'package:inspection/presentation/routes/app_routes.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
class RegistrationOfViolationPage
extends GetView<RegistrationOfViolationLogic> {
@@ -13,7 +11,7 @@ class RegistrationOfViolationPage
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor:AppColor.bgLight,
backgroundColor: AppColor.bgLight,
appBar: RAppBar(
title: 'ثبت تخلف',
leading: vecWidget(
@@ -27,77 +25,83 @@ backgroundColor:AppColor.bgLight,
],
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: Column(
children: [
Expanded(
child: ObxValue((data) {
return ListView.separated(
itemBuilder: (context, index) =>Container(
padding:EdgeInsets.symmetric(horizontal: 8,vertical: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1,color: AppColor.bgDark),
),
child: Column(
spacing:16 ,
children: [
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
itemBuilder:
(context, index) => Container(
padding: EdgeInsets.symmetric(
horizontal: 8,
vertical: 12,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 5,
minLines: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.75, color: AppColor.bgDark),
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
child: Column(
spacing: 16,
children: [
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(
child: RElevated(
text: 'ثبت',
onPressed: () {},
),
),
Expanded(
child: ROutlinedElevated(
text: 'انصراف',
onPressed: () {},
),
),
],
),
),
],
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 5,
minLines: 5,
),
SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(child: RElevated(text: 'ثبت', onPressed: (){})),
Expanded(child:ROutlinedElevated(text: 'انصراف',onPressed: (){},) ),
],
),
)
],
),
) ,
separatorBuilder: (context, index) => SizedBox(height: 15,),
),
separatorBuilder: (context, index) => SizedBox(height: 15),
itemCount: data.value,
);
},controller.countViolation),
}, controller.countViolation),
),
RElevated(
@@ -110,7 +114,7 @@ backgroundColor:AppColor.bgLight,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
),
SizedBox(height: 25,)
SizedBox(height: 25),
],
),
),