2022-09-15 21:38:30 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
2022-11-09 23:23:53 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/address_book_view/desktop_address_book.dart';
|
2022-09-15 21:38:30 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/desktop_menu.dart';
|
2022-10-17 16:50:37 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/desktop_settings_view.dart';
|
2022-09-16 16:23:42 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/my_stack_view.dart';
|
2022-11-07 17:42:55 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/support_and_about_view/desktop_about_view.dart';
|
2022-11-07 15:15:44 +00:00
|
|
|
import 'package:stackwallet/pages_desktop_specific/home/support_and_about_view/desktop_support_view.dart';
|
2022-09-26 18:42:37 +00:00
|
|
|
import 'package:stackwallet/route_generator.dart';
|
2022-09-22 23:48:50 +00:00
|
|
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
2022-09-15 21:38:30 +00:00
|
|
|
|
|
|
|
class DesktopHomeView extends ConsumerStatefulWidget {
|
|
|
|
const DesktopHomeView({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
static const String routeName = "/desktopHome";
|
|
|
|
|
|
|
|
@override
|
|
|
|
ConsumerState<DesktopHomeView> createState() => _DesktopHomeViewState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _DesktopHomeViewState extends ConsumerState<DesktopHomeView> {
|
2022-09-16 17:26:12 +00:00
|
|
|
int currentViewIndex = 0;
|
|
|
|
final List<Widget> contentViews = [
|
2022-09-26 18:42:37 +00:00
|
|
|
const Navigator(
|
2022-10-13 17:55:04 +00:00
|
|
|
key: Key("desktopStackHomeKey"),
|
2022-09-26 18:42:37 +00:00
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: MyStackView.routeName,
|
2022-09-18 16:14:27 +00:00
|
|
|
),
|
2022-09-16 17:26:12 +00:00
|
|
|
Container(
|
|
|
|
color: Colors.green,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
2022-11-09 15:57:41 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("desktopAddressBookHomeKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: DesktopAddressBook.routeName,
|
2022-09-16 17:26:12 +00:00
|
|
|
),
|
2022-10-05 17:41:41 +00:00
|
|
|
const Navigator(
|
2022-10-13 17:55:04 +00:00
|
|
|
key: Key("desktopSettingHomeKey"),
|
2022-10-05 17:41:41 +00:00
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
2022-10-17 16:50:37 +00:00
|
|
|
initialRoute: DesktopSettingsView.routeName,
|
2022-09-16 17:26:12 +00:00
|
|
|
),
|
2022-11-07 15:15:44 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("desktopSupportHomeKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: DesktopSupportView.routeName,
|
2022-09-16 17:26:12 +00:00
|
|
|
),
|
2022-11-07 17:42:55 +00:00
|
|
|
const Navigator(
|
|
|
|
key: Key("desktopAboutHomeKey"),
|
|
|
|
onGenerateRoute: RouteGenerator.generateRoute,
|
|
|
|
initialRoute: DesktopAboutView.routeName,
|
2022-09-16 17:26:12 +00:00
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|
void onMenuSelectionChanged(int newIndex) {
|
|
|
|
setState(() {
|
|
|
|
currentViewIndex = newIndex;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-09-15 21:38:30 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Material(
|
2022-09-22 23:48:50 +00:00
|
|
|
color: Theme.of(context).extension<StackColors>()!.background,
|
2022-09-15 21:38:30 +00:00
|
|
|
child: Row(
|
|
|
|
children: [
|
2022-09-16 17:26:12 +00:00
|
|
|
DesktopMenu(
|
|
|
|
onSelectionChanged: onMenuSelectionChanged,
|
|
|
|
),
|
2022-10-13 19:10:24 +00:00
|
|
|
Container(
|
|
|
|
width: 1,
|
|
|
|
color: Theme.of(context).extension<StackColors>()!.background,
|
|
|
|
),
|
2022-09-16 23:54:46 +00:00
|
|
|
Expanded(
|
|
|
|
child: contentViews[currentViewIndex],
|
|
|
|
),
|
2022-09-15 21:38:30 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|