From f56ac6c8dc0c125b7ef2768be927fd0640e48a4a Mon Sep 17 00:00:00 2001 From: Aldrin Zigmund Cortez Velasco Date: Mon, 2 Oct 2023 13:33:08 +0800 Subject: [PATCH] minor security and ui improvements --- android/app/build.gradle | 4 +- lib/pages/homepage.dart | 4 +- .../setup pages/restoremnemonicpage.dart | 6 ++ lib/pages/transactionpages/sendpage.dart | 9 +- .../transactionconfirmationpage.dart | 92 +++---------------- pubspec.yaml | 2 +- 6 files changed, 33 insertions(+), 84 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 90489ed..9bc29fb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -53,8 +53,8 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 23 targetSdkVersion 33 - versionCode 7 - versionName "0.8.0" + versionCode 8 + versionName "0.8.1" } signingConfigs { diff --git a/lib/pages/homepage.dart b/lib/pages/homepage.dart index f48d142..ee40f27 100644 --- a/lib/pages/homepage.dart +++ b/lib/pages/homepage.dart @@ -202,7 +202,7 @@ class _HomePageState extends State { wallet.transactions[index].confirmationTime?.height); if (wallet.transactions[index].sent == 0) { int finalFee = - format.getFee(wallet.transactions[index]?.fee); + format.getFee(wallet.transactions[index].fee); return GestureDetector( onTap: () => showTransactionInfo(index, blockHeight, finalFee), @@ -242,7 +242,7 @@ class _HomePageState extends State { ); } else { int finalFee = - format.getFee(wallet.transactions[index]?.fee); + format.getFee(wallet.transactions[index].fee); return GestureDetector( onTap: () => showTransactionInfo(index, blockHeight, finalFee), diff --git a/lib/pages/setup pages/restoremnemonicpage.dart b/lib/pages/setup pages/restoremnemonicpage.dart index f592cff..f56105b 100644 --- a/lib/pages/setup pages/restoremnemonicpage.dart +++ b/lib/pages/setup pages/restoremnemonicpage.dart @@ -86,6 +86,12 @@ class _RestoreMnemonicPageState extends State { )); } + @override + void dispose() { + _mnemonic.dispose(); + super.dispose(); + } + @override void initState() { super.initState(); diff --git a/lib/pages/transactionpages/sendpage.dart b/lib/pages/transactionpages/sendpage.dart index 3be0d14..69680cb 100644 --- a/lib/pages/transactionpages/sendpage.dart +++ b/lib/pages/transactionpages/sendpage.dart @@ -38,7 +38,7 @@ class _SendPage extends State { ]; scanQRCode() async { - var result; + ScanResult result; try { result = await BarcodeScanner.scan(); _scannedQRAddress = result.rawContent; @@ -119,6 +119,13 @@ class _SendPage extends State { )); } + @override + void dispose() { + _sendAmount.dispose(); + _destinationAddress.dispose(); + super.dispose(); + } + @override void initState() { super.initState(); diff --git a/lib/pages/transactionpages/transactionconfirmationpage.dart b/lib/pages/transactionpages/transactionconfirmationpage.dart index db00a84..eeb73c2 100644 --- a/lib/pages/transactionpages/transactionconfirmationpage.dart +++ b/lib/pages/transactionpages/transactionconfirmationpage.dart @@ -75,87 +75,23 @@ class TransactionConfirmationPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const Padding( - padding: EdgeInsets.all(18.0), - child: Text( - 'Transaction Fee', - style: TextStyle(fontSize: 19.9), - textAlign: TextAlign.center, - ), - ), - Padding( - padding: const EdgeInsets.all(9.0), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.black, width: 1), - borderRadius: BorderRadius.circular(9.0), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(9.0, 18.0, 9.0, 18.0), - child: Text( - fee, - style: const TextStyle( - fontSize: 19.9, - wordSpacing: 2.0, - ), - textAlign: TextAlign.center, - ), - ), - ), - ), - const Padding( - padding: EdgeInsets.all(18.0), - child: Text( - 'Amount To Send', - style: TextStyle(fontSize: 19.9), - textAlign: TextAlign.center, - ), - ), - Padding( - padding: const EdgeInsets.all(9.0), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.black, width: 1), - borderRadius: BorderRadius.circular(9.0), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(9.0, 18.0, 9.0, 18.0), - child: Text( - '$amount sats', - style: const TextStyle( - fontSize: 19.9, - wordSpacing: 2.0, - ), - textAlign: TextAlign.center, - ), - ), - ), - ), - const Padding( - padding: EdgeInsets.all(18.0), - child: Text( - 'Receiving Address', - style: TextStyle(fontSize: 19.9), - textAlign: TextAlign.center, - ), - ), Padding( padding: const EdgeInsets.all(9.0), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.black, width: 1), - borderRadius: BorderRadius.circular(9.0), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(9.0, 18.0, 9.0, 18.0), - child: Text( - address, - style: const TextStyle(fontSize: 19.9), - textAlign: TextAlign.center, - ), - ), + child: Card( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Padding(padding: EdgeInsets.all(9.0), child: Text('Transaction Fee', style: TextStyle(fontSize: 21.0, fontWeight: FontWeight.bold))), + Padding(padding: const EdgeInsets.all(9.0), child: Text(fee, style: const TextStyle(fontSize: 21.0))), + const SizedBox(height: 18.0,), + const Padding(padding: EdgeInsets.all(9.0), child: Text('Amount to Send', style: TextStyle(fontSize: 21.0, fontWeight: FontWeight.bold))), + Padding(padding: const EdgeInsets.all(9.0), child: Text('$amount sats', style: const TextStyle(fontSize: 21.0))), + const SizedBox(height: 18.0,), + const Padding(padding: EdgeInsets.all(9.0), child: Text('Destination Address', style: TextStyle(fontSize: 21.0, fontWeight: FontWeight.bold))), + Padding(padding: const EdgeInsets.all(9.0), child: Text(address, style: const TextStyle(fontSize: 21.0))), + ]), ), - ), + ) ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index be88a73..899c187 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: thirdbank description: A free and open-source experimental non-custodial Bitcoin wallet that focuses on simplicity and ease of use. publish_to: 'none' -version: 0.8.0 +version: 0.8.1 environment: sdk: '>=3.1.0 <4.0.0'