Skip to content

Commit

Permalink
fix: make ui compatible with big font size
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Sep 16, 2024
1 parent 984e2cc commit 64f7a6b
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 93 deletions.
12 changes: 8 additions & 4 deletions lib/screen/account/recovery_phrase_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class _RecoveryPhrasePageState extends State<RecoveryPhrasePage> {
borderRadius: BorderRadius.circular(5),
),
child: RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
children: <TextSpan>[
TextSpan(
Expand Down Expand Up @@ -243,7 +244,8 @@ class _RecoveryPhrasePageState extends State<RecoveryPhrasePage> {

Widget _getBackUpState(BuildContext context) {
final theme = Theme.of(context);
final customLinkStyle = theme.textTheme.ppMori400Black14.copyWith(
final commonStyle = theme.textTheme.ppMori400Black14;
final customLinkStyle = commonStyle.copyWith(
decoration: TextDecoration.underline,
decorationColor: AppColor.primaryBlack,
);
Expand All @@ -255,19 +257,20 @@ class _RecoveryPhrasePageState extends State<RecoveryPhrasePage> {
children: [
Text(
'SRP_is_crucial'.tr(),
style: theme.textTheme.ppMori400Black14,
style: commonStyle,
),
const SizedBox(height: 12),
Text(
'as_a_non_custodial_wallet'.tr(),
style: theme.textTheme.ppMori400Black14,
style: commonStyle,
),
const SizedBox(height: 12),
Text('remember_if_you_lose_your_SRP'.tr(),
style: theme.textTheme.ppMori700Black14),
const SizedBox(height: 12),
if (_isBackUpAvailable == true) ...[
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.ppMori400Black14,
children: <TextSpan>[
Expand Down Expand Up @@ -308,9 +311,10 @@ class _RecoveryPhrasePageState extends State<RecoveryPhrasePage> {
),
] else ...[
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.ppMori400Black14,
children: <TextSpan>[
children: [
if (Platform.isIOS)
TextSpan(
text: 'icloud_keychain'.tr(),
Expand Down
42 changes: 22 additions & 20 deletions lib/screen/bug_bounty_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,30 @@ class BugBountyPage extends StatelessWidget {
Text('Scope'.tr(), style: theme.textTheme.ppMori700Black24),
const SizedBox(height: 32),
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.ppMori400Black16,
children: <TextSpan>[
TextSpan(
text: 'only_accept_new_bug'.tr(),
),
TextSpan(
recognizer: TapGestureRecognizer()
..onTap = () => unawaited(launchUrl(
Uri.parse(KNOWN_BUGS_LINK),
mode: LaunchMode.externalApplication,
)),
text: 'known_bugs'.tr(),
style: ResponsiveLayout.isMobile
? theme.textTheme.linkStyle16.copyWith(
fontWeight: FontWeight.normal,
fontFamily: AppTheme.ppMori)
: theme.textTheme.linkStyle16,
),
TextSpan(
text: 'not_reward_yet'.tr(),
),
])),
TextSpan(
text: 'only_accept_new_bug'.tr(),
),
TextSpan(
recognizer: TapGestureRecognizer()
..onTap = () => unawaited(launchUrl(
Uri.parse(KNOWN_BUGS_LINK),
mode: LaunchMode.externalApplication,
)),
text: 'known_bugs'.tr(),
style: ResponsiveLayout.isMobile
? theme.textTheme.linkStyle16.copyWith(
fontWeight: FontWeight.normal,
fontFamily: AppTheme.ppMori)
: theme.textTheme.linkStyle16,
),
TextSpan(
text: 'not_reward_yet'.tr(),
),
])),
const SizedBox(height: 32),
Text('rewards'.tr(), style: theme.textTheme.ppMori700Black24),
const SizedBox(height: 32),
Expand Down Expand Up @@ -121,6 +122,7 @@ class BugBountyPage extends StatelessWidget {
),
Expanded(
child: RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.ppMori400Black14,
children: <TextSpan>[
Expand Down
1 change: 1 addition & 0 deletions lib/screen/connection/connection_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class ConnectionDetailsPage extends StatelessWidget {
),
const SizedBox(height: 40),
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.primaryTextTheme.ppMori400White14,
children: <TextSpan>[
Expand Down
2 changes: 1 addition & 1 deletion lib/screen/feralfile_home/artwork_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class _SeriesViewState extends State<SeriesView> {
if (series.exhibition != null) ...[
const SizedBox(height: 12),
RichText(
overflow: TextOverflow.ellipsis,
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: defaultStyle.copyWith(color: AppColor.auQuickSilver),
children: [
Expand Down
2 changes: 2 additions & 0 deletions lib/screen/feralfile_home/list_exhibition_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class _ListExhibitionViewState extends State<ListExhibitionView> {
if (exhibition.isSoloExhibition &&
exhibition.artists != null) ...[
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: subTitleStyle.copyWith(
decorationColor: AppColor.disabledColor),
Expand All @@ -332,6 +333,7 @@ class _ListExhibitionViewState extends State<ListExhibitionView> {
],
if (exhibition.curator != null)
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: subTitleStyle.copyWith(
decorationColor: AppColor.disabledColor),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class _PostcardLeaderboardViewState extends State<PostcardLeaderboardView> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.moMASans400Black12
.copyWith(fontSize: 18),
Expand Down
1 change: 1 addition & 0 deletions lib/screen/interactive_postcard/postcard_explain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class _PostcardExplainState extends State<PostcardExplain> {
),
const SizedBox(height: 40),
Text.rich(
textScaler: MediaQuery.textScalerOf(context),
TextSpan(
style: termsConditionsStyle,
children: <TextSpan>[
Expand Down
81 changes: 45 additions & 36 deletions lib/screen/new_onboarding_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,48 +87,56 @@ class _NewOnboardingPageState extends State<NewOnboardingPage> {
bool subDescFixedSized = true,
}) {
final theme = Theme.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 59,
),
Text(
title,
style: theme.textTheme.ppMori700Black36.copyWith(
color: AppColor.white,
),
),
Container(
height: 30,
),
Text(
desc,
style: theme.textTheme.ppMori700White18.copyWith(
fontWeight: FontWeight.w400,
),
),
],
final commonHeader = Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 59,
),
),
if (subDescFixedSized) ...[
const Spacer(),
Text(
title,
style: theme.textTheme.ppMori700Black36.copyWith(
color: AppColor.white,
),
),
Container(
height: 30,
),
Text(
desc,
style: theme.textTheme.ppMori700White18.copyWith(
fontWeight: FontWeight.w400,
),
),
],
),
);
if (subDescFixedSized) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: SingleChildScrollView(child: commonHeader)),
SizedBox(
height: 514,
child: subDesc,
)
] else ...[
Expanded(
child: subDesc,
)
],
],
);
);
} else {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
commonHeader,
const SizedBox(height: 30),
subDesc,
const SizedBox(height: 40),
],
),
);
}
}

Widget _onboardingItemVideo(BuildContext context,
Expand Down Expand Up @@ -200,6 +208,7 @@ class _NewOnboardingPageState extends State<NewOnboardingPage> {
context,
title: 'membership'.tr(),
desc: 'membership_desc'.tr(),
subDescFixedSized: false,
subDesc: Column(
children: [
if (!isSubscribed)
Expand Down
1 change: 1 addition & 0 deletions lib/screen/onboarding/import_address/import_seeds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class _ImportSeedsPageState extends State<ImportSeedsPage> {
),
const SizedBox(height: 20),
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
children: <TextSpan>[
TextSpan(
Expand Down
1 change: 1 addition & 0 deletions lib/screen/playlists/edit_playlist/edit_playlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class _EditPlaylistScreenState extends State<EditPlaylistScreen> {
tr('remove_from_list'),
'',
descriptionWidget: RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
children: [
TextSpan(
Expand Down
68 changes: 38 additions & 30 deletions lib/screen/scan_qr/scan_qr_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,12 @@ class QRScanViewState extends State<QRScanView>
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 44),
child: SplittedBanner(
headerWidget: _instructionHeader(context),
bodyWidget:
_instructionBody(context, widget.scannerItem.instructions)));
child: SingleChildScrollView(
child: SplittedBanner(
headerWidget: _instructionHeader(context),
bodyWidget:
_instructionBody(context, widget.scannerItem.instructions)),
));
}

Widget _instructionHeader(BuildContext context) {
Expand All @@ -508,20 +510,23 @@ class QRScanViewState extends State<QRScanView>
'assets/images/icon_scan.svg',
),
const SizedBox(width: 20),
RichText(
text: TextSpan(
text: 'scan_qr_code'.tr(),
children: [
TextSpan(
text: ' ',
style: theme.textTheme.ppMori400Grey14,
),
TextSpan(
text: 'in_order_to'.tr(),
style: theme.textTheme.ppMori400Grey14,
),
],
style: theme.textTheme.ppMori400White14,
Expanded(
child: RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
text: 'scan_qr_code'.tr(),
children: [
TextSpan(
text: ' ',
style: theme.textTheme.ppMori400Grey14,
),
TextSpan(
text: 'in_order_to'.tr(),
style: theme.textTheme.ppMori400Grey14,
),
],
style: theme.textTheme.ppMori400White14,
),
),
),
],
Expand All @@ -539,18 +544,20 @@ class QRScanViewState extends State<QRScanView>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
instruction.name,
style: theme.textTheme.ppMori700White14,
),
Text(
instruction.detail,
style: theme.textTheme.ppMori400Grey14,
)
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
instruction.name,
style: theme.textTheme.ppMori700White14,
),
Text(
instruction.detail,
style: theme.textTheme.ppMori400Grey14,
)
],
),
),
instruction.icon ?? const SizedBox(),
],
Expand Down Expand Up @@ -591,6 +598,7 @@ class QRScanViewState extends State<QRScanView>
injector<DeeplinkService>().handleDeeplink(
code,
delay: const Duration(seconds: 1),
// ignore: avoid_annotating_with_dynamic
onFinished: (dynamic object) {
if (mounted) {
setState(() {
Expand Down
1 change: 1 addition & 0 deletions lib/screen/settings/connection/accounts_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ class _AccountsViewState extends State<AccountsView> {
),
const SizedBox(height: 40),
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.primaryTextTheme.ppMori400White14,
children: <TextSpan>[
Expand Down
2 changes: 2 additions & 0 deletions lib/screen/settings/crypto/send/send_crypto_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ class _SendCryptoPageState extends State<SendCryptoPage> {
if (state.maxAllow != null) ...[
GestureDetector(
child: RichText(
textScaler:
MediaQuery.textScalerOf(context),
text: TextSpan(children: [
TextSpan(
text: 'max'.tr(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ class _SendArtworkPageState extends State<SendArtworkPage> {
),
const SizedBox(height: 8),
RichText(
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
style: theme.textTheme.ppMori400White14,
children: [
Expand Down
Loading

0 comments on commit 64f7a6b

Please sign in to comment.