@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22import 'package:retro_shopping/helpers/constants.dart' ;
33import 'package:retro_shopping/widgets/retro_button.dart' ;
44import 'package:retro_shopping/widgets/settings_item.dart' ;
5+ import 'package:retro_shopping/widgets/stacked_container.dart' ;
56
67class Settings extends StatefulWidget {
78 @override
@@ -20,20 +21,71 @@ class _SettingsState extends State<Settings> {
2021
2122 @override
2223 Widget build (BuildContext context) {
24+ final view = ListView (children: < Widget > [
25+ Column (mainAxisAlignment: MainAxisAlignment .center,
26+ children: < Widget > [
27+ settingsItem (context, 'Your Orders' , Icons .bookmark_border_sharp,
28+ routeName: RouteConstant .ORDERS_SCREEN , push: true ,),
29+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
30+ child: divider (),),
31+ settingsItem (context, 'Change Username/\n Password' , Icons .person,
32+ routeName: RouteConstant .CHANGE_USERNAME_SCREEN , push: true ,),
33+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
34+ child: divider (),),
35+ settingsItem (context, 'FAQs' , Icons .question_answer,
36+ routeName: RouteConstant .FAQs_SCREEN , push: true ,),
37+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
38+ child: divider (),),
39+ settingsItem (context, 'Manage Address' , Icons .location_pin,
40+ routeName: RouteConstant .ADDRESS_SCREEN , push: true ,),
41+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
42+ child: divider (),),
43+ settingsItem (context, 'T&C' , Icons .quick_contacts_dialer,
44+ routeName: RouteConstant .TERMS_CONDITIONS , push: true ,),
45+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
46+ child: divider (),),
47+ Row (children: < Widget > [
48+ const SizedBox (height: 70 ,),
49+ Expanded (child: Row (children: const < Widget > [
50+ SizedBox (width: 10 ,),
51+ Icon (Icons .notifications_active, size: 25 , color: Colors .white,),
52+ SizedBox (width: 20 ,),
53+ Expanded (child: Text ('Notifications(on/off)' , style: TextStyle (
54+ fontWeight: FontWeight .normal, fontSize: 16 )),)
55+ ],),),
56+ Switch (value: switchedOn, onChanged: (bool value) {
57+ setState (() {
58+ switchedOn = value;
59+ });
60+ }, activeColor: Colors .white, activeTrackColor: Colors .black,)
61+ ],),
62+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
63+ child: divider (),),
64+ settingsItem (context, 'LogOut' , Icons .logout,
65+ routeName: RouteConstant .LOGIN_SCREEN , push: false ,),
66+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
67+ child: divider (),),
68+ settingsItem (
69+ context, 'GitHub Repo Link' , Icons .verified_user_outlined),
70+ Padding (padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
71+ child: divider (),),
72+ ],),
73+ ]);
74+
2375 return Scaffold (
2476 appBar: AppBar (
2577 backgroundColor: RelicColors .backgroundColor,
2678 leading: Padding (
27- padding: const EdgeInsets .all ( 8.0 ),
79+ padding: const EdgeInsets .only (left : 14.0 , right : 10 , top : 15 , bottom : 10 ),
2880 child: GestureDetector (
2981 onTap: () {
3082 Navigator .pop (context);
3183 },
3284 child: RetroButton (
3385 upperColor: Colors .white,
3486 lowerColor: Colors .black,
35- width: 35 ,
36- height: 35 ,
87+ width: 25 ,
88+ height: 25 ,
3789 borderColor: Colors .white,
3890 child: const Icon (
3991 Icons .arrow_back,
@@ -46,144 +98,10 @@ class _SettingsState extends State<Settings> {
4698 elevation: 0.0 ,
4799 ),
48100 body: Padding (
49- padding: const EdgeInsets .only (left: 14.0 , right: 10.0 ),
101+ padding: const EdgeInsets .only (left: 20 , right: 15 ,top : 10 ),
50102 child: SingleChildScrollView (
51- child: Stack (
52- children: < Widget > [
53- Container (
54- width: MediaQuery .of (context).size.width * 0.92 + 10 ,
55- height: MediaQuery .of (context).size.height * 0.85 + 10 ,
56- decoration: const BoxDecoration (color: Colors .black),
57- ),
58- Container (
59- padding:
60- const EdgeInsets .symmetric (vertical: 16 , horizontal: 12 ),
61- width: MediaQuery .of (context).size.width * 0.92 - 3 ,
62- height: MediaQuery .of (context).size.height * 0.85 + 5 ,
63- decoration:
64- const BoxDecoration (color: RelicColors .primaryColor),
65- child: Column (
66- mainAxisAlignment: MainAxisAlignment .center,
67- children: < Widget > [
68- settingsItem (
69- context,
70- 'Your Orders' ,
71- Icons .bookmark_border_sharp,
72- routeName: RouteConstant .ORDERS_SCREEN ,
73- push: true ,
74- ),
75- Padding (
76- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
77- child: divider (),
78- ),
79- settingsItem (
80- context,
81- 'Change Username/\n Password' ,
82- Icons .person,
83- routeName: RouteConstant .CHANGE_USERNAME_SCREEN ,
84- push: true ,
85- ),
86- Padding (
87- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
88- child: divider (),
89- ),
90- settingsItem (
91- context,
92- 'FAQs' ,
93- Icons .question_answer,
94- routeName: RouteConstant .FAQs_SCREEN ,
95- push: true ,
96- ),
97- Padding (
98- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
99- child: divider (),
100- ),
101- settingsItem (
102- context,
103- 'Manage Address' ,
104- Icons .location_pin,
105- routeName: RouteConstant .ADDRESS_SCREEN ,
106- push: true ,
107- ),
108- Padding (
109- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
110- child: divider (),
111- ),
112- settingsItem (
113- context,
114- 'T&C' ,
115- Icons .quick_contacts_dialer,
116- routeName: RouteConstant .TERMS_CONDITIONS ,
117- push: true ,
118- ),
119- Padding (
120- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
121- child: divider (),
122- ),
123- Row (
124- children: < Widget > [
125- const SizedBox (
126- height: 70 ,
127- ),
128- Expanded (
129- child: Row (
130- children: const < Widget > [
131- SizedBox (
132- width: 5 ,
133- ),
134- Icon (
135- Icons .notifications_active,
136- size: 30 ,
137- color: Colors .white,
138- ),
139- SizedBox (
140- width: 5 ,
141- ),
142- Text ('Notifications(on/off)' ,
143- style: TextStyle (
144- fontWeight: FontWeight .normal,
145- fontSize: 20 ))
146- ],
147- ),
148- ),
149- Switch (
150- value: switchedOn,
151- onChanged: (bool value) {
152- setState (() {
153- switchedOn = value;
154- });
155- },
156- activeColor: Colors .white,
157- activeTrackColor: Colors .black,
158- )
159- ],
160- ),
161- Padding (
162- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
163- child: divider (),
164- ),
165- settingsItem (
166- context,
167- 'LogOut' ,
168- Icons .logout,
169- routeName: RouteConstant .LOGIN_SCREEN ,
170- push: false ,
171- ),
172- Padding (
173- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
174- child: divider (),
175- ),
176- settingsItem (context, 'GitHub Repo Link' ,
177- Icons .verified_user_outlined),
178- Padding (
179- padding: const EdgeInsets .only (left: 16.0 , right: 16.0 ),
180- child: divider (),
181- ),
182- ],
183- ),
184- ),
185- ],
186- ),
103+ child: StackedContainer ( height: MediaQuery .of (context).size.height * 0.82 + 10 ,
104+ width: MediaQuery .of (context).size.width * 0.92 + 10 , child: view,)
187105 ),
188106 ));
189107 }
0 commit comments