Skip to content

Commit 536e842

Browse files
committed
added strings and asset paths to the constant files
1 parent 5d16cdf commit 536e842

5 files changed

Lines changed: 49 additions & 25 deletions

File tree

lib/constants/asset_paths.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ class ImageAssets {
55
static const String blackBoard = 'assets/canvas/black.png';
66
static const String epaper37Bwr = 'assets/images/displays/epaper_3.7_bwr.png';
77
static const String epaper37Bw = 'assets/images/displays/epaper_3.7_bw.PNG';
8+
static const String tempIcon = 'assets/icons/icon.png';
9+
static const String githubIcon = 'assets/icons/github.png';
10+
static const String badgeIcon = 'assets/icons/badge.png';
811
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
class StringConstants {
22
static const String appName = 'Magic epaper';
3+
static const String aboutUsDescription =
4+
'Magic ePaper is an app designed to control and update ePaper displays.'
5+
'The goal is to provide tools for customizing and transferring images, text, and patterns to ePaper screens using NFC.'
6+
'Data transfer from the smartphone to the ePaper hardware is done wirelessly via NFC. The project is built on top of custom firmware and display drivers for seamless communication and efficient image rendering.';
7+
static const String developedBy = 'Developed by';
8+
static const String fossasiaContributors = 'FOSSASIA contributors';
9+
static const String contactWithUs = 'Contact With Us';
10+
static const String github = 'GitHub';
11+
static const String githubSubtitle =
12+
'Fork the repo and push changes or submit new issues.';
13+
static const String license = 'License';
14+
static const String licenseSubtitle =
15+
'Check Apache License 2.0 terms used on Magic ePaper.';
16+
static const String selectDisplay = 'Select Display';
17+
static const String selectDisplayType = 'Select your ePaper display type';
18+
static const String settings = 'Settings';
19+
static const String aboutUs = 'About Us';
20+
static const String other = 'Other';
21+
static const String buyBadge = 'Buy Badge';
22+
static const String feedbackBugReports = 'Feedback/Bug Reports';
23+
static const String continueButton = 'Continue';
324
}

lib/view/about_us_screen.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/services.dart';
33
import 'package:google_fonts/google_fonts.dart';
4+
import 'package:magic_epaper_app/constants/asset_paths.dart';
5+
import 'package:magic_epaper_app/constants/string_constants.dart';
46
import 'package:magic_epaper_app/constants/url_constant.dart';
57
import 'package:magic_epaper_app/view/widget/common_scaffold_widget.dart';
68

@@ -56,16 +58,14 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
5658
),
5759
Center(
5860
child: Image.asset(
59-
'assets/icons/icon.png',
61+
ImageAssets.tempIcon,
6062
height: 100,
6163
fit: BoxFit.contain,
6264
),
6365
),
6466
const SizedBox(height: 30),
6567
Text(
66-
"Magic ePaper is an app designed to control and update ePaper displays."
67-
"The goal is to provide tools for customizing and transferring images, text, and patterns to ePaper screens using NFC."
68-
"Data transfer from the smartphone to the ePaper hardware is done wirelessly via NFC. The project is built on top of custom firmware and display drivers for seamless communication and efficient image rendering.",
68+
StringConstants.aboutUsDescription,
6969
textAlign: TextAlign.justify,
7070
style: GoogleFonts.sora(
7171
wordSpacing: 3,
@@ -81,7 +81,7 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
8181
children: [
8282
Flexible(
8383
child: Text(
84-
'Developed by',
84+
StringConstants.developedBy,
8585
style: GoogleFonts.sora(
8686
fontWeight: FontWeight.w500,
8787
color: Colors.grey,
@@ -95,7 +95,7 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
9595
onTap: () => openUrl(
9696
'https://github.com/fossasia/magic-epaper-app/graphs/contributors'),
9797
child: Text(
98-
'FOSSASIA contributors',
98+
StringConstants.fossasiaContributors,
9999
style: GoogleFonts.sora(
100100
fontWeight: FontWeight.w500,
101101
color: Colors.red,
@@ -130,7 +130,7 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
130130
Padding(
131131
padding: const EdgeInsets.only(left: 12.0, top: 12.0),
132132
child: Text(
133-
'Contact With Us',
133+
StringConstants.contactWithUs,
134134
style: GoogleFonts.sora(
135135
fontSize: 16,
136136
fontWeight: FontWeight.w500,
@@ -140,20 +140,20 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
140140
),
141141
ListTile(
142142
leading: Image.asset(
143-
'assets/icons/github.png',
143+
ImageAssets.githubIcon,
144144
height: 40,
145145
fit: BoxFit.contain,
146146
),
147147
title: Text(
148-
'GitHub',
148+
StringConstants.github,
149149
style: GoogleFonts.sora(
150150
fontSize: 16,
151151
fontWeight: FontWeight.w500,
152152
color: Colors.black,
153153
),
154154
),
155155
subtitle: Text(
156-
'Fork the repo and push changes or submit new issues.',
156+
StringConstants.githubSubtitle,
157157
style: GoogleFonts.sora(
158158
fontSize: 12,
159159
fontWeight: FontWeight.w500,
@@ -186,7 +186,7 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
186186
Padding(
187187
padding: const EdgeInsets.all(12.0),
188188
child: Text(
189-
"License",
189+
StringConstants.license,
190190
style: GoogleFonts.sora(
191191
fontSize: 18,
192192
fontWeight: FontWeight.w500,
@@ -196,20 +196,20 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
196196
),
197197
ListTile(
198198
leading: Image.asset(
199-
'assets/icons/badge.png',
199+
ImageAssets.badgeIcon,
200200
height: 40,
201201
fit: BoxFit.contain,
202202
),
203203
title: Text(
204-
'License',
204+
StringConstants.license,
205205
style: GoogleFonts.sora(
206206
fontSize: 16,
207207
fontWeight: FontWeight.w500,
208208
color: Colors.black,
209209
),
210210
),
211211
subtitle: Text(
212-
'Check Apache License 2.0 terms used on Magic ePaper.',
212+
StringConstants.licenseSubtitle,
213213
style: GoogleFonts.sora(
214214
fontSize: 12,
215215
fontWeight: FontWeight.w500,
@@ -245,7 +245,7 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
245245
),
246246
),
247247
),
248-
title: 'Magic ePaper',
248+
title: StringConstants.appName,
249249
);
250250
}
251251
}

lib/view/display_selection_screen.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// display_selection_screen.dart
21
import 'package:flutter/material.dart';
32
import 'package:magic_epaper_app/constants/color_constants.dart';
43
import 'package:magic_epaper_app/constants/string_constants.dart';
@@ -46,7 +45,7 @@ class _DisplaySelectionScreenState extends State<DisplaySelectionScreen> {
4645
),
4746
SizedBox(height: 8),
4847
Text(
49-
'Select your ePaper display type',
48+
StringConstants.selectDisplayType,
5049
style: TextStyle(
5150
fontSize: 16,
5251
color: Colors.white,
@@ -117,7 +116,7 @@ class _DisplaySelectionScreenState extends State<DisplaySelectionScreen> {
117116
),
118117
),
119118
child: const Text(
120-
'Continue',
119+
StringConstants.continueButton,
121120
style: TextStyle(
122121
fontSize: 16,
123122
fontWeight: FontWeight.bold,

lib/view/widget/navigation_drawer.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:magic_epaper_app/constants/color_constants.dart';
3+
import 'package:magic_epaper_app/constants/string_constants.dart';
34
import 'package:magic_epaper_app/constants/url_constant.dart';
45
import 'package:share_plus/share_plus.dart';
56

@@ -42,7 +43,7 @@ class _AppDrawerState extends State<AppDrawer> {
4243
),
4344
child: Center(
4445
child: Text(
45-
'Magic ePaper',
46+
StringConstants.appName,
4647
style: TextStyle(
4748
color: drawerHeaderTitle,
4849
fontSize: 25,
@@ -54,27 +55,27 @@ class _AppDrawerState extends State<AppDrawer> {
5455
_buildListTile(
5556
index: 0,
5657
icon: Icons.edit,
57-
title: 'Select Display',
58+
title: StringConstants.selectDisplay,
5859
routeName: '/',
5960
),
6061

6162
_buildListTile(
6263
index: 1,
6364
icon: Icons.settings,
64-
title: 'Settings',
65+
title: StringConstants.settings,
6566
routeName: '/settings',
6667
),
6768
_buildListTile(
6869
index: 2,
6970
icon: Icons.people,
70-
title: 'About Us',
71+
title: StringConstants.aboutUs,
7172
routeName: '/aboutUs',
7273
),
7374
const Divider(),
7475
const Padding(
7576
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 10),
7677
child: Text(
77-
'Other',
78+
StringConstants.other,
7879
style: TextStyle(
7980
color: Colors.black54,
8081
fontWeight: FontWeight.bold,
@@ -85,7 +86,7 @@ class _AppDrawerState extends State<AppDrawer> {
8586
_buildListTile(
8687
index: 3,
8788
icon: Icons.shopping_cart,
88-
title: 'Buy Badge',
89+
title: StringConstants.buyBadge,
8990
routeName: '/buyBadge',
9091
externalLink: 'https://fossasia.com/',
9192
),
@@ -110,7 +111,7 @@ class _AppDrawerState extends State<AppDrawer> {
110111
_buildListTile(
111112
index: 4,
112113
icon: Icons.bug_report,
113-
title: 'Feedback/Bug Reports',
114+
title: StringConstants.feedbackBugReports,
114115
routeName: '/feedback',
115116
externalLink: 'https://github.com/fossasia/magic-epaper-app/issues',
116117
),

0 commit comments

Comments
 (0)