-
-
Notifications
You must be signed in to change notification settings - Fork 415
Expand file tree
/
Copy pathwidgets_home.dart
More file actions
174 lines (172 loc) · 6.55 KB
/
widgets_home.dart
File metadata and controls
174 lines (172 loc) · 6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import '../lib/top_bar.dart';
import '../widgets/appbar/widget_app_bar.dart';
import '../widgets/toggle/widget_toggle.dart';
import 'background/widget_background.dart';
import 'button/widget_button.dart';
import 'checkbox/widget_checkbox.dart';
import 'container/widget_container.dart';
import 'icon/widget_icon.dart';
import 'indeterminate_progress/widget_indeterminate_progress.dart';
import 'indicator/widget_indicator.dart';
import 'progress/widget_progress.dart';
import 'radiobutton/widget_radio_button.dart';
import 'range_slider/widget_range_slider.dart';
import 'slider/widget_slider.dart';
import 'switch/widget_switch.dart';
class WidgetsHome extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
vertical: 18,
horizontal: 24,
),
style: NeumorphicStyle(
boxShape: NeumorphicBoxShape.roundRect(
BorderRadius.circular(12),
),
shape: NeumorphicShape.flat,
),
child: Center(child: Text(text)),
onPressed: onClick,
);
}
@override
Widget build(BuildContext context) {
return NeumorphicTheme(
theme: NeumorphicThemeData(depth: 8),
child: Scaffold(
backgroundColor: NeumorphicColors.background,
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
TopBar(title: "Widgets"),
_buildButton(
text: "Container",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ContainerWidgetPage();
}));
}),
_buildButton(
text: "App bar",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return AppBarWidgetPage();
}));
}),
_buildButton(
text: "Button",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ButtonWidgetPage();
}));
}),
_buildButton(
text: "Icon",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IconWidgetPage();
}));
}),
_buildButton(
text: "RadioButton",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return RadioButtonWidgetPage();
}));
}),
_buildButton(
text: "Checkbox",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return CheckboxWidgetPage();
}));
}),
_buildButton(
text: "Switch",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return SwitchWidgetPage();
}));
}),
_buildButton(
text: "Toggle",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ToggleWidgetPage();
}));
}),
_buildButton(
text: "Slider",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return SliderWidgetPage();
}));
}),
_buildButton(
text: "Range slider",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return RangeSliderWidgetPage();
}));
}),
_buildButton(
text: "Indicator",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IndicatorWidgetPage();
}));
}),
_buildButton(
text: "Progress",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ProgressWidgetPage();
}));
}),
_buildButton(
text: "IndeterminateProgress",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return IndeterminateProgressWidgetPage();
}));
}),
_buildButton(
text: "Background",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return BackgroundWidgetPage();
}));
}),
],
),
),
),
),
),
);
}
}