From 8b218d45d46148380e2134ff9d9f85fc90ea333b Mon Sep 17 00:00:00 2001 From: Jean-Matthieu DECHRISTE Date: Thu, 25 Aug 2022 14:25:15 +0200 Subject: [PATCH] Fix some UI issues --- .../lib/config/payment_gateways.dart | 9 ++++--- .../lib/resources/pages/account_detail.dart | 26 ++++++------------- .../pages/account_profile_update.dart | 4 +-- .../lib/resources/pages/home_search.dart | 17 +++++------- .../account_detail_settings_widget.dart | 2 +- .../widgets/customer_address_input.dart | 18 ++++++++----- 6 files changed, 33 insertions(+), 43 deletions(-) diff --git a/LabelStoreMax/lib/config/payment_gateways.dart b/LabelStoreMax/lib/config/payment_gateways.dart index 5d168b0..28b3f68 100644 --- a/LabelStoreMax/lib/config/payment_gateways.dart +++ b/LabelStoreMax/lib/config/payment_gateways.dart @@ -4,6 +4,7 @@ import 'package:flutter_app/app/providers/paypal_pay.dart'; import 'package:flutter_app/app/providers/razorpay_pay.dart'; import 'package:flutter_app/app/providers/stripe_pay.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; +import 'package:nylo_framework/nylo_framework.dart'; /* |-------------------------------------------------------------------------- @@ -22,7 +23,7 @@ List paymentTypeList = [ addPayment( id: 1, name: "Stripe", - desc: "Debit or Credit Card", + desc: trans("Debit or Credit Card"), assetImage: "dark_powered_by_stripe.png", pay: stripePay, ), @@ -30,7 +31,7 @@ List paymentTypeList = [ addPayment( id: 2, name: "CashOnDelivery", - desc: "Cash on delivery", + desc: trans("Cash on delivery"), assetImage: "cash_on_delivery.jpeg", pay: cashOnDeliveryPay, ), @@ -38,7 +39,7 @@ List paymentTypeList = [ addPayment( id: 4, name: "PayPal", - desc: "Debit or Credit Card", + desc: trans("Debit or Credit Card"), assetImage: "paypal_logo.png", pay: payPalPay, ), @@ -46,7 +47,7 @@ List paymentTypeList = [ addPayment( id: 5, name: "RazorPay", - desc: "Debit or Credit Card", + desc: trans("Debit or Credit Card"), assetImage: "razorpay.png", pay: razorPay, ), diff --git a/LabelStoreMax/lib/resources/pages/account_detail.dart b/LabelStoreMax/lib/resources/pages/account_detail.dart index 48f659c..243b4e2 100644 --- a/LabelStoreMax/lib/resources/pages/account_detail.dart +++ b/LabelStoreMax/lib/resources/pages/account_detail.dart @@ -158,25 +158,15 @@ class _AccountDetailPageState extends State crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceAround, - children: [ - Text( - [userFirstName, userLastName] - .where( - (t) => (t != null || t != "")) - .toList() - .join(" "), - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - ), + Flexible( + child: Text( + [userFirstName, userLastName].where((t) => (t != null || t != "")).toList().join(" "), + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, ), - ], - ) + ), + ), ], ), padding: EdgeInsets.only(left: 16), diff --git a/LabelStoreMax/lib/resources/pages/account_profile_update.dart b/LabelStoreMax/lib/resources/pages/account_profile_update.dart index ccbee42..ecfa5ac 100644 --- a/LabelStoreMax/lib/resources/pages/account_profile_update.dart +++ b/LabelStoreMax/lib/resources/pages/account_profile_update.dart @@ -62,7 +62,7 @@ class _AccountProfileUpdatePageState extends State { return Scaffold( appBar: AppBar( title: Text( - trans("Update Details"), + trans("Update details"), style: TextStyle( fontSize: 20, ), @@ -108,7 +108,7 @@ class _AccountProfileUpdatePageState extends State { padding: EdgeInsets.only(top: 10), ), PrimaryButton( - title: trans("Update details"), + title: trans("Update Details"), isLoading: isLoading, action: _updateDetails, ) diff --git a/LabelStoreMax/lib/resources/pages/home_search.dart b/LabelStoreMax/lib/resources/pages/home_search.dart index 87ad030..5a527f7 100644 --- a/LabelStoreMax/lib/resources/pages/home_search.dart +++ b/LabelStoreMax/lib/resources/pages/home_search.dart @@ -56,11 +56,8 @@ class _HomeSearchPageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: Icon(Icons.search, size: 36), - margin: EdgeInsets.only(bottom: 20), - ), TextField( + decoration: InputDecoration(prefixIcon: Icon(Icons.search)), controller: _txtSearchController, style: Theme.of(context).textTheme.headline3, keyboardType: TextInputType.text, @@ -68,13 +65,11 @@ class _HomeSearchPageState extends State { autofocus: true, textCapitalization: TextCapitalization.sentences, ), - Padding( - padding: const EdgeInsets.only(top: 10), - child: PrimaryButton( - title: trans("Search"), - action: _actionSearch, - ), - ) + const SizedBox(height: 10), + PrimaryButton( + title: trans("Search"), + action: _actionSearch, + ), ], ), ), diff --git a/LabelStoreMax/lib/resources/widgets/account_detail_settings_widget.dart b/LabelStoreMax/lib/resources/widgets/account_detail_settings_widget.dart index f84e2f0..e33fe21 100644 --- a/LabelStoreMax/lib/resources/widgets/account_detail_settings_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/account_detail_settings_widget.dart @@ -49,7 +49,7 @@ class AccountDetailSettingsWidget extends StatelessWidget { Card( child: ListTile( leading: Icon(Icons.no_accounts_rounded), - title: Text("Delete Account"), + title: Text(trans("Delete Account")), onTap: () => Navigator.pushNamed(context, "/account-delete"), ), diff --git a/LabelStoreMax/lib/resources/widgets/customer_address_input.dart b/LabelStoreMax/lib/resources/widgets/customer_address_input.dart index e938200..aa86ac5 100644 --- a/LabelStoreMax/lib/resources/widgets/customer_address_input.dart +++ b/LabelStoreMax/lib/resources/widgets/customer_address_input.dart @@ -71,12 +71,6 @@ class CustomerAddressInput extends StatelessWidget { controller: txtControllerAddressLine, ), ), - Flexible( - child: TextEditingRow( - heading: trans("City"), - controller: txtControllerCity, - ), - ), ], ), Row( @@ -87,6 +81,16 @@ class CustomerAddressInput extends StatelessWidget { controller: txtControllerPostalCode, ), ), + Flexible( + child: TextEditingRow( + heading: trans("City"), + controller: txtControllerCity, + ), + ), + ], + ), + Row( + children: [ Flexible( child: TextEditingRow( heading: trans("Email address"), @@ -100,7 +104,7 @@ class CustomerAddressInput extends StatelessWidget { children: [ Flexible( child: TextEditingRow( - heading: "Phone Number", + heading: trans("Phone Number"), controller: txtControllerPhoneNumber, keyboardType: TextInputType.phone, ),