diff --git a/lib/models/history.dart b/lib/models/history.dart index a82a4b4..aeed895 100644 --- a/lib/models/history.dart +++ b/lib/models/history.dart @@ -7,9 +7,11 @@ import 'package:sentry/sentry.dart' as sentry; import 'package:qrscan/qrscan.dart' as scanner; import 'dart:math'; import 'package:intl/intl.dart'; +import 'package:truncate/truncate.dart'; class HistoryProvider with ChangeNotifier { String pubkey = ''; + String pubkeyShort = ''; HistoryProvider(this.pubkey); final TextEditingController outputPubkey = TextEditingController(); List transBC; @@ -54,6 +56,10 @@ class HistoryProvider with ChangeNotifier { print("C'est une pubkey !!!"); this.pubkey = pubkey; + pubkeyShort = truncate(pubkey, 5, + omission: ":", position: TruncatePosition.end) + + truncate(pubkey, 4, omission: "", position: TruncatePosition.start) + + ':aaa'; this.outputPubkey.text = pubkey; notifyListeners(); diff --git a/lib/screens/history.dart b/lib/screens/history.dart index 1297086..7ebd6d8 100644 --- a/lib/screens/history.dart +++ b/lib/screens/history.dart @@ -193,10 +193,11 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier { '/default_avatar.png'), height: 65); })), - if (_isFirstExec) - Text(balance.toString() + ' Ğ1', - textAlign: TextAlign.center, - style: TextStyle(fontSize: 30.0)), + Text(_historyProvider.pubkeyShort, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.w800, + fontFamily: 'Monospace')), Container( padding: const EdgeInsets.fromLTRB( 30, 0, 15, 0), // .only(right: 15), @@ -212,7 +213,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier { iconSize: 30, color: Color(0xFFB16E16))) ]), - SizedBox(height: 10), + SizedBox(height: 15), if (_isFirstExec) Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -225,9 +226,15 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier { .getName(_historyProvider.pubkey), initialData: '', builder: (context, snapshot) { - return Text(snapshot.data); + return Text(snapshot.data, + style: TextStyle(fontSize: 16)); })) ]), + SizedBox(height: 15), + if (_isFirstExec) + Text(balance.toString() + ' Ğ1', + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0)), SizedBox(height: 20), const Divider( color: Colors.grey,