WIP: Add settings page #46
1 changed files with 29 additions and 7 deletions
add categoriesArePages variable
commit
ab051c75f5
|
|
@ -1,16 +1,17 @@
|
||||||
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";
|
import "package:navigation_rail_m3e/navigation_rail_m3e.dart";
|
||||||
|
import "package:super_sliver_list/super_sliver_list.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) => Dialog(
|
Widget build(BuildContext context, WidgetRef ref) => LayoutBuilder(
|
||||||
constraints: .loose(Size(900, 600)),
|
builder: (context, constraints) {
|
||||||
child: ClipRRect(
|
final categoriesArePages = constraints.maxWidth < 550;
|
||||||
borderRadius: BorderRadiusGeometry.circular(12),
|
|
||||||
child: Scaffold(
|
final settingsContent = Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("Settings"),
|
title: Text("Settings"),
|
||||||
actionsPadding: .symmetric(horizontal: 12),
|
actionsPadding: .symmetric(horizontal: 12),
|
||||||
|
|
@ -52,10 +53,31 @@ class SettingsPage extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
VerticalDivider(),
|
VerticalDivider(),
|
||||||
|
Expanded(
|
||||||
|
child: SuperListView(
|
||||||
|
children: [
|
||||||
|
SwitchListTile(
|
||||||
|
title: Text("Settings Title"),
|
||||||
|
value: false,
|
||||||
|
onChanged: (value) {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
|
||||||
|
return constraints.maxWidth < 650
|
||||||
|
? settingsContent
|
||||||
|
: Dialog(
|
||||||
|
constraints: .loose(Size(900, 600)),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadiusGeometry.circular(12),
|
||||||
|
child: settingsContent,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue