Skip to content

Commit 553b699

Browse files
committed
Add inspiration screen strings and update InspirationScreen to use them
1 parent ced5ff9 commit 553b699

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

lib/common/strings.dart

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import '../screens/home_screen.dart';
1111

1212
const String appName = 'Hello World Counters';
1313

14-
// -----------------------------------------------------------------------------------------------
14+
// -----------------------------------------------------------------------------
1515
// App Drawer
16-
// -----------------------------------------------------------------------------------------------
16+
// -----------------------------------------------------------------------------
1717

1818
const String drawerTitle = appName;
1919
const String settingsItemTitle = 'Settings';
@@ -32,18 +32,27 @@ const String resetConfirmCancel = 'Cancel';
3232

3333
String shareText(String name, String value) => 'The $name is $value';
3434

35-
// -----------------------------------------------------------------------------------------------
35+
// -----------------------------------------------------------------------------
3636
// Home Screen - Main
37-
// -----------------------------------------------------------------------------------------------
37+
// -----------------------------------------------------------------------------
3838

3939
const String incrementTooltip = 'Increment';
4040
const String incrementHeroTag = 'incrementHeroTag';
4141
const String decrementTooltip = 'Decrement';
4242
const String decrementHeroTag = 'decrementHeroTag';
4343

44-
// -----------------------------------------------------------------------------------------------
44+
// -----------------------------------------------------------------------------
45+
// Inspiration Screen
46+
// -----------------------------------------------------------------------------
47+
48+
String inspirationScreenTitle(String name) => '$name Inspiration';
49+
const String inspirationHeader = 'Running out of ideas? Try counting these:';
50+
String noInspirationTitle(String name) => 'No inspiration ideas yet for $name.';
51+
const String noInspirationSubtitle = 'Use this counter for anything you\'d like!';
52+
53+
// -----------------------------------------------------------------------------
4554
// Settings Screen
46-
// -----------------------------------------------------------------------------------------------
55+
// -----------------------------------------------------------------------------
4756

4857
const String settingsTitle = 'Settings';
4958
const String counterTapModeTitle = 'Counter tap mode';

lib/screens/inspiration_screen.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import 'package:flutter/material.dart';
88

9+
import '../common/strings.dart' as strings;
910
import '../data/counter_ideas.dart';
1011
import '../models/counter.dart';
1112
import '../utils/utils.dart';
@@ -25,7 +26,7 @@ class InspirationScreen extends StatelessWidget {
2526

2627
return Scaffold(
2728
appBar: AppBar(
28-
title: Text('$colorName Inspiration'),
29+
title: Text(strings.inspirationScreenTitle(colorName)),
2930
backgroundColor: counterColor,
3031
foregroundColor: textColor,
3132
iconTheme: IconThemeData(color: textColor),
@@ -49,7 +50,7 @@ class InspirationScreen extends StatelessWidget {
4950
),
5051
const SizedBox(height: 16),
5152
Text(
52-
'No inspiration ideas yet for $colorName.',
53+
strings.noInspirationTitle(colorName),
5354
textAlign: TextAlign.center,
5455
style: TextStyle(
5556
fontSize: 18,
@@ -58,7 +59,7 @@ class InspirationScreen extends StatelessWidget {
5859
),
5960
const SizedBox(height: 8),
6061
Text(
61-
'Use this counter for anything you\'d like!',
62+
strings.noInspirationSubtitle,
6263
textAlign: TextAlign.center,
6364
style: TextStyle(
6465
fontSize: 16,
@@ -80,7 +81,7 @@ class InspirationScreen extends StatelessWidget {
8081
Padding(
8182
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
8283
child: Text(
83-
'Running out of ideas? Try counting these:',
84+
strings.inspirationHeader,
8485
style: TextStyle(
8586
fontSize: 14,
8687
color: Colors.grey[600],

0 commit comments

Comments
 (0)