Skip to content

Commit c4597eb

Browse files
committed
v6.5.0
1 parent 2d73b3e commit c4597eb

File tree

7 files changed

+172
-139
lines changed

7 files changed

+172
-139
lines changed

lib/resources/pages/home_page.dart

Lines changed: 118 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class _HomePageState extends NyPage<HomePage> {
1919

2020
@override
2121
get init => () async {
22-
/// Uncomment the code below to fetch the number of stars for the Nylo repository
23-
// Map<String, dynamic>? githubResponse = await api<ApiService>(
24-
// (request) => request.githubInfo(),
25-
// );
26-
// _stars = githubResponse?["stargazers_count"];
27-
};
22+
/// Uncomment the code below to fetch the number of stars for the Nylo repository
23+
// Map<String, dynamic>? githubResponse = await api<ApiService>(
24+
// (request) => request.githubInfo(),
25+
// );
26+
// _stars = githubResponse?["stargazers_count"];
27+
};
2828

2929
/// Define the Loading style for the page.
3030
/// Options: LoadingStyle.normal(), LoadingStyle.skeletonizer(), LoadingStyle.none()
@@ -49,125 +49,125 @@ class _HomePageState extends NyPage<HomePage> {
4949
),
5050
body: SafeAreaWidget(
5151
child: Column(
52+
crossAxisAlignment: CrossAxisAlignment.center,
53+
mainAxisAlignment: MainAxisAlignment.center,
54+
children: [
55+
const Logo(),
56+
Text(
57+
getEnv("APP_NAME"),
58+
).displayMedium(color: context.color.content),
59+
const Text("Micro-framework for Flutter", textAlign: TextAlign.center)
60+
.titleMedium(color: context.color.primaryAccent),
61+
const Text("Build something amazing 💡", textAlign: TextAlign.center)
62+
.bodyMedium()
63+
.alignCenter(),
64+
Column(
5265
crossAxisAlignment: CrossAxisAlignment.center,
53-
mainAxisAlignment: MainAxisAlignment.center,
54-
children: [
55-
const Logo(),
56-
Text(
57-
getEnv("APP_NAME"),
58-
).displayMedium(color: context.color.content),
59-
const Text("Micro-framework for Flutter", textAlign: TextAlign.center)
60-
.titleMedium(color: context.color.primaryAccent),
61-
const Text("Build something amazing 💡", textAlign: TextAlign.center)
62-
.bodyMedium()
63-
.alignCenter(),
64-
Column(
65-
crossAxisAlignment: CrossAxisAlignment.center,
66-
mainAxisAlignment: MainAxisAlignment.start,
67-
children: <Widget>[
68-
const Divider(),
69-
Container(
70-
height: 250,
71-
width: double.infinity,
72-
margin:
66+
mainAxisAlignment: MainAxisAlignment.start,
67+
children: <Widget>[
68+
const Divider(),
69+
Container(
70+
height: 250,
71+
width: double.infinity,
72+
margin:
7373
const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
74-
padding:
74+
padding:
7575
const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
76-
decoration: BoxDecoration(
77-
color: context.color.surfaceBackground,
78-
borderRadius: BorderRadius.circular(8),
79-
boxShadow: [
80-
BoxShadow(
81-
color: Colors.grey.withAlpha((255.0 * 0.1).round()),
82-
spreadRadius: 1,
83-
blurRadius: 9,
84-
offset: const Offset(0, 3),
85-
),
86-
]),
87-
child: Center(
88-
child: ListView(
89-
padding: EdgeInsets.zero,
90-
shrinkWrap: true,
91-
children: ListTile.divideTiles(context: context, tiles: [
92-
if (Nylo.containsRoute("/landing"))
93-
ListTile(
94-
leading: FaIcon(FontAwesomeIcons.rocket),
95-
title: Text(
96-
"Start building",
97-
).bodyLarge(color: context.color.surfaceContent),
98-
subtitle: Text(
99-
"Your project is ready",
100-
).bodySmall(color: context.color.surfaceContent),
101-
trailing: const Icon(Icons.chevron_right),
102-
onTap: () => routeTo("/landing"),
103-
),
104-
ListTile(
105-
leading: FaIcon(FontAwesomeIcons.readme),
106-
title: Text(
107-
"Documentation",
108-
).bodyLarge(color: context.color.surfaceContent),
109-
subtitle: Text(
110-
"Master the framework",
111-
).bodySmall(color: context.color.surfaceContent),
112-
trailing: const Icon(Icons.chevron_right),
113-
onTap: widget.controller.onTapDocumentation,
114-
),
115-
ListTile(
116-
leading: FaIcon(FontAwesomeIcons.github),
117-
title: Text(
118-
"Github",
119-
).bodyLarge(color: context.color.surfaceContent),
120-
subtitle: Text(
121-
_stars == null ? "Source code" : "$_stars Stars",
122-
).bodySmall(color: context.color.surfaceContent),
123-
trailing: const Icon(Icons.chevron_right),
124-
onTap: widget.controller.onTapGithub,
125-
),
126-
ListTile(
127-
leading: FaIcon(FontAwesomeIcons.newspaper),
128-
title: Text(
129-
"Updates",
130-
).bodyLarge(color: context.color.surfaceContent),
131-
subtitle: Text(
132-
"View the changelog",
133-
).bodySmall(color: context.color.surfaceContent),
134-
trailing: const Icon(Icons.chevron_right),
135-
onTap: widget.controller.onTapChangeLog,
136-
),
137-
ListTile(
138-
leading: FaIcon(FontAwesomeIcons.youtube),
139-
title: Text(
140-
"YouTube Channel",
141-
).bodyLarge(color: context.color.surfaceContent),
142-
subtitle: Text(
143-
"Tutorial videos",
144-
).bodySmall(color: context.color.surfaceContent),
145-
trailing: const Icon(Icons.chevron_right),
146-
onTap: widget.controller.onTapYouTube,
147-
),
148-
ListTile(
149-
leading: FaIcon(FontAwesomeIcons.xTwitter),
150-
title: Text(
151-
"Follow us on X",
152-
).bodyLarge(color: context.color.surfaceContent),
153-
subtitle: Text(
154-
"Stay updated",
155-
).bodySmall(color: context.color.surfaceContent),
156-
trailing: const Icon(Icons.chevron_right),
157-
onTap: widget.controller.onTapX,
158-
),
159-
]).toList(),
76+
decoration: BoxDecoration(
77+
color: context.color.surfaceBackground,
78+
borderRadius: BorderRadius.circular(8),
79+
boxShadow: [
80+
BoxShadow(
81+
color: Colors.grey.withAlpha((255.0 * 0.1).round()),
82+
spreadRadius: 1,
83+
blurRadius: 9,
84+
offset: const Offset(0, 3),
16085
),
161-
),
86+
]),
87+
child: Center(
88+
child: ListView(
89+
padding: EdgeInsets.zero,
90+
shrinkWrap: true,
91+
children: ListTile.divideTiles(context: context, tiles: [
92+
if (Nylo.containsRoute("/landing"))
93+
ListTile(
94+
leading: FaIcon(FontAwesomeIcons.rocket),
95+
title: Text(
96+
"Start building",
97+
).bodyLarge(color: context.color.surfaceContent),
98+
subtitle: Text(
99+
"Your project is ready",
100+
).bodySmall(color: context.color.surfaceContent),
101+
trailing: const Icon(Icons.chevron_right),
102+
onTap: () => routeTo("/landing"),
103+
),
104+
ListTile(
105+
leading: FaIcon(FontAwesomeIcons.readme),
106+
title: Text(
107+
"Documentation",
108+
).bodyLarge(color: context.color.surfaceContent),
109+
subtitle: Text(
110+
"Master the framework",
111+
).bodySmall(color: context.color.surfaceContent),
112+
trailing: const Icon(Icons.chevron_right),
113+
onTap: widget.controller.onTapDocumentation,
114+
),
115+
ListTile(
116+
leading: FaIcon(FontAwesomeIcons.github),
117+
title: Text(
118+
"Github",
119+
).bodyLarge(color: context.color.surfaceContent),
120+
subtitle: Text(
121+
_stars == null ? "Source code" : "$_stars Stars",
122+
).bodySmall(color: context.color.surfaceContent),
123+
trailing: const Icon(Icons.chevron_right),
124+
onTap: widget.controller.onTapGithub,
125+
),
126+
ListTile(
127+
leading: FaIcon(FontAwesomeIcons.newspaper),
128+
title: Text(
129+
"Updates",
130+
).bodyLarge(color: context.color.surfaceContent),
131+
subtitle: Text(
132+
"View the changelog",
133+
).bodySmall(color: context.color.surfaceContent),
134+
trailing: const Icon(Icons.chevron_right),
135+
onTap: widget.controller.onTapChangeLog,
136+
),
137+
ListTile(
138+
leading: FaIcon(FontAwesomeIcons.youtube),
139+
title: Text(
140+
"YouTube Channel",
141+
).bodyLarge(color: context.color.surfaceContent),
142+
subtitle: Text(
143+
"Tutorial videos",
144+
).bodySmall(color: context.color.surfaceContent),
145+
trailing: const Icon(Icons.chevron_right),
146+
onTap: widget.controller.onTapYouTube,
147+
),
148+
ListTile(
149+
leading: FaIcon(FontAwesomeIcons.xTwitter),
150+
title: Text(
151+
"Follow us on X",
152+
).bodyLarge(color: context.color.surfaceContent),
153+
subtitle: Text(
154+
"Stay updated",
155+
).bodySmall(color: context.color.surfaceContent),
156+
trailing: const Icon(Icons.chevron_right),
157+
onTap: widget.controller.onTapX,
158+
),
159+
]).toList(),
162160
),
163-
const Text(
164-
"Framework Version: $nyloVersion",
165-
).bodyMedium().setColor(context, (color) => Colors.grey),
166-
ThemeToggle(),
167-
],
161+
),
168162
),
163+
const Text(
164+
"Framework Version: $nyloVersion",
165+
).bodyMedium().setColor(context, (color) => Colors.grey),
166+
ThemeToggle(),
169167
],
170-
)),
168+
),
169+
],
170+
)),
171171
);
172172
}
173173
}

