Files
lunasea/lib/core/ui/scaffold.dart
Jagandeep Brar 139c9a0cd3 (ui): Removed all deprecated UI elements, added scroll-back support to entire UI, clean-up codebase (#396)
* Added RadarrManualImportConfigure for manual import config options

* Default bottom modal sheet to not expand

* Shrinkwrap modal listviews around content

* use keyboardDismissBehavior for all ListView

* Ensure keyboard is unfocused when opening the drawer

* Fetch and store quality definitions in global Radarr state

* Ability to configure language and quality profile for manual import instances

* Reworking all search bar implementations, integrated scroll back for Lidarr across module

* (ui): [Dashboard] Clean up of dashboard code, integrated scroll to top support

* (ui): [SnackBar] Remove all deprecated uses of LSSnackBar, add scrollback for NZBGet, improve error handling in queue

* (ui): Removed usage of old StickyListView, ReorderableListView, integrated LunaScaffold into base routes

* (flutter): Update packages

* (flutter): Remove flutter_sticky_header package

* (ui): Remove unused deprecated classes

* (chore): Update changelog

* (fix): [Dashboard/Calendar] Radarr releases were not considering digital release date

* (ui): [Sonarr] Adapted for scroll back to top functionality, remove more deprecated UI elements

* (ui): Refactored Tautulli, Removed ALL deprecated UI elements from LunaSea

* (ui): Fixed inconsistent usage of material and luna colours across UI

* (fix): [Sonarr/Radarr] Do not show "Search For..." button when the query is empty, but there are no results

* (chore): Updated changelog

* (fix): [Sonarr/Add] Fix search queries not gettting executed

* (fix): [Tautulli] Remove unused global state elements

* (feat): [UI/AppBar] Ability to hide the leading widget

* (fix): [Radarr/Languages] Fix "Unknown" language not being shown in selection dialog

* (feat): [Radarr/Import] Ability to search movies to select, toggle real and proper toggles

* (chore): Updated packages
2021-04-01 22:06:07 -05:00

53 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lunasea/core.dart';
class LunaScaffold extends StatelessWidget {
final GlobalKey<ScaffoldState> scaffoldKey;
final PreferredSizeWidget appBar;
final Widget body;
final Widget drawer;
final Widget bottomNavigationBar;
final Widget floatingActionButton;
final bool extendBody;
final bool extendBodyBehindAppBar;
/// Called when [LunaDatabaseValue.ENABLED_PROFILE] has changed. Triggered within the build function.
final void Function(BuildContext) onProfileChange;
LunaScaffold({
Key key,
@required this.scaffoldKey,
this.appBar,
this.body,
this.drawer,
this.bottomNavigationBar,
this.floatingActionButton,
this.extendBody = false,
this.extendBodyBehindAppBar = false,
this.onProfileChange,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return LunaWillPopScope(
scaffoldKey: scaffoldKey,
child: ValueListenableBuilder(
valueListenable: Database.lunaSeaBox.listenable(keys: [LunaDatabaseValue.ENABLED_PROFILE.key]),
builder: (context, _, __) {
if(onProfileChange != null) onProfileChange(context);
return Scaffold(
key: scaffoldKey,
appBar: appBar,
body: body,
drawer: drawer,
bottomNavigationBar: bottomNavigationBar,
floatingActionButton: floatingActionButton,
extendBody: extendBody,
extendBodyBehindAppBar: extendBodyBehindAppBar,
onDrawerChanged: (_) => FocusManager.instance.primaryFocus?.unfocus(),
);
}
),
);
}
}