Skip to content

Commit

Permalink
fix: new layout fit
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingCoding committed Apr 11, 2023
1 parent d3385e3 commit 470920b
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 277 deletions.
3 changes: 2 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"Kontakt bearbeiten",
"delete_contact":"Bestätigen Sie das Löschen der Kontakte?",
"contact_name_error":"Kontaktname unterstützt nur Buchstaben, Zahlen und Leerzeichen",
"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."
"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.",
"no_contacts":"Keine Kontakte"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"Edit Contact",
"delete_contact":"Do you confirm to delete contacts?",
"contact_name_error":"Contact name only supports letters, numbers, and spaces",
"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."
"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.",
"no_contacts":"No contacts"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"Modifier le contact",
"delete_contact":"Confirmez-vous la suppression des contacts ?",
"contact_name_error":"Le nom de contact ne prend en charge que les lettres, les chiffres et les espaces",
"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."
"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.",
"no_contacts":"Pas de contacts"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"連絡先を編集",
"delete_contact":"連絡先を削除しますか?",
"contact_name_error":"連絡先名は、英数字とスペースのみがサポートされています",
"contact_tips":"連絡先はこのデバイスにのみ保存されます。アプリを削除すると、連絡先は永久に失われ、回復できません。"
"contact_tips":"連絡先はこのデバイスにのみ保存されます。アプリを削除すると、連絡先は永久に失われ、回復できません。",
"no_contacts":"連絡先がありません"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"Редактировать контакт",
"delete_contact":"Вы подтверждаете удаление контактов?",
"contact_name_error":"Имя контакта поддерживает только буквы, цифры и пробелы",
"contact_tips":"Обратите внимание, что контакты хранятся только локально на этом устройстве. Если вы удалите приложение, ваши контакты будут навсегда потеряны и не могут быть восстановлены."
"contact_tips":"Обратите внимание, что контакты хранятся только локально на этом устройстве. Если вы удалите приложение, ваши контакты будут навсегда потеряны и не могут быть восстановлены.",
"no_contacts":"Нет контактов"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"edit_contact":"编辑联系人",
"delete_contact":"确认删除联系人吗?",
"contact_name_error":"联系人名称仅支持字母、数字和空格",
"contact_tips":"请注意,联系人仅存储在本地设备上。如果您删除应用程序,您的联系人将永久丢失,无法找回。"
"contact_tips":"请注意,联系人仅存储在本地设备上。如果您删除应用程序,您的联系人将永久丢失,无法找回。",
"no_contacts":"没有联系人"
}
1 change: 1 addition & 0 deletions lib/page/common/add_contacts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class _AddContactsPage extends State<AddContactsPage> {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
Expand Down
4 changes: 2 additions & 2 deletions lib/page/common/back_up_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class BackUpPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ScreenHelper.initScreen(context);
double screenWidth = ScreenHelper.screenWidth;
double bottomPadding = ScreenHelper.bottomPadding;
BackUpPageRouteParams args = BackUpPageRouteParams('', 0);
List<MnemonicItem> mnemonicItemList = [];
Expand Down Expand Up @@ -104,10 +103,11 @@ class BackUpPage extends StatelessWidget {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).next,
width: screenWidth - 30,
bgColor: DarkColors.mainColor,
onPressed: () => Navigator.pushNamed(context, '/back_up_test', arguments: BackUpTestPageRouteParams(args.data)),
),
Expand Down
25 changes: 15 additions & 10 deletions lib/page/common/back_up_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class BackUpStartPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
double screenWidth = ScreenHelper.screenWidth;
double bottomPadding = ScreenHelper.bottomPadding;
WalletModal walletModal = Provider.of<WalletModal>(context);
Wallet wallet = walletModal.getWallet();
Expand Down Expand Up @@ -58,10 +57,11 @@ class BackUpStartPage extends StatelessWidget {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).start,
width: screenWidth - 30,
bgColor: DarkColors.mainColor,
onPressed: () async {
await showModalBottomSheet(
Expand Down Expand Up @@ -298,10 +298,11 @@ class _BackUpTestPageState extends State<BackUpTestPage> {
return Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
width: ScreenHelper.screenWidth - 30,
bgColor: isButtonEnable ? DarkColors.mainColor : DarkColors.lineColor54,
textColor: Colors.white,
disable: !isButtonEnable,
Expand Down Expand Up @@ -345,13 +346,17 @@ class _BackUpTestPageState extends State<BackUpTestPage> {
],
),
actions: <Widget>[
Button(
text: AppLocalizations.of(context).continueText,
width: ScreenHelper.screenWidth - 60,
bgColor: DarkColors.mainColor,
onPressed: () => Navigator.pop(context, true),
),
const SizedBox(height: 20),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
width: ScreenHelper.screenWidth - 60,
bgColor: DarkColors.mainColor,
onPressed: () => Navigator.pop(context, true),
)
],
)
],
);
},
Expand Down
1 change: 1 addition & 0 deletions lib/page/common/change_name_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class _ChangeNamePageState extends State<ChangeNamePage> {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
Expand Down
3 changes: 2 additions & 1 deletion lib/page/common/create_wallet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,11 @@ class _CreateWalletPageState extends State<CreateWalletPage> {
return Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
width: ScreenHelper.screenWidth - 30,
bgColor: isButtonEnable ? DarkColors.mainColor : DarkColors.lineColor54,
textColor: Colors.white,
disable: !isButtonEnable,
Expand Down
3 changes: 2 additions & 1 deletion lib/page/common/face_id_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class FaceIDPage extends StatelessWidget {
color: DarkColors.bgColor,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 20),
Text(AppLocalizations.of(context).create_faceid_tips, style: descStyle),
Expand All @@ -88,7 +90,6 @@ class FaceIDPage extends StatelessWidget {
margin: EdgeInsets.fromLTRB(0, 25, 0, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Button(
text: AppLocalizations.of(context).skip_for_now,
width: ScreenHelper.screenWidth - 30,
bgColor: DarkColors.lineColor,
textColor: Colors.white,
onPressed: () => toCreatePage(context, args),
Expand Down
2 changes: 1 addition & 1 deletion lib/page/common/langs_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class NetWorkSelectPage extends StatelessWidget {
Widget build(BuildContext context) {
double screenHeight = ScreenHelper.screenHeight;
double bottomPadding = ScreenHelper.bottomPadding;
ConfigModal config = Provider.of<ConfigModal>(context);
// ConfigModal config = Provider.of<ConfigModal>(context);
//List<String> netWorks = ConfigModal.netWorks;
List<String> netWorks = ["TestNet"];
double height = 60 + (bottomPadding > 0 ? bottomPadding : 20) + 70 * netWorks.length + 10;
Expand Down
1 change: 1 addition & 0 deletions lib/page/common/legal_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class _LegalBottomState extends State<LegalBottom> {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
MyRadioButton(
title: AppLocalizations.of(context).accepted_Privacy_Policy,
Expand Down
13 changes: 6 additions & 7 deletions lib/page/common/secure_wallet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class SecureWalletPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ScreenHelper.initScreen(context);
double screenWidth = ScreenHelper.screenWidth;
var bottomPadding = ScreenHelper.bottomPadding;
const titleStyle = TextStyle(
decoration: TextDecoration.none,
Expand Down Expand Up @@ -58,12 +57,12 @@ class SecureWalletPage extends StatelessWidget {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, bottomPadding > 0 ? bottomPadding : 20),
child: Column(
children: [
Button(text: "Start", width: screenWidth - 30, bgColor: DarkColors.mainColor),
const SizedBox(
height: 20,
),
Button(text: "Remind Me Later", width: screenWidth - 30, bgColor: DarkColors.lineColor),
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: const [
Button(text: "Start", bgColor: DarkColors.mainColor),
SizedBox(height: 20),
Button(text: "Remind Me Later", bgColor: DarkColors.lineColor),
],
),
)
Expand Down
10 changes: 9 additions & 1 deletion lib/page/detail/contacts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class ContactsStatePage extends State<ContactsPage> {
),
Expanded(
child: ListView.builder(
itemCount: contacts.contactsList.length + 1,
itemCount: contacts.contactsList.isEmpty ? 2 : contacts.contactsList.length + 1,
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
itemBuilder: (BuildContext buildContext, int index) {
if (index == 0) {
Expand All @@ -196,6 +196,13 @@ class ContactsStatePage extends State<ContactsPage> {
],
);
} else {
if (contacts.contactsList.isEmpty) {
return Column(children: [
const SizedBox(height: 20),
const Icon(Icons.crop_landscape, size: 70, color: Colors.white),
Text(AppLocalizations.of(context).no_contacts, style: const TextStyle(color: Colors.white, fontSize: 14)),
]);
}
int pos = index - 1;
ContactsItem item = contacts.contactsList[pos];
return CupertinoButton(
Expand Down Expand Up @@ -247,6 +254,7 @@ class ContactsStatePage extends State<ContactsPage> {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
Expand Down
34 changes: 14 additions & 20 deletions lib/page/detail/receive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,18 @@ class ReceivePage extends StatelessWidget {
Widget build(BuildContext context) {
WalletModal walletModal = Provider.of<WalletModal>(context);
Wallet wallet = walletModal.getWallet();
double screenWidth = ScreenHelper.screenWidth;
double screenHeight = ScreenHelper.screenHeight;
double topPadding = ScreenHelper.topPadding;
ScreenHelper.initScreen(context);
double marginH = 20;
double paddingH = 15;
double width = screenHeight < 700 ? 280 : screenWidth - marginH * 2;
double w = width - paddingH * 2;
TextStyle titleStyle = const TextStyle(color: Colors.white, fontSize: 16, fontFamily: "RobotoMono", fontWeight: FontWeight.w400);
TextStyle addressStyle = const TextStyle(color: Colors.white54, fontSize: 16, fontFamily: "RobotoMono", fontWeight: FontWeight.w700);

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)]);
return ModalFrame(
title: '${AppLocalizations.of(context).receive} XDAG',
// height: 327 + width,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ContentBox(
width: width,
marginH: marginH,
child: Padding(
padding: const EdgeInsets.all(15.0),
Expand All @@ -44,20 +37,24 @@ class ReceivePage extends StatelessWidget {
children: [
Text(AppLocalizations.of(context).show_QR, style: titleStyle),
const SizedBox(height: 15),
Container(
width: w,
height: w,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: QrImage(data: wallet.address, version: QrVersions.auto),
Center(
child: Container(
width: 250,
height: 250,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Center(
child: QrImage(data: wallet.address, version: QrVersions.auto),
),
),
),
],
),
),
),
ContentBox(
width: width,
marginH: marginH,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.fromLTRB(paddingH, 15, paddingH, 15),
Expand All @@ -70,9 +67,8 @@ class ReceivePage extends StatelessWidget {
],
),
),
Container(width: width, height: 1, color: DarkColors.bgColor),
Container(height: 1, color: DarkColors.bgColor),
SizedBox(
width: width,
height: 50,
child: Row(
children: [
Expand All @@ -98,22 +94,20 @@ class ReceivePage extends StatelessWidget {
],
),
),
icon
Column(children: [const SizedBox(height: 20), Image.asset("images/logo.png", width: 50, height: 50)])
],
));
}
}

class ContentBox extends StatelessWidget {
final double width;
final double marginH;
final Widget child;
const ContentBox({super.key, required this.width, required this.marginH, required this.child});
const ContentBox({super.key, required this.marginH, required this.child});

@override
Widget build(BuildContext context) {
return Container(
width: width,
margin: EdgeInsets.fromLTRB(marginH, 20, marginH, 0),
decoration: BoxDecoration(
color: DarkColors.blockColor,
Expand Down
3 changes: 1 addition & 2 deletions lib/page/detail/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ class _SendPageState extends State<SendPage> {
Widget build(BuildContext context) {
WalletModal walletModal = Provider.of<WalletModal>(context);
Wallet wallet = walletModal.getWallet();
// 检测 amount 是一个有效的数字

bool isButtonEnable = false;
try {
var a = double.parse(amount.isEmpty ? '0' : amount);
Expand Down Expand Up @@ -327,6 +325,7 @@ class _SendPageState extends State<SendPage> {
Container(
margin: EdgeInsets.fromLTRB(15, 20, 15, ScreenHelper.bottomPadding > 0 ? ScreenHelper.bottomPadding : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Button(
text: AppLocalizations.of(context).continueText,
Expand Down
Loading

0 comments on commit 470920b

Please sign in to comment.