make settings page a dialog

This will need changes to work properly on mobile
This commit is contained in:
Henry Hiles 2026-06-23 19:11:26 -04:00
commit a916013800
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 52 additions and 15 deletions

View file

@ -1,17 +1,22 @@
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(
constraints: .loose(Size(900, 600)),
child: ClipRRect(
borderRadius: BorderRadiusGeometry.circular(12),
child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text("Settings"), title: Text("Settings"),
actionsPadding: .symmetric(horizontal: 12), actionsPadding: .symmetric(horizontal: 12),
actions: [ actions: [
SearchAnchor( SearchAnchor(
builder: (context, controller) => IconButton( builder: (_, controller) => IconButton(
icon: const Icon(Icons.search), icon: const Icon(Icons.search),
onPressed: controller.openView, onPressed: controller.openView,
), ),
@ -21,5 +26,36 @@ class SettingsPage extends ConsumerWidget {
), ),
], ],
), ),
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(),
],
),
),
),
),
); );
} }

View file

@ -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),
), ),