Skip to content

Commit ae767a1

Browse files
author
sazardev
committed
Add screens for Images, Inputs, Layout, Navigation, and Text widgets
- Implement ImagesScreen with various icon and image examples. - Create InputsScreen showcasing text fields, switches, sliders, and other input types. - Develop LayoutScreen demonstrating different layout widgets like Container, Column, Row, Stack, and Wrap. - Introduce NavigationScreen featuring app bars, bottom navigation, tab bars, and drawers. - Establish TextScreen to illustrate text styling, rich text, selectable text, and text decorations.
1 parent 88a6a62 commit ae767a1

14 files changed

Lines changed: 2404 additions & 93 deletions

README.md

Lines changed: 281 additions & 38 deletions
Large diffs are not rendered by default.

lib/controllers/search.controller.dart

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class GetSearchController extends GetxController {
1515

1616
void loadWidgets() {
1717
allWidgets.assignAll([
18+
// Actions widgets
1819
{
1920
'name': 'FilledButton',
2021
'category': 'actions',
@@ -40,6 +41,27 @@ class GetSearchController extends GetxController {
4041
'category': 'actions',
4142
'route': '/components/actions'
4243
},
44+
{
45+
'name': 'FloatingActionButton',
46+
'category': 'actions',
47+
'route': '/components/actions'
48+
},
49+
{
50+
'name': 'DropdownButton',
51+
'category': 'actions',
52+
'route': '/components/actions'
53+
},
54+
{
55+
'name': 'PopupMenuButton',
56+
'category': 'actions',
57+
'route': '/components/actions'
58+
},
59+
{
60+
'name': 'MenuAnchor',
61+
'category': 'actions',
62+
'route': '/components/actions'
63+
},
64+
// Selection widgets
4365
{
4466
'name': 'Checkbox',
4567
'category': 'selections',
@@ -70,6 +92,112 @@ class GetSearchController extends GetxController {
7092
'category': 'selections',
7193
'route': '/components/selections'
7294
},
95+
{
96+
'name': 'Dialog',
97+
'category': 'selections',
98+
'route': '/components/selections'
99+
},
100+
{
101+
'name': 'DatePicker',
102+
'category': 'selections',
103+
'route': '/components/selections'
104+
},
105+
{
106+
'name': 'TimePicker',
107+
'category': 'selections',
108+
'route': '/components/selections'
109+
},
110+
// Input widgets
111+
{
112+
'name': 'TextField',
113+
'category': 'inputs',
114+
'route': '/components/inputs'
115+
},
116+
{
117+
'name': 'TextFormField',
118+
'category': 'inputs',
119+
'route': '/components/inputs'
120+
},
121+
{'name': 'Switch', 'category': 'inputs', 'route': '/components/inputs'},
122+
{'name': 'Slider', 'category': 'inputs', 'route': '/components/inputs'},
123+
{
124+
'name': 'RangeSlider',
125+
'category': 'inputs',
126+
'route': '/components/inputs'
127+
},
128+
{'name': 'Stepper', 'category': 'inputs', 'route': '/components/inputs'},
129+
// Navigation widgets
130+
{
131+
'name': 'AppBar',
132+
'category': 'navigation',
133+
'route': '/components/navigation'
134+
},
135+
{
136+
'name': 'BottomNavigationBar',
137+
'category': 'navigation',
138+
'route': '/components/navigation'
139+
},
140+
{
141+
'name': 'NavigationBar',
142+
'category': 'navigation',
143+
'route': '/components/navigation'
144+
},
145+
{
146+
'name': 'TabBar',
147+
'category': 'navigation',
148+
'route': '/components/navigation'
149+
},
150+
{
151+
'name': 'Drawer',
152+
'category': 'navigation',
153+
'route': '/components/navigation'
154+
},
155+
{
156+
'name': 'PageView',
157+
'category': 'navigation',
158+
'route': '/components/navigation'
159+
},
160+
{
161+
'name': 'NavigationRail',
162+
'category': 'navigation',
163+
'route': '/components/navigation'
164+
},
165+
// Text widgets
166+
{'name': 'Text', 'category': 'text', 'route': '/components/text'},
167+
{'name': 'RichText', 'category': 'text', 'route': '/components/text'},
168+
{
169+
'name': 'SelectableText',
170+
'category': 'text',
171+
'route': '/components/text'
172+
},
173+
// Image widgets
174+
{'name': 'Image', 'category': 'images', 'route': '/components/images'},
175+
{'name': 'Icon', 'category': 'images', 'route': '/components/images'},
176+
{
177+
'name': 'CircleAvatar',
178+
'category': 'images',
179+
'route': '/components/images'
180+
},
181+
{
182+
'name': 'NetworkImage',
183+
'category': 'images',
184+
'route': '/components/images'
185+
},
186+
// Layout widgets
187+
{
188+
'name': 'Container',
189+
'category': 'layout',
190+
'route': '/components/layout'
191+
},
192+
{'name': 'Column', 'category': 'layout', 'route': '/components/layout'},
193+
{'name': 'Row', 'category': 'layout', 'route': '/components/layout'},
194+
{'name': 'Stack', 'category': 'layout', 'route': '/components/layout'},
195+
{'name': 'Padding', 'category': 'layout', 'route': '/components/layout'},
196+
{'name': 'Center', 'category': 'layout', 'route': '/components/layout'},
197+
{'name': 'Wrap', 'category': 'layout', 'route': '/components/layout'},
198+
{'name': 'Expanded', 'category': 'layout', 'route': '/components/layout'},
199+
{'name': 'Flexible', 'category': 'layout', 'route': '/components/layout'},
200+
{'name': 'SizedBox', 'category': 'layout', 'route': '/components/layout'},
73201
]);
74202
}
75203

lib/core/routes/routes.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ class Routes {
33
static const SETTINGS = '/settings';
44
static const FAVORITES = '/favorites';
55
static const COMPONENTS_ACTIONS = '/components/actions/';
6+
static const COMPONENTS_INPUTS = '/components/inputs/';
7+
static const COMPONENTS_NAVIGATION = '/components/navigation/';
8+
static const COMPONENTS_TEXT = '/components/text/';
9+
static const COMPONENTS_IMAGES = '/components/images/';
10+
static const COMPONENTS_LAYOUT = '/components/layout/';
611
static const COMPONENTS_SETTINGS = '/components/settings/';
712
}

lib/main.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import 'package:get/get.dart';
33
import 'package:widgets_in_flutter/favorites/favorites.screen.dart';
44
import 'package:widgets_in_flutter/favorites/favorites.controller.dart';
55
import 'package:widgets_in_flutter/widgets/actions/actions.screen.dart';
6+
import 'package:widgets_in_flutter/widgets/inputs/inputs.screen.dart';
7+
import 'package:widgets_in_flutter/widgets/navigation/navigation.screen.dart';
8+
import 'package:widgets_in_flutter/widgets/text/text.screen.dart';
9+
import 'package:widgets_in_flutter/widgets/images/images.screen.dart';
10+
import 'package:widgets_in_flutter/widgets/layout/layout.screen.dart';
611
import 'package:widgets_in_flutter/code/code.controller.dart';
712
import 'package:widgets_in_flutter/widgets/components.screen.dart';
813
import 'package:widgets_in_flutter/core/routes/routes.controller.dart';
@@ -40,6 +45,26 @@ class MyApp extends StatelessWidget {
4045
name: Routes.COMPONENTS_ACTIONS,
4146
page: () => const ActionsScreen(),
4247
),
48+
GetPage(
49+
name: Routes.COMPONENTS_INPUTS,
50+
page: () => const InputsScreen(),
51+
),
52+
GetPage(
53+
name: Routes.COMPONENTS_NAVIGATION,
54+
page: () => const NavigationScreen(),
55+
),
56+
GetPage(
57+
name: Routes.COMPONENTS_TEXT,
58+
page: () => const TextScreen(),
59+
),
60+
GetPage(
61+
name: Routes.COMPONENTS_IMAGES,
62+
page: () => const ImagesScreen(),
63+
),
64+
GetPage(
65+
name: Routes.COMPONENTS_LAYOUT,
66+
page: () => const LayoutScreen(),
67+
),
4368
],
4469
initialBinding: BindingsBuilder(() {
4570
Get.put(RoutesController());

lib/widgets/actions/actions.screen.dart

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,146 @@ class ActionsScreen extends StatelessWidget {
151151
),
152152
],
153153
),
154+
CardComponents(
155+
content: 'Floating Action Buttons',
156+
components: [
157+
FloatingActionButton(
158+
onPressed: () {},
159+
child: const Icon(Icons.add),
160+
),
161+
FloatingActionButton.small(
162+
onPressed: () {},
163+
child: const Icon(Icons.add),
164+
),
165+
FloatingActionButton.large(
166+
onPressed: () {},
167+
child: const Icon(Icons.add),
168+
),
169+
FloatingActionButton.extended(
170+
onPressed: () {},
171+
label: const Text('Extended'),
172+
icon: const Icon(Icons.add),
173+
),
174+
],
175+
),
176+
CardComponents(
177+
content: 'Dropdown Buttons',
178+
components: [
179+
DropdownButton<String>(
180+
value: 'Option 1',
181+
items: ['Option 1', 'Option 2', 'Option 3']
182+
.map((String value) => DropdownMenuItem<String>(
183+
value: value,
184+
child: Text(value),
185+
))
186+
.toList(),
187+
onChanged: (String? newValue) {},
188+
),
189+
DropdownButtonFormField<String>(
190+
value: 'Option 1',
191+
decoration: const InputDecoration(
192+
labelText: 'Select Option',
193+
border: OutlineInputBorder(),
194+
),
195+
items: ['Option 1', 'Option 2', 'Option 3']
196+
.map((String value) => DropdownMenuItem<String>(
197+
value: value,
198+
child: Text(value),
199+
))
200+
.toList(),
201+
onChanged: (String? newValue) {},
202+
),
203+
],
204+
),
205+
CardComponents(
206+
content: 'Popup Menu Buttons',
207+
components: [
208+
PopupMenuButton<String>(
209+
icon: const Icon(Icons.more_vert),
210+
onSelected: (String value) {},
211+
itemBuilder: (BuildContext context) => [
212+
const PopupMenuItem(
213+
value: 'edit',
214+
child: ListTile(
215+
leading: Icon(Icons.edit),
216+
title: Text('Edit'),
217+
),
218+
),
219+
const PopupMenuItem(
220+
value: 'delete',
221+
child: ListTile(
222+
leading: Icon(Icons.delete),
223+
title: Text('Delete'),
224+
),
225+
),
226+
const PopupMenuItem(
227+
value: 'share',
228+
child: ListTile(
229+
leading: Icon(Icons.share),
230+
title: Text('Share'),
231+
),
232+
),
233+
],
234+
),
235+
PopupMenuButton<String>(
236+
child: const FilledButton(
237+
onPressed: null,
238+
child: Row(
239+
mainAxisSize: MainAxisSize.min,
240+
children: [
241+
Text('Menu'),
242+
Icon(Icons.arrow_drop_down),
243+
],
244+
),
245+
),
246+
onSelected: (String value) {},
247+
itemBuilder: (BuildContext context) => [
248+
const PopupMenuItem(
249+
value: 'option1', child: Text('Option 1')),
250+
const PopupMenuItem(
251+
value: 'option2', child: Text('Option 2')),
252+
const PopupMenuItem(
253+
value: 'option3', child: Text('Option 3')),
254+
],
255+
),
256+
],
257+
),
258+
CardComponents(
259+
content: 'Menu Anchor Buttons',
260+
components: [
261+
MenuAnchor(
262+
builder: (context, controller, child) {
263+
return FilledButton(
264+
onPressed: () {
265+
if (controller.isOpen) {
266+
controller.close();
267+
} else {
268+
controller.open();
269+
}
270+
},
271+
child: const Text('Show Menu'),
272+
);
273+
},
274+
menuChildren: [
275+
MenuItemButton(
276+
leadingIcon: const Icon(Icons.home),
277+
child: const Text('Home'),
278+
onPressed: () {},
279+
),
280+
MenuItemButton(
281+
leadingIcon: const Icon(Icons.settings),
282+
child: const Text('Settings'),
283+
onPressed: () {},
284+
),
285+
MenuItemButton(
286+
leadingIcon: const Icon(Icons.logout),
287+
child: const Text('Logout'),
288+
onPressed: () {},
289+
),
290+
],
291+
),
292+
],
293+
),
154294
],
155295
),
156296
bottomNavigationBar: const NavigationBarWidget(),

0 commit comments

Comments
 (0)