Skip to content

Commit b733e86

Browse files
authored
Use bottom sheet for font control (#208)
Also: * Re-organize padding constants
1 parent 08cd25b commit b733e86

23 files changed

+291
-153
lines changed

lib/l10n/intl_en.arb

Lines changed: 144 additions & 1 deletion
Large diffs are not rendered by default.

lib/l10n/intl_messages.arb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"@@last_modified": "2023-08-13T17:16:55.316783",
2+
"@@last_modified": "2023-08-13T21:27:18.604523",
3+
"@@locale": "messages",
34
"appTitle": "tinhte.vn Demo",
45
"@appTitle": {
56
"type": "text",
@@ -93,6 +94,18 @@
9394
"tag": {}
9495
}
9596
},
97+
"fontControlTooltip": "Adjust font",
98+
"@fontControlTooltip": {
99+
"type": "text",
100+
"placeholders_order": [],
101+
"placeholders": {}
102+
},
103+
"fontScaleAdjust": "Adjust font size",
104+
"@fontScaleAdjust": {
105+
"type": "text",
106+
"placeholders_order": [],
107+
"placeholders": {}
108+
},
96109
"forums": "Forums",
97110
"@forums": {
98111
"description": "Forum list appbar title",

lib/l10n/intl_vi.arb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"@@last_modified": "2021-09-03T00:46:44.814800",
3+
"@@locale": "vi",
34
"appTitle": "Tinh tế Demo",
45
"@appTitle": {
56
"type": "text",
@@ -73,6 +74,16 @@
7374
"tag": {}
7475
}
7576
},
77+
"fontControlTooltip": "Điều chỉnh hiển thị",
78+
"@fontControlTooltip": {
79+
"type": "text",
80+
"placeholders": {}
81+
},
82+
"fontScaleAdjust": "Điều chỉnh cỡ chữ",
83+
"@fontScaleAdjust": {
84+
"type": "text",
85+
"placeholders": {}
86+
},
7687
"forums": "Diễn đàn",
7788
"@forums": {
7889
"description": "Forum list appbar title",

lib/l10n/messages_en.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class MessageLookup extends MessageLookupByLibrary {
6464
"followNotificationChannelExplainForX" : m3,
6565
"followNotificationChannels" : MessageLookupByLibrary.simpleMessage("Notification channels"),
6666
"followUnfollowXQuestion" : m4,
67+
"fontControlTooltip" : MessageLookupByLibrary.simpleMessage("Adjust font"),
68+
"fontScaleAdjust" : MessageLookupByLibrary.simpleMessage("Adjust font size"),
6769
"forums" : MessageLookupByLibrary.simpleMessage("Forums"),
6870
"home" : MessageLookupByLibrary.simpleMessage("Home"),
6971
"justAMomentEllipsis" : MessageLookupByLibrary.simpleMessage("Just a moment..."),

lib/l10n/messages_messages.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class MessageLookup extends MessageLookupByLibrary {
6464
"followNotificationChannelExplainForX" : m3,
6565
"followNotificationChannels" : MessageLookupByLibrary.simpleMessage("Notification channels"),
6666
"followUnfollowXQuestion" : m4,
67+
"fontControlTooltip" : MessageLookupByLibrary.simpleMessage("Adjust font"),
68+
"fontScaleAdjust" : MessageLookupByLibrary.simpleMessage("Adjust font size"),
6769
"forums" : MessageLookupByLibrary.simpleMessage("Forums"),
6870
"home" : MessageLookupByLibrary.simpleMessage("Home"),
6971
"justAMomentEllipsis" : MessageLookupByLibrary.simpleMessage("Just a moment..."),

lib/l10n/messages_vi.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class MessageLookup extends MessageLookupByLibrary {
6464
"followNotificationChannelExplainForX" : m3,
6565
"followNotificationChannels" : MessageLookupByLibrary.simpleMessage("Kênh thông tin"),
6666
"followUnfollowXQuestion" : m4,
67+
"fontControlTooltip" : MessageLookupByLibrary.simpleMessage("Điều chỉnh hiển thị"),
68+
"fontScaleAdjust" : MessageLookupByLibrary.simpleMessage("Điều chỉnh cỡ chữ"),
6769
"forums" : MessageLookupByLibrary.simpleMessage("Diễn đàn"),
6870
"home" : MessageLookupByLibrary.simpleMessage("Trang chủ"),
6971
"justAMomentEllipsis" : MessageLookupByLibrary.simpleMessage("Chờ một xíu..."),

lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class MyApp extends StatelessWidget {
9292
GlobalWidgetsLocalizations.delegate,
9393
],
9494
navigatorKey: push_notification.primaryNavKey,
95-
navigatorObservers: [FontControlWidget.routeObserver],
9695
onGenerateTitle: (context) => l(context).appTitle,
9796
onGenerateInitialRoutes: (initialRoute) {
9897
if (initialRoute == '/') {

lib/src/constants.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ const kPrefKeyFontScale = 'fontScale';
55

66
const kSecureStorageKeyPrefixToken = 'token-';
77

8-
const kPostBodyPadding = 10.0;
8+
const kPadding = 10.0;
9+
const kPaddingThreeQuarters = kPadding * .75;
10+
const kPaddingHalf = kPadding * .5;
11+
12+
const kPostBodyPadding = kPadding;
13+
const kTagWidgetPadding = kPadding * .25;
914
const kThreadThumbnailWidth = 200.0;

lib/src/intl.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ class L10n {
6363
String followUnfollowXQuestion(String tag) => Intl.message('Unfollow $tag?',
6464
args: [tag], locale: localeName, name: 'followUnfollowXQuestion');
6565

66+
String get fontControlTooltip => Intl.message('Adjust font',
67+
locale: localeName, name: 'fontControlTooltip');
68+
69+
String get fontScaleAdjust => Intl.message('Adjust font size',
70+
locale: localeName, name: 'fontScaleAdjust');
71+
6672
String get forums => Intl.message('Forums',
6773
desc: 'Forum list appbar title', locale: localeName, name: 'forums');
6874

lib/src/screens/search/feature_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:the_api/feature_page.dart';
3+
import 'package:the_app/src/constants.dart';
34
import 'package:the_app/src/intl.dart';
45
import 'package:the_app/src/widgets/tag/widget.dart';
56

0 commit comments

Comments
 (0)