new BalanceBuilder Widget
This commit is contained in:
parent
0ab955b2da
commit
9983ea9f78
|
@ -238,18 +238,23 @@ class WalletsHome extends StatelessWidget {
|
||||||
|
|
||||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
int nTule = 2;
|
int nTule;
|
||||||
|
|
||||||
if (screenWidth >= 900) {
|
if (screenWidth >= 900) {
|
||||||
nTule = 4;
|
nTule = 4;
|
||||||
} else if (screenWidth >= 650) {
|
} else if (screenWidth >= 650) {
|
||||||
nTule = 3;
|
nTule = 3;
|
||||||
|
} else {
|
||||||
|
nTule = 2;
|
||||||
}
|
}
|
||||||
// Offset followDragAnchorStrategy(
|
// Offset followDragAnchorStrategy(
|
||||||
// Draggable<Object> d, BuildContext context, Offset point) {
|
// Draggable<Object> d, BuildContext context, Offset point) {
|
||||||
// return Offset(d.feedbackOffset.dx - 30, d.feedbackOffset.dy - 0);
|
// return Offset(d.feedbackOffset.dx - 30, d.feedbackOffset.dy - 0);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
showTutorial();
|
||||||
|
// Future.delayed(const Duration(seconds: 1), showTutorial);
|
||||||
|
|
||||||
return CustomScrollView(slivers: <Widget>[
|
return CustomScrollView(slivers: <Widget>[
|
||||||
const SliverToBoxAdapter(child: SizedBox(height: 20)),
|
const SliverToBoxAdapter(child: SizedBox(height: 20)),
|
||||||
SliverGrid.count(
|
SliverGrid.count(
|
||||||
|
@ -375,10 +380,9 @@ class WalletsHome extends StatelessWidget {
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Stack(children: <Widget>[
|
Stack(children: <Widget>[
|
||||||
balanceBuilder(
|
BalanceBuilder(
|
||||||
context,
|
address: repository.address,
|
||||||
repository.address,
|
isDefault: repository.address ==
|
||||||
repository.address ==
|
|
||||||
defaultWallet.address),
|
defaultWallet.address),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -434,29 +438,6 @@ class WalletsHome extends StatelessWidget {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget balanceBuilder(context, String address, bool isDefault) {
|
|
||||||
return Container(
|
|
||||||
width: double.infinity,
|
|
||||||
color: isDefault ? orangeC : yellowC,
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.only(left: 5, right: 5, top: 38, bottom: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Opacity(
|
|
||||||
opacity: 0.7,
|
|
||||||
child: Balance(
|
|
||||||
address: address,
|
|
||||||
size: 16,
|
|
||||||
color: isDefault ? Colors.white : Colors.black,
|
|
||||||
loadingColor: isDefault ? yellowC : orangeC),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget addNewDerivation(context) {
|
Widget addNewDerivation(context) {
|
||||||
final myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
final myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
||||||
|
|
||||||
|
@ -518,6 +499,41 @@ class WalletsHome extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class BalanceBuilder extends StatelessWidget {
|
||||||
|
const BalanceBuilder({
|
||||||
|
Key? key,
|
||||||
|
required this.address,
|
||||||
|
required this.isDefault,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final String address;
|
||||||
|
final bool isDefault;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
color: isDefault ? orangeC : yellowC,
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(left: 5, right: 5, top: 38, bottom: 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Opacity(
|
||||||
|
opacity: 0.7,
|
||||||
|
child: Balance(
|
||||||
|
address: address,
|
||||||
|
size: 16,
|
||||||
|
color: isDefault ? Colors.white : Colors.black,
|
||||||
|
loadingColor: isDefault ? yellowC : orangeC),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class CustomClipperOval extends CustomClipper<Rect> {
|
class CustomClipperOval extends CustomClipper<Rect> {
|
||||||
@override
|
@override
|
||||||
Rect getClip(Size size) {
|
Rect getClip(Size size) {
|
||||||
|
|
Loading…
Reference in New Issue