Skip to content

Commit 470920b

Browse files
committed
fix: new layout fit
1 parent d3385e3 commit 470920b

27 files changed

+308
-277
lines changed

lib/l10n/app_de.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"Kontakt bearbeiten",
118118
"delete_contact":"Bestätigen Sie das Löschen der Kontakte?",
119119
"contact_name_error":"Kontaktname unterstützt nur Buchstaben, Zahlen und Leerzeichen",
120-
"contact_tips":"Bitte beachten Sie, dass Kontakte nur lokal auf diesem Gerät gespeichert werden. Wenn Sie die App löschen, gehen Ihre Kontakte dauerhaft verloren und können nicht wiederhergestellt werden."
120+
"contact_tips":"Bitte beachten Sie, dass Kontakte nur lokal auf diesem Gerät gespeichert werden. Wenn Sie die App löschen, gehen Ihre Kontakte dauerhaft verloren und können nicht wiederhergestellt werden.",
121+
"no_contacts":"Keine Kontakte"
121122
}

lib/l10n/app_en.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"Edit Contact",
118118
"delete_contact":"Do you confirm to delete contacts?",
119119
"contact_name_error":"Contact name only supports letters, numbers, and spaces",
120-
"contact_tips":"Please note that contacts are only stored locally on this device. If you delete the app, your contacts will be permanently lost and cannot be recovered."
120+
"contact_tips":"Please note that contacts are only stored locally on this device. If you delete the app, your contacts will be permanently lost and cannot be recovered.",
121+
"no_contacts":"No contacts"
121122
}

lib/l10n/app_fr.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"Modifier le contact",
118118
"delete_contact":"Confirmez-vous la suppression des contacts ?",
119119
"contact_name_error":"Le nom de contact ne prend en charge que les lettres, les chiffres et les espaces",
120-
"contact_tips":"Veuillez noter que les contacts sont uniquement stockés localement sur cet appareil. Si vous supprimez l'application, vos contacts seront définitivement perdus et ne pourront pas être récupérés."
120+
"contact_tips":"Veuillez noter que les contacts sont uniquement stockés localement sur cet appareil. Si vous supprimez l'application, vos contacts seront définitivement perdus et ne pourront pas être récupérés.",
121+
"no_contacts":"Pas de contacts"
121122
}

lib/l10n/app_ja.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"連絡先を編集",
118118
"delete_contact":"連絡先を削除しますか?",
119119
"contact_name_error":"連絡先名は、英数字とスペースのみがサポートされています",
120-
"contact_tips":"連絡先はこのデバイスにのみ保存されます。アプリを削除すると、連絡先は永久に失われ、回復できません。"
120+
"contact_tips":"連絡先はこのデバイスにのみ保存されます。アプリを削除すると、連絡先は永久に失われ、回復できません。",
121+
"no_contacts":"連絡先がありません"
121122
}

lib/l10n/app_ru.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"Редактировать контакт",
118118
"delete_contact":"Вы подтверждаете удаление контактов?",
119119
"contact_name_error":"Имя контакта поддерживает только буквы, цифры и пробелы",
120-
"contact_tips":"Обратите внимание, что контакты хранятся только локально на этом устройстве. Если вы удалите приложение, ваши контакты будут навсегда потеряны и не могут быть восстановлены."
120+
"contact_tips":"Обратите внимание, что контакты хранятся только локально на этом устройстве. Если вы удалите приложение, ваши контакты будут навсегда потеряны и не могут быть восстановлены.",
121+
"no_contacts":"Нет контактов"
121122
}

lib/l10n/app_zh.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
"edit_contact":"编辑联系人",
118118
"delete_contact":"确认删除联系人吗?",
119119
"contact_name_error":"联系人名称仅支持字母、数字和空格",
120-
"contact_tips":"请注意,联系人仅存储在本地设备上。如果您删除应用程序,您的联系人将永久丢失,无法找回。"
120+
"contact_tips":"请注意,联系人仅存储在本地设备上。如果您删除应用程序,您的联系人将永久丢失,无法找回。",
121+
"no_contacts":"没有联系人"
121122
}

