Skip to content

Commit

Permalink
home - ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mocodesmo committed Mar 27, 2024
1 parent 8e6cace commit ebb0a1b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
22 changes: 18 additions & 4 deletions lib/_ui/components/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class BBButton extends StatelessWidget {
isBlue = null,
isRed = null,
statusText = null,
centered = null;
centered = null,
onSurface = null,
fontSize = null;

const BBButton.text({
required this.label,
Expand All @@ -44,6 +46,8 @@ class BBButton extends StatelessWidget {
this.isBlue = true,
this.centered = false,
this.buttonKey,
this.onSurface = false,
this.fontSize,
}) : type = _ButtonType.text,
filled = false,
statusText = null,
Expand All @@ -66,7 +70,9 @@ class BBButton extends StatelessWidget {
centered = null,
leftSvgAsset = null,
leftIcon = null,
fillWidth = true;
fillWidth = true,
onSurface = null,
fontSize = null;

const BBButton.textWithLeftArrow({
required this.label,
Expand All @@ -83,7 +89,9 @@ class BBButton extends StatelessWidget {
centered = null,
leftIcon = null,
leftSvgAsset = null,
fillWidth = true;
fillWidth = true,
onSurface = null,
fontSize = null;

const BBButton.textWithStatusAndRightArrow({
required this.label,
Expand All @@ -100,7 +108,9 @@ class BBButton extends StatelessWidget {
centered = null,
leftIcon = null,
leftSvgAsset = null,
fillWidth = true;
fillWidth = true,
onSurface = null,
fontSize = null;

final String label;
final String? statusText;
Expand All @@ -114,6 +124,8 @@ class BBButton extends StatelessWidget {
final IconData? leftIcon;
final String? leftSvgAsset;
final bool fillWidth;
final double? fontSize;
final bool? onSurface;

final bool loading;
final String? loadingText;
Expand Down Expand Up @@ -271,6 +283,8 @@ class BBButton extends StatelessWidget {
label,
isBlue: isBlue ?? false,
isRed: isRed ?? false,
fontSize: fontSize,
onSurface: onSurface ?? false,
),
if (centered ?? false) const Spacer(),
],
Expand Down
19 changes: 18 additions & 1 deletion lib/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:bb_mobile/_model/wallet.dart';
import 'package:bb_mobile/_pkg/consts/keys.dart';
import 'package:bb_mobile/_pkg/storage/hive.dart';
Expand Down Expand Up @@ -29,6 +31,7 @@ import 'package:bb_mobile/wallet/bloc/wallet_bloc.dart';
import 'package:bb_mobile/wallet/wallet_card.dart';
import 'package:extra_alignments/extra_alignments.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
Expand Down Expand Up @@ -76,7 +79,18 @@ class HomePage extends StatelessWidget {
final network = context.select((NetworkCubit x) => x.state.getBBNetwork());
final walletsFromNetwork =
context.select((HomeCubit x) => x.state.walletBlocsFromNetwork(network));
if (walletsFromNetwork.isEmpty) return const HomeNoWallets().animate().fadeIn();
if (walletsFromNetwork.isEmpty) {
scheduleMicrotask(() async {
await Future.delayed(100.ms);
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: context.colour.primary,
),
);
});

return const HomeNoWallets().animate().fadeIn();
}

return null;
}
Expand Down Expand Up @@ -876,6 +890,9 @@ class HomeNoWallets extends StatelessWidget {
BBButton.text(
label: 'Recovey wallet backup',
centered: true,
onSurface: true,
isBlue: false,
fontSize: 11,
onPressed: () {
context.push('/import');
},
Expand Down

0 comments on commit ebb0a1b

Please sign in to comment.