-
-
Notifications
You must be signed in to change notification settings - Fork 415
Expand file tree
/
Copy pathsample_home.dart
More file actions
121 lines (119 loc) · 4.26 KB
/
sample_home.dart
File metadata and controls
121 lines (119 loc) · 4.26 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
import 'package:flutter/material.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
import '../lib/top_bar.dart';
import '../samples/audio_player_sample.dart';
import '../samples/calculator_sample.dart';
import '../samples/clock/clock_sample.dart';
import '../samples/credit_card_sample.dart';
import '../samples/form_sample.dart';
import '../samples/testla_sample.dart';
import 'galaxy_sample.dart';
import 'widgets_sample.dart';
class SamplesHome extends StatelessWidget {
Widget _buildButton({String text, VoidCallback onClick}) {
return NeumorphicButton(
margin: EdgeInsets.only(bottom: 12),
padding: EdgeInsets.symmetric(
vertical: 18,
horizontal: 24,
),
style: NeumorphicStyle(
shape: NeumorphicShape.flat,
boxShape: NeumorphicBoxShape.roundRect(
BorderRadius.circular(12),
),
),
child: Center(child: Text(text)),
onPressed: onClick,
);
}
@override
Widget build(BuildContext context) {
return NeumorphicTheme(
theme: NeumorphicThemeData(depth: 8),
darkTheme: 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(),
_buildButton(
text: "Tesla",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return TeslaSample();
}));
}),
_buildButton(
text: "Audio Player",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return AudioPlayerSample();
}));
}),
_buildButton(
text: "Clock",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return ClockSample();
}));
}),
_buildButton(
text: "Galaxy",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return GalaxySample();
}));
}),
_buildButton(
text: "Calculator",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return CalculatorSample();
}));
}),
_buildButton(
text: "Form",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return FormSample();
}));
}),
_buildButton(
text: "CreditCard",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return CreditCardSample();
}));
}),
_buildButton(
text: "Widgets",
onClick: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) {
return WidgetsSample();
}));
}),
],
),
),
),
),
),
);
}
}