lib/page/common/add_contacts_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ class _AddContactsPage extends State<AddContactsPage> {
236236
Container(
237237
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
238238
child: Column(
239+
crossAxisAlignment: CrossAxisAlignment.stretch,
239240
children: [
240241
Button(
241242
text: AppLocalizations.of(context).continueText,

lib/page/common/back_up_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class BackUpPage extends StatelessWidget {
2727
@override
2828
Widget build(BuildContext context) {
2929
ScreenHelper.initScreen(context);
30-
double screenWidth = ScreenHelper.screenWidth;
3130
double bottomPadding = ScreenHelper.bottomPadding;
3231
BackUpPageRouteParams args = BackUpPageRouteParams('', 0);
3332
List<MnemonicItem> mnemonicItemList = [];
@@ -104,10 +103,11 @@ class BackUpPage extends StatelessWidget {
104103
Container(
105104
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
106105
child: Column(
106+
mainAxisSize: MainAxisSize.min,
107+
crossAxisAlignment: CrossAxisAlignment.stretch,
107108
children: [
108109
Button(
109110
text: AppLocalizations.of(context).next,
110-
width: screenWidth - 30,
111111
bgColor: DarkColors.mainColor,
112112
onPressed: () => Navigator.pushNamed(context, '/back_up_test', arguments: BackUpTestPageRouteParams(args.data)),
113113
),

lib/page/common/back_up_test_page.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class BackUpStartPage extends StatelessWidget {
2020

2121
@override
2222
Widget build(BuildContext context) {
23-
double screenWidth = ScreenHelper.screenWidth;
2423
double bottomPadding = ScreenHelper.bottomPadding;
2524
WalletModal walletModal = Provider.of<WalletModal>(context);
2625
Wallet wallet = walletModal.getWallet();
@@ -58,10 +57,11 @@ class BackUpStartPage extends StatelessWidget {
5857
Container(
5958
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
6059
child: Column(
60+
mainAxisSize: MainAxisSize.min,
61+
crossAxisAlignment: CrossAxisAlignment.stretch,
6162
children: [
6263
Button(
6364
text: AppLocalizations.of(context).start,
64-
width: screenWidth - 30,
6565
bgColor: DarkColors.mainColor,
6666
onPressed: () async {
6767
await showModalBottomSheet(
@@ -298,10 +298,11 @@ class _BackUpTestPageState extends State<BackUpTestPage> {
298298
return Container(
299299
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
300300
child: Column(
301+
mainAxisSize: MainAxisSize.min,
302+
crossAxisAlignment: CrossAxisAlignment.stretch,
301303
children: [
302304
Button(
303305
text: AppLocalizations.of(context).continueText,
304-
width: ScreenHelper.screenWidth - 30,
305306
bgColor: isButtonEnable ? DarkColors.mainColor : DarkColors.lineColor54,
306307
textColor: Colors.white,
307308
disable: !isButtonEnable,
@@ -345,13 +346,17 @@ class _BackUpTestPageState extends State<BackUpTestPage> {
345346
],
346347
),
347348
actions: <Widget>[
348-
Button(
349-
text: AppLocalizations.of(context).continueText,
350-
width: ScreenHelper.screenWidth - 60,
351-
bgColor: DarkColors.mainColor,
352-
onPressed: () => Navigator.pop(context, true),
353-
),
354-
const SizedBox(height: 20),
349+
Column(
350+
crossAxisAlignment: CrossAxisAlignment.stretch,
351+
children: [
352+
Button(
353+
text: AppLocalizations.of(context).continueText,
354+
width: ScreenHelper.screenWidth - 60,
355+
bgColor: DarkColors.mainColor,
356+
onPressed: () => Navigator.pop(context, true),
357+
)
358+
],
359+
)
355360
],
356361
);
357362
},

lib/page/common/change_name_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class _ChangeNamePageState extends State<ChangeNamePage> {
6565
Container(
6666
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
6767
child: Column(
68+
crossAxisAlignment: CrossAxisAlignment.stretch,
6869
children: [
6970
Button(
7071
text: AppLocalizations.of(context).continueText,

lib/page/common/create_wallet_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,11 @@ class _CreateWalletPageState extends State<CreateWalletPage> {
331331
return Container(
332332
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
333333
child: Column(
334+
mainAxisSize: MainAxisSize.min,
335+
crossAxisAlignment: CrossAxisAlignment.stretch,
334336
children: [
335337
Button(
336338
text: AppLocalizations.of(context).continueText,
337-
width: ScreenHelper.screenWidth - 30,
338339
bgColor: isButtonEnable ? DarkColors.mainColor : DarkColors.lineColor54,
339340
textColor: Colors.white,
340341
disable: !isButtonEnable,

lib/page/common/face_id_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class FaceIDPage extends StatelessWidget {
6969
color: DarkColors.bgColor,
7070
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 0),
7171
child: Column(
72+
mainAxisSize: MainAxisSize.min,
73+
crossAxisAlignment: CrossAxisAlignment.stretch,
7274
children: [
7375
const SizedBox(height: 20),
7476
Text(AppLocalizations.of(context).create_faceid_tips, style: descStyle),
@@ -88,7 +90,6 @@ class FaceIDPage extends StatelessWidget {
8890
margin: EdgeInsets.fromLTRB(0, 25, 0, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
8991
child: Button(
9092
text: AppLocalizations.of(context).skip_for_now,
91-
width: ScreenHelper.screenWidth - 30,
9293
bgColor: DarkColors.lineColor,
9394
textColor: Colors.white,
9495
onPressed: () => toCreatePage(context, args),

lib/page/common/langs_select.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class NetWorkSelectPage extends StatelessWidget {
7171
Widget build(BuildContext context) {
7272
double screenHeight = ScreenHelper.screenHeight;
7373
double bottomPadding = ScreenHelper.bottomPadding;
74-
ConfigModal config = Provider.of<ConfigModal>(context);
74+
// ConfigModal config = Provider.of<ConfigModal>(context);
7575
//List<String> netWorks = ConfigModal.netWorks;
7676
List<String> netWorks = ["TestNet"];
7777
double height = 60 + (bottomPadding > 0 ? bottomPadding : 20) + 70 * netWorks.length + 10;

lib/page/common/legal_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class _LegalBottomState extends State<LegalBottom> {
9595
@override
9696
Widget build(BuildContext context) {
9797
return Column(
98+
crossAxisAlignment: CrossAxisAlignment.stretch,
9899
children: [
99100
MyRadioButton(
100101
title: AppLocalizations.of(context).accepted_Privacy_Policy,

lib/page/common/secure_wallet_page.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class SecureWalletPage extends StatelessWidget {
99
@override
1010
Widget build(BuildContext context) {
1111
ScreenHelper.initScreen(context);
12-
double screenWidth = ScreenHelper.screenWidth;
1312
var bottomPadding = ScreenHelper.bottomPadding;
1413
const titleStyle = TextStyle(
1514
decoration: TextDecoration.none,
@@ -58,12 +57,12 @@ class SecureWalletPage extends StatelessWidget {
5857
Container(
5958
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
6059
child: Column(
61-
children: [
62-
Button(text: "Start", width: screenWidth - 30, bgColor: DarkColors.mainColor),
63-
const SizedBox(
64-
height: 20,
65-
),
66-
Button(text: "Remind Me Later", width: screenWidth - 30, bgColor: DarkColors.lineColor),
60+
mainAxisSize: MainAxisSize.min,
61+
crossAxisAlignment: CrossAxisAlignment.stretch,
62+
children: const [
63+
Button(text: "Start", bgColor: DarkColors.mainColor),
64+
SizedBox(height: 20),
65+
Button(text: "Remind Me Later", bgColor: DarkColors.lineColor),
6766
],
6867
),
6968
)

lib/page/detail/contacts_page.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ContactsStatePage extends State<ContactsPage> {
180180
),
181181
Expanded(
182182
child: ListView.builder(
183-
itemCount: contacts.contactsList.length + 1,
183+
itemCount: contacts.contactsList.isEmpty ? 2 : contacts.contactsList.length + 1,
184184
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
185185
itemBuilder: (BuildContext buildContext, int index) {
186186
if (index == 0) {
@@ -196,6 +196,13 @@ class ContactsStatePage extends State<ContactsPage> {
196196
],
197197
);
198198
} else {
199+
if (contacts.contactsList.isEmpty) {
200+
return Column(children: [
201+
const SizedBox(height: 20),
202+
const Icon(Icons.crop_landscape, size: 70, color: Colors.white),
203+
Text(AppLocalizations.of(context).no_contacts, style: const TextStyle(color: Colors.white, fontSize: 14)),
204+
]);
205+
}
199206
int pos = index - 1;
200207
ContactsItem item = contacts.contactsList[pos];
201208
return CupertinoButton(
@@ -247,6 +254,7 @@ class ContactsStatePage extends State<ContactsPage> {
247254
Container(
248255
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
249256
child: Column(
257+
crossAxisAlignment: CrossAxisAlignment.stretch,
250258
children: [
251259
Button(
252260
text: AppLocalizations.of(context).continueText,

lib/page/detail/receive_page.dart

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,18 @@ class ReceivePage extends StatelessWidget {
1717
Widget build(BuildContext context) {
1818
WalletModal walletModal = Provider.of<WalletModal>(context);
1919
Wallet wallet = walletModal.getWallet();
20-
double screenWidth = ScreenHelper.screenWidth;
21-
double screenHeight = ScreenHelper.screenHeight;
22-
double topPadding = ScreenHelper.topPadding;
20+
ScreenHelper.initScreen(context);
2321
double marginH = 20;
2422
double paddingH = 15;
25-
double width = screenHeight < 700 ? 280 : screenWidth - marginH * 2;
26-
double w = width - paddingH * 2;
2723
TextStyle titleStyle = const TextStyle(color: Colors.white, fontSize: 16, fontFamily: "RobotoMono", fontWeight: FontWeight.w400);
2824
TextStyle addressStyle = const TextStyle(color: Colors.white54, fontSize: 16, fontFamily: "RobotoMono", fontWeight: FontWeight.w700);
2925

30-
Widget icon = (screenHeight - topPadding - 40) - (330 + width) < 0 ? const SizedBox() : Column(children: [const SizedBox(height: 20), Image.asset("images/logo.png", width: 50, height: 50)]);
3126
return ModalFrame(
3227
title: '${AppLocalizations.of(context).receive} XDAG',
33-
// height: 327 + width,
3428
child: Column(
3529
crossAxisAlignment: CrossAxisAlignment.center,
3630
children: [
3731
ContentBox(
38-
width: width,
3932
marginH: marginH,
4033
child: Padding(
4134
padding: const EdgeInsets.all(15.0),
@@ -44,20 +37,24 @@ class ReceivePage extends StatelessWidget {
4437
children: [
4538
Text(AppLocalizations.of(context).show_QR, style: titleStyle),
4639
const SizedBox(height: 15),
47-
Container(
48-
width: w,
49-
height: w,
50-
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
51-
child: QrImage(data: wallet.address, version: QrVersions.auto),
40+
Center(
41+
child: Container(
42+
width: 250,
43+
height: 250,
44+
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
45+
child: Center(
46+
child: QrImage(data: wallet.address, version: QrVersions.auto),
47+
),
48+
),
5249
),
5350
],
5451
),
5552
),
5653
),
5754
ContentBox(
58-
width: width,
5955
marginH: marginH,
6056
child: Column(
57+
crossAxisAlignment: CrossAxisAlignment.start,
6158
children: [
6259
Padding(
6360
padding: EdgeInsets.fromLTRB(paddingH, 15, paddingH, 15),
@@ -70,9 +67,8 @@ class ReceivePage extends StatelessWidget {
7067
],
7168
),
7269
),
73-
Container(width: width, height: 1, color: DarkColors.bgColor),
70+
Container(height: 1, color: DarkColors.bgColor),
7471
SizedBox(
75-
width: width,
7672
height: 50,
7773
child: Row(
7874
children: [
@@ -98,22 +94,20 @@ class ReceivePage extends StatelessWidget {
9894
],
9995
),
10096
),
101-
icon
97+
Column(children: [const SizedBox(height: 20), Image.asset("images/logo.png", width: 50, height: 50)])
10298
],
10399
));
104100
}
105101
}
106102

107103
class ContentBox extends StatelessWidget {
108-
final double width;
109104
final double marginH;
110105
final Widget child;
111-
const ContentBox({super.key, required this.width, required this.marginH, required this.child});
106+
const ContentBox({super.key, required this.marginH, required this.child});
112107

113108
@override
114109
Widget build(BuildContext context) {
115110
return Container(
116-
width: width,
117111
margin: EdgeInsets.fromLTRB(marginH, 20, marginH, 0),
118112
decoration: BoxDecoration(
119113
color: DarkColors.blockColor,

lib/page/detail/send_page.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ class _SendPageState extends State<SendPage> {
132132
Widget build(BuildContext context) {
133133
WalletModal walletModal = Provider.of<WalletModal>(context);
134134
Wallet wallet = walletModal.getWallet();
135-
// 检测 amount 是一个有效的数字
136-
137135
bool isButtonEnable = false;
138136
try {
139137
var a = double.parse(amount.isEmpty ? '0' : amount);
@@ -327,6 +325,7 @@ class _SendPageState extends State<SendPage> {
327325
Container(
328326
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
329327
child: Column(
328+
crossAxisAlignment: CrossAxisAlignment.stretch,
330329
children: [
331330
Button(
332331
text: AppLocalizations.of(context).continueText,

0 commit comments

Comments
 (0)