195 lines
7.2 KiB
Dart
195 lines
7.2 KiB
Dart
import 'package:animated_custom_dropdown/custom_dropdown.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:gascom/constants/app_theme.dart';
|
|
import 'package:gascom/widgets/app_button.dart';
|
|
import 'package:gascom/widgets/app_text_field.dart';
|
|
|
|
class GeneratorInfoScreen extends StatefulWidget {
|
|
const GeneratorInfoScreen({super.key});
|
|
|
|
@override
|
|
State<GeneratorInfoScreen> createState() => _GeneratorInfoScreenState();
|
|
}
|
|
|
|
class _GeneratorInfoScreenState extends State<GeneratorInfoScreen> {
|
|
|
|
final TextEditingController ownerNameController = TextEditingController();
|
|
final TextEditingController phoneController = TextEditingController();
|
|
final TextEditingController areaController = TextEditingController();
|
|
final TextEditingController districtController = TextEditingController();
|
|
final TextEditingController laneController = TextEditingController();
|
|
final TextEditingController generatorBrandController = TextEditingController();
|
|
final TextEditingController generatorPowerController = TextEditingController();
|
|
final TextEditingController authorizedNameController = TextEditingController();
|
|
|
|
String selectedGeneratorType = 'حكومية';
|
|
List<String> availableGeneratorType = ['حكومية', 'اهلية'];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
body: SafeArea(
|
|
child: ListView(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
children: [
|
|
const SizedBox(height: 45,),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
"معلومات المولدة",
|
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
Text(
|
|
"#10023432",
|
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
textDirection: TextDirection.ltr,
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 30,),
|
|
Text(
|
|
"اسم صاحب المولدة",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: ownerNameController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"رقم الهاتف",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: phoneController,
|
|
keyboardType: TextInputType.phone,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"فئة المولدة",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
CustomDropdown<String>(
|
|
hintText: "فئة المولدة",
|
|
items: availableGeneratorType,
|
|
closedHeaderPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
expandedHeaderPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
decoration: CustomDropdownDecoration(
|
|
closedFillColor: AppTheme.primaryColor,
|
|
expandedFillColor: AppTheme.primaryColor,
|
|
closedBorder: Border.all(
|
|
color: AppTheme.textColor,
|
|
width: 1
|
|
),
|
|
expandedBorder: Border.all(
|
|
color: AppTheme.textColor,
|
|
width: 1
|
|
),
|
|
closedBorderRadius: const BorderRadius.all(Radius.circular(30)),
|
|
expandedBorderRadius: const BorderRadius.all(Radius.circular(20)),
|
|
hintStyle: Theme.of(context).textTheme.bodySmall,
|
|
listItemStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
headerStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
expandedSuffixIcon: const Icon(CupertinoIcons.chevron_up, color: AppTheme.textColor, size: 18,),
|
|
closedSuffixIcon: const Icon(CupertinoIcons.chevron_down, color: AppTheme.textColor, size: 18,),
|
|
),
|
|
onChanged: (value) {
|
|
selectedGeneratorType = value ?? "";
|
|
},
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"المنطقة",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: areaController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"المحلة",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: districtController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"الزقاق",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: laneController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"نوع المولدة",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: generatorBrandController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"راس التوليد",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: generatorPowerController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 15,),
|
|
Text(
|
|
"مخول استلام الحصة الوقودية",
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
const SizedBox(height: 6,),
|
|
AppTextField(
|
|
controller: authorizedNameController,
|
|
keyboardType: TextInputType.text,
|
|
),
|
|
const SizedBox(height: 40,),
|
|
Center(
|
|
child: SizedBox(
|
|
width: 200,
|
|
height: 45,
|
|
child: AppButton(
|
|
onPressed: handleUpdateInfo,
|
|
label: "تحديث المعلومات",
|
|
isElevated: false
|
|
)
|
|
),
|
|
),
|
|
const SizedBox(height: 50,),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
void handleUpdateInfo() {
|
|
}
|
|
} |