lib/resources/themes/dark_theme.dart

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@ ThemeData darkTheme(ColorStyles color) {
2020
focusColor: color.content,
2121
scaffoldBackgroundColor: color.background,
2222
brightness: Brightness.dark,
23+
datePickerTheme: DatePickerThemeData(
24+
headerForegroundColor: Colors.white,
25+
weekdayStyle: TextStyle(color: Colors.white),
26+
dayForegroundColor: MaterialStateProperty.resolveWith<Color?>(
27+
(Set<MaterialState> states) {
28+
if (states.contains(MaterialState.selected)) {
29+
return Colors.black; // Color for selected date
30+
}
31+
return Colors.white; // Color for unselected dates
32+
}),
33+
),
34+
timePickerTheme: TimePickerThemeData(
35+
hourMinuteTextColor: Colors.white,
36+
dialTextColor: Colors.white,
37+
dayPeriodTextColor: Colors.white,
38+
helpTextStyle: TextStyle(color: Colors.white),
39+
// For the AM/PM selector
40+
dayPeriodBorderSide: BorderSide(color: Colors.white),
41+
// For the dial background
42+
dialBackgroundColor: Colors.grey[800],
43+
// For the input decoration if using text input mode
44+
inputDecorationTheme: InputDecorationTheme(
45+
labelStyle: TextStyle(color: Colors.white),
46+
hintStyle: TextStyle(color: Colors.white70),
47+
),
48+
),
2349
appBarTheme: AppBarTheme(
2450
surfaceTintColor: Colors.transparent,
2551
backgroundColor: color.appBarBackground,
@@ -64,8 +90,12 @@ TextTheme _textTheme(ColorStyles colors) {
6490
TextTheme textTheme = const TextTheme()
6591
.apply(displayColor: colors.content, bodyColor: colors.content);
6692
return textTheme.copyWith(
67-
titleLarge: TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
68-
labelLarge: TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
69-
bodySmall: TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
70-
bodyMedium: TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())));
93+
titleLarge:
94+
TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
95+
labelLarge:
96+
TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
97+
bodySmall:
98+
TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())),
99+
bodyMedium:
100+
TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())));
71101
}

