WIP: Add settings page #46
2 changed files with 52 additions and 15 deletions
make settings page a dialog
This will need changes to work properly on mobile
commit
a916013800
|
|
@ -1,25 +1,61 @@
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
|
import "package:navigation_rail_m3e/navigation_rail_m3e.dart";
|
||||||
|
|
||||||
class SettingsPage extends ConsumerWidget {
|
class SettingsPage extends ConsumerWidget {
|
||||||
const SettingsPage({super.key});
|
const SettingsPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) => Scaffold(
|
Widget build(BuildContext context, WidgetRef ref) => Dialog(
|
||||||
appBar: AppBar(
|
constraints: .loose(Size(900, 600)),
|
||||||
title: Text("Settings"),
|
child: ClipRRect(
|
||||||
actionsPadding: .symmetric(horizontal: 12),
|
borderRadius: BorderRadiusGeometry.circular(12),
|
||||||
actions: [
|
child: Scaffold(
|
||||||
SearchAnchor(
|
appBar: AppBar(
|
||||||
builder: (context, controller) => IconButton(
|
title: Text("Settings"),
|
||||||
icon: const Icon(Icons.search),
|
actionsPadding: .symmetric(horizontal: 12),
|
||||||
onPressed: controller.openView,
|
actions: [
|
||||||
),
|
SearchAnchor(
|
||||||
suggestionsBuilder: (context, controller) {
|
builder: (_, controller) => IconButton(
|
||||||
return [];
|
icon: const Icon(Icons.search),
|
||||||
},
|
onPressed: controller.openView,
|
||||||
|
),
|
||||||
|
suggestionsBuilder: (context, controller) {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
body: Padding(
|
||||||
|
padding: .symmetric(vertical: 8),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: .symmetric(vertical: 4),
|
||||||
|
child: NavigationRailM3E(
|
||||||
|
type: .alwaysExpand,
|
||||||
|
sections: [
|
||||||
|
.new(
|
||||||
|
destinations: [
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
.new(icon: Icon(Icons.abc), label: "Account"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
selectedIndex: 0,
|
||||||
|
onDestinationSelected: (value) {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
VerticalDivider(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -182,8 +182,9 @@ class Sidebar extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: "Open settings",
|
tooltip: "Open settings",
|
||||||
onPressed: () => Navigator.of(context).push(
|
onPressed: () => showDialog(
|
||||||
MaterialPageRoute(builder: (_) => SettingsPage()),
|
context: context,
|
||||||
|
builder: (_) => SettingsPage(),
|
||||||
),
|
),
|
||||||
icon: Icon(Icons.settings),
|
icon: Icon(Icons.settings),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue