mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 04:32:32 +00:00
* 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
121 lines
4.5 KiB
Dart
121 lines
4.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lunasea/core.dart';
|
|
import 'package:lunasea/modules/dashboard.dart';
|
|
|
|
class DashboardDialogs {
|
|
Future<Tuple2<bool, int>> defaultPage(BuildContext context) async {
|
|
bool _flag = false;
|
|
int _index = 0;
|
|
|
|
void _setValues(bool flag, int index) {
|
|
_flag = flag;
|
|
_index = index;
|
|
Navigator.of(context, rootNavigator: true).pop();
|
|
}
|
|
|
|
await LunaDialog.dialog(
|
|
context: context,
|
|
title: 'Page',
|
|
content: List.generate(
|
|
DashboardNavigationBar.titles.length,
|
|
(index) => LunaDialog.tile(
|
|
text: DashboardNavigationBar.titles[index],
|
|
icon: DashboardNavigationBar.icons[index],
|
|
iconColor: LunaColours.list(index),
|
|
onTap: () => _setValues(true, index),
|
|
),
|
|
),
|
|
contentPadding: LunaDialog.listDialogContentPadding(),
|
|
);
|
|
|
|
return Tuple2(_flag, _index);
|
|
}
|
|
|
|
Future<Tuple2<bool, int>> setPastDays(BuildContext context) async {
|
|
bool _flag = false;
|
|
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
TextEditingController _textController = TextEditingController(text: DashboardDatabaseValue.CALENDAR_DAYS_PAST.data.toString());
|
|
|
|
void _setValues(bool flag) {
|
|
if(_formKey.currentState.validate()) {
|
|
_flag = flag;
|
|
Navigator.of(context, rootNavigator: true).pop();
|
|
}
|
|
}
|
|
|
|
await LunaDialog.dialog(
|
|
context: context,
|
|
title: 'Past Days',
|
|
buttons: [
|
|
LunaDialog.button(
|
|
text: 'Set',
|
|
onPressed: () => _setValues(true),
|
|
),
|
|
],
|
|
content: [
|
|
LunaDialog.textContent(text: 'Set the number of days in the past to fetch calendar entries for.'),
|
|
Form(
|
|
key: _formKey,
|
|
child: LunaDialog.textFormInput(
|
|
controller: _textController,
|
|
title: 'Past Days',
|
|
onSubmitted: (_) => _setValues(true),
|
|
validator: (value) {
|
|
int _value = int.tryParse(value);
|
|
if(_value != null && _value >= 1) return null;
|
|
return 'Minimum of 1 Day';
|
|
},
|
|
keyboardType: TextInputType.number,
|
|
),
|
|
),
|
|
],
|
|
contentPadding: LunaDialog.inputTextDialogContentPadding(),
|
|
);
|
|
|
|
return Tuple2(_flag, int.tryParse(_textController.text) ?? 14);
|
|
}
|
|
|
|
Future<Tuple2<bool, int>> setFutureDays(BuildContext context) async {
|
|
bool _flag = false;
|
|
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
TextEditingController _textController = TextEditingController(text: DashboardDatabaseValue.CALENDAR_DAYS_FUTURE.data.toString());
|
|
|
|
void _setValues(bool flag) {
|
|
if(_formKey.currentState.validate()) {
|
|
_flag = flag;
|
|
Navigator.of(context, rootNavigator: true).pop();
|
|
}
|
|
}
|
|
|
|
await LunaDialog.dialog(
|
|
context: context,
|
|
title: 'Future Days',
|
|
buttons: [
|
|
LunaDialog.button(
|
|
text: 'Set',
|
|
onPressed: () => _setValues(true),
|
|
),
|
|
],
|
|
content: [
|
|
LunaDialog.textContent(text: 'Set the number of days in the future to fetch calendar entries for.'),
|
|
Form(
|
|
key: _formKey,
|
|
child: LunaDialog.textFormInput(
|
|
controller: _textController,
|
|
title: 'Future Days',
|
|
onSubmitted: (_) => _setValues(true),
|
|
validator: (value) {
|
|
int _value = int.tryParse(value);
|
|
if(_value != null && _value >= 1) return null;
|
|
return 'Minimum of 1 Day';
|
|
},
|
|
keyboardType: TextInputType.number,
|
|
),
|
|
),
|
|
],
|
|
contentPadding: LunaDialog.inputTextDialogContentPadding(),
|
|
);
|
|
|
|
return Tuple2(_flag, int.tryParse(_textController.text) ?? 14);
|
|
}
|
|
} |