mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
load buy data when clicking buy crypto item in desktop menu
This commit is contained in:
parent
8e8816fe05
commit
dad7329a30
1 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/desktop_menu_item.dart';
|
import 'package:stackwallet/pages_desktop_specific/desktop_menu_item.dart';
|
||||||
import 'package:stackwallet/providers/desktop/current_desktop_menu_item.dart';
|
import 'package:stackwallet/providers/desktop/current_desktop_menu_item.dart';
|
||||||
|
import 'package:stackwallet/services/buy/buy_data_loading_service.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
@ -43,6 +44,8 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
|
||||||
|
|
||||||
double _width = expandedWidth;
|
double _width = expandedWidth;
|
||||||
|
|
||||||
|
final _buyDataLoadingService = BuyDataLoadingService();
|
||||||
|
|
||||||
void updateSelectedMenuItem(DesktopMenuItemId idKey) {
|
void updateSelectedMenuItem(DesktopMenuItemId idKey) {
|
||||||
widget.onSelectionWillChange?.call(idKey);
|
widget.onSelectionWillChange?.call(idKey);
|
||||||
|
|
||||||
|
@ -164,7 +167,9 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
|
||||||
icon: const DesktopBuyIcon(),
|
icon: const DesktopBuyIcon(),
|
||||||
label: "Buy crypto",
|
label: "Buy crypto",
|
||||||
value: DesktopMenuItemId.buy,
|
value: DesktopMenuItemId.buy,
|
||||||
onChanged: updateSelectedMenuItem,
|
onChanged: (_) {
|
||||||
|
_buyDataLoadingService.loadAll(ref);
|
||||||
|
},
|
||||||
controller: controllers[2],
|
controller: controllers[2],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|
Loading…
Reference in a new issue