Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
country_selection_screen.dart
Go to the documentation of this file.
1import '/core/router/routes.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:flutter_svg/svg.dart';
5import 'package:go_router/go_router.dart';
6
7import '../../../core/constants/assets.dart';
8import '../../../core/ui/widgets/custom_scaffold.dart';
9import '../models/country_model.dart';
10
11import 'widgets/country_list_tile.dart';
12
13class CountrySelectionScreen extends StatefulWidget {
14 const CountrySelectionScreen({super.key});
15
16 @override
17 State<CountrySelectionScreen> createState() => _CountrySelectionScreenState();
18}
19
20class _CountrySelectionScreenState extends State<CountrySelectionScreen> {
21 final List<CountryModel> countries = [
23 id: 1,
24 name: 'India',
25 language: 'English',
26 currency: '₹',
27 flag: '🇮🇳',
28 ),
30 id: 2,
31 name: 'Morocco',
32 language: 'French',
33 currency: 'MAD',
34 flag: '🇲🇦',
35 ),
37 id: 3,
38 name: 'Saudi Arabia',
39 language: 'English',
40 currency: 'SAR',
41 flag: '🇸🇦',
42 ),
44 id: 4,
45 name: 'Tanzania',
46 language: 'English',
47 currency: 'TZS',
48 flag: '🇹🇿',
49 ),
51 id: 5,
52 name: 'United Arab Emirates',
53 language: 'English',
54 currency: 'AED',
55 flag: '🇦🇪',
56 ),
57 ];
58
60
61 @override
62 Widget build(BuildContext context) {
63 return CustomScaffold(
64 body: Stack(
65 children: [
66 Positioned(
67 top: 40,
68 left: 0,
69 right: 0,
70 bottom: 0,
71 child: SvgPicture.asset(
73 fit: BoxFit.contain,
74 ),
75 ),
76 Padding(
77 padding: EdgeInsets.only(
78 left: 25.sp,
79 right: 25.sp,
80 top: 40.sp,
81 bottom: 40.sp,
82 ),
83 child: SafeArea(
84 child: Column(
85 crossAxisAlignment: CrossAxisAlignment.stretch,
86 children: [
87 SvgPicture.asset(
89 color: Theme.of(context).textTheme.displayLarge?.color,
90 ),
91 SizedBox(height: 30.sp),
92 Column(
93 children: [
94 Padding(
95 padding: EdgeInsets.symmetric(horizontal: 10.sp),
96 child: Text(
97 'Select your country and language to personalize your Aidra Connect experience with region specific options and services.',
98 style:
99 Theme.of(context).textTheme.bodySmall?.copyWith(
100 color: Theme.of(context).hintColor,
101 height: 1.5.sp,
102 ),
103 textAlign: TextAlign.center,
104 ),
105 ),
106 ],
107 ),
108 SizedBox(height: 37.sp),
109 Expanded(
110 child: ListView.separated(
111 itemCount: countries.length,
112 separatorBuilder: (context, index) => const Padding(
113 padding: EdgeInsets.symmetric(horizontal: 16),
114 child: Divider(),
115 ),
116 itemBuilder: (context, index) {
117 final country = countries[index];
118 return CountryListTile(
119 country: country,
120 isSelected: country.id == selectedCountryId,
121 onTap: () {
122 setState(() {
123 selectedCountryId = country.id;
124 });
125 },
126 );
127 },
128 ),
129 ),
130 SizedBox(
131 width: MediaQuery.of(context).size.width,
132 child: ElevatedButton(
133 onPressed: () {
134 context.go(Routes.mainMenu.route);
135 },
136 child: const Text('Continue'),
137 ),
138 ),
139 ],
140 ),
141 ),
142 ),
143 ],
144 ),
145 );
146 }
147}
static const String headerLogo
Definition assets.dart:12
static const String worldMapBackground
Definition assets.dart:21
override State< CountrySelectionScreen > createState()
const CountrySelectionScreen({super.key})
final CurrencyEntity currency
final String name
class CountrySelectionScreen extends StatefulWidget countries
final Widget child
final EdgeInsets padding
final VoidCallback onTap
final bool isSelected
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)
Routes
Definition routes.dart:32