scrollable limited favorites wrapping and fixed navigation on My Stack view

This commit is contained in:
julian 2022-09-26 12:42:37 -06:00
parent 3ce4519cc7
commit 79b5cf819a
3 changed files with 28 additions and 23 deletions

View file

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages_desktop_specific/home/desktop_menu.dart';
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/my_stack_view.dart';
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class DesktopHomeView extends ConsumerStatefulWidget {
@ -16,12 +17,9 @@ class DesktopHomeView extends ConsumerStatefulWidget {
class _DesktopHomeViewState extends ConsumerState<DesktopHomeView> {
int currentViewIndex = 0;
final List<Widget> contentViews = [
// const Navigator(
// onGenerateRoute: RouteGenerator.generateRoute,
// initialRoute: MyStackView.routeName,
// ),
const MyStackView(
key: Key("myStackViewKey"),
const Navigator(
onGenerateRoute: RouteGenerator.generateRoute,
initialRoute: MyStackView.routeName,
),
Container(
color: Colors.green,

View file

@ -56,23 +56,27 @@ class DesktopFavoriteWallets extends ConsumerWidget {
minHeight: cardHeight,
),
child: hasFavorites
? Wrap(
spacing: 16,
children: [
...favorites.map((p0) {
final walletId = ref.refresh(p0).walletId;
final managerProvider = ref
.read(walletsChangeNotifierProvider)
.getManagerProvider(walletId);
? SingleChildScrollView(
primary: false,
child: Wrap(
spacing: 16,
runSpacing: 16,
children: [
...favorites.map((p0) {
final walletId = ref.read(p0).walletId;
final managerProvider = ref
.read(walletsChangeNotifierProvider)
.getManagerProvider(walletId);
return FavoriteCard(
walletId: walletId,
width: cardWidth,
height: cardHeight,
managerProvider: managerProvider,
);
})
],
return FavoriteCard(
walletId: walletId,
width: cardWidth,
height: cardHeight,
managerProvider: managerProvider,
);
})
],
),
)
: Container(
height: cardHeight,

View file

@ -41,7 +41,10 @@ class _MyWalletsState extends ConsumerState<MyWallets> {
BlueTextButton(
text: "Add new wallet",
onTap: () {
Navigator.of(context).pushNamed(AddWalletView.routeName);
Navigator.of(
context,
rootNavigator: true,
).pushNamed(AddWalletView.routeName);
},
),
],