Skip to content

Commit

Permalink
fix: favorites page text spacing bug (#167)
Browse files Browse the repository at this point in the history
* fix: favorites page text spacing bug
  • Loading branch information
MiaoMint authored Jan 9, 2024
1 parent a741f6d commit 68bfcd7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"continue-watching": "Continue",
"favorite": "Favorite",
"no-record": "No favorites or viewing records",
"watched": "Watched {ep}"
"watched": "Watched {ep}",
"favorite-all": "All {type} favourites"
},
"search": {
"hint-text": "Please use search wisely!~",
Expand Down
3 changes: 2 additions & 1 deletion assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"continue-watching": "继续观看",
"favorite": "收藏",
"no-record": "暂无收藏和观看记录",
"watched": "看到 {ep}"
"watched": "看到 {ep}",
"favorite-all": "所有{type}收藏"
},
"search": {
"hint-text": "请善用搜索哦!~",
Expand Down
23 changes: 19 additions & 4 deletions lib/views/pages/favorites_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:fluent_ui/fluent_ui.dart' as fluent;
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:miru_app/models/index.dart';
import 'package:miru_app/data/services/database_service.dart';
import 'package:miru_app/utils/extension.dart';
Expand All @@ -20,9 +21,16 @@ class _FavoritesPageState extends fluent.State<FavoritesPage> {
Widget _buildAndroid(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
"${ExtensionUtils.typeToString(widget.type)}${"home.favorite".i18n}",
)),
title: Text(
FlutterI18n.translate(
context,
"home.favorite-all",
translationParams: {
"type": ExtensionUtils.typeToString(widget.type).toLowerCase(),
},
),
),
),
body: FutureBuilder(
future: DatabaseService.getFavoritesByType(type: widget.type),
builder: ((context, snapshot) {
Expand Down Expand Up @@ -84,7 +92,14 @@ class _FavoritesPageState extends fluent.State<FavoritesPage> {
Expanded(
flex: 2,
child: Text(
"${ExtensionUtils.typeToString(widget.type)}${"home.favorite".i18n}",
FlutterI18n.translate(
context,
"home.favorite-all",
translationParams: {
"type": ExtensionUtils.typeToString(widget.type)
.toLowerCase(),
},
),
style: fluent.FluentTheme.of(context).typography.subtitle,
),
),
Expand Down

0 comments on commit 68bfcd7

Please sign in to comment.