lib/resources/themes/light_theme.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ ThemeData lightTheme(ColorStyles color) {
6767
TextTheme _textTheme(ColorStyles colors) {
6868
TextTheme textTheme = const TextTheme().apply(displayColor: colors.content);
6969
return textTheme.copyWith(
70-
labelLarge: TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())));
70+
labelLarge:
71+
TextStyle(color: colors.content.withAlpha((255.0 * 0.8).round())));
7172
}

lib/resources/themes/styles/light_theme_colors.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class LightThemeColors implements ColorStyles {
3434
@override
3535
Color get buttonSecondaryBackground => const Color(0xff151925);
3636
@override
37-
Color get buttonSecondaryContent => Colors.white.withAlpha((255.0 * 0.9).round());
37+
Color get buttonSecondaryContent =>
38+
Colors.white.withAlpha((255.0 * 0.9).round());
3839

3940
// bottom tab bar
4041
@override

lib/resources/widgets/toast_notification_widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class ToastNotification extends StatelessWidget {
7272
maxLines: 2,
7373
overflow: TextOverflow.ellipsis,
7474
).bodyMedium(
75-
color: context.color.content.withAlpha((255.0 * 0.8).round())),
75+
color: context.color.content
76+
.withAlpha((255.0 * 0.8).round())),
7677
),
7778
],
7879
),

0 commit comments

Comments
 (0)