mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 13:14:32 +00:00
desktop settings menu pages
This commit is contained in:
parent
b0336ef162
commit
fe49125902
5 changed files with 87 additions and 20 deletions
|
@ -0,0 +1,30 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
class SettingsMenu extends ConsumerStatefulWidget {
|
||||||
|
const SettingsMenu({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const String routeName = "/settingsMenu";
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<ConsumerStatefulWidget> createState() => _SettingsMenuState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SettingsMenuState extends ConsumerState<SettingsMenu> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// // TODO: implement build
|
||||||
|
// throw UnimplementedError();
|
||||||
|
debugPrint("BUILD: $runtimeType");
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
decoration: BoxDecoration(color: Colors.teal),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
57
lib/pages_desktop_specific/home/settings_menu_item.dart
Normal file
57
lib/pages_desktop_specific/home/settings_menu_item.dart
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
|
||||||
|
class SettingsMenuItem<T> extends StatelessWidget {
|
||||||
|
const SettingsMenuItem({
|
||||||
|
Key? key,
|
||||||
|
required this.icon,
|
||||||
|
required this.label,
|
||||||
|
required this.value,
|
||||||
|
required this.group,
|
||||||
|
required this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final Widget icon;
|
||||||
|
final String label;
|
||||||
|
final T value;
|
||||||
|
final T group;
|
||||||
|
final void Function(T) onChanged;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextButton(
|
||||||
|
style: value == group
|
||||||
|
? Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.getDesktopMenuButtonColorSelected(context)
|
||||||
|
: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.getDesktopMenuButtonColor(context),
|
||||||
|
onPressed: () {
|
||||||
|
onChanged(value);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 16,
|
||||||
|
horizontal: 16,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
icon,
|
||||||
|
const SizedBox(
|
||||||
|
width: 12,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
label,
|
||||||
|
style: value == group //checks if option is selected
|
||||||
|
? STextStyles.desktopMenuItemSelected(context)
|
||||||
|
: STextStyles.desktopMenuItem(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +0,0 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
|
|
||||||
class SettingsView extends ConsumerStatefulWidget {
|
|
||||||
const SettingsView({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
static const String routeName = "/settingsView";
|
|
||||||
|
|
||||||
@override
|
|
||||||
ConsumerState<SettingsView> createState() => _SettingsView();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SettingsView extends ConsumerState<SettingsView> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
debugPrint("BUILD: $runtimeType");
|
|
||||||
// TODO: implement build
|
|
||||||
throw UnimplementedError();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue