Set up default currency accounts automatically (#72)
This commit is contained in:
1 parent
62df9eac5f
commit
5c255296d3
21 files changed
+675
-62
No files matched your search
@@ -65,15 +65,34 @@ class AccountsPage extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 28),
|
||||
if (p.loading) const LinearProgressIndicator(),
|
||||
if (p.failed)
|
||||
if ((p.loading || (!p.failed && p.data == null)) &&
|
||||
accounts.isEmpty)
|
||||
Semantics(liveRegion: true, child: Text(l.wAccountsLoading)),
|
||||
if (p.failed && accounts.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Text(l.wUnavailable, style: TextStyle(color: c.error)),
|
||||
),
|
||||
if (!p.loading && accounts.isEmpty) Text(l.wEmptyAccounts),
|
||||
if (!p.loading &&
|
||||
accounts.isEmpty &&
|
||||
(p.failed || p.data != null)) ...[
|
||||
Semantics(
|
||||
liveRegion: true,
|
||||
child: Text(p.failed ? l.wAccountsFailed : l.wEmptyAccounts),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: TextButton(
|
||||
onPressed: p.refresh,
|
||||
child: Text(l.wAccountsRetry),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (accountId != null &&
|
||||
p.account(accountId) == null &&
|
||||
!p.loading)
|
||||
!p.loading &&
|
||||
!p.failed &&
|
||||
p.data != null)
|
||||
Text(l.wNotFound),
|
||||
if (selected != null) ...[
|
||||
const SizedBox(height: 24),
|
||||
|
||||
@@ -256,11 +256,23 @@ class TransferPageState extends State<TransferPage> {
|
||||
),
|
||||
] else ...[
|
||||
if (accounts.isEmpty) ...[
|
||||
Text(wallet.loading ? l.wWorking : l.wEmptyAccounts),
|
||||
TextButton(
|
||||
onPressed: wallet.loading ? null : wallet.refresh,
|
||||
child: Text(l.wRefresh),
|
||||
Semantics(
|
||||
liveRegion: true,
|
||||
child: Text(
|
||||
wallet.loading ||
|
||||
(!wallet.failed && wallet.data == null)
|
||||
? l.wAccountsLoading
|
||||
: wallet.failed
|
||||
? l.wAccountsFailed
|
||||
: l.wEmptyAccounts,
|
||||
),
|
||||
),
|
||||
if (!wallet.loading &&
|
||||
(wallet.failed || wallet.data != null))
|
||||
TextButton(
|
||||
onPressed: wallet.refresh,
|
||||
child: Text(l.wAccountsRetry),
|
||||
),
|
||||
] else ...[
|
||||
DropdownButtonFormField<String>(
|
||||
key: ValueKey('source-${p.source}'),
|
||||
|
||||
Reference in new issue
Block a user