From 615764a1417aa3ecf7039d09597259bf5f59a189 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Sun, 19 May 2024 15:33:01 +0200 Subject: [PATCH] Improve dialogs to go full screen on mobile --- api/pubspec.lock | 43 +- api/pubspec.yaml | 2 +- app/lib/pages/calendar/item.dart | 420 +++++++++--------- app/lib/pages/events/event.dart | 171 ++++--- app/lib/pages/groups/group.dart | 73 ++- app/lib/pages/notes/note.dart | 156 ++++--- app/lib/pages/places/place.dart | 72 ++- app/pubspec.lock | 57 ++- app/pubspec.yaml | 8 +- .../metadata/android/en-US/changelogs/7.txt | 1 + 10 files changed, 489 insertions(+), 514 deletions(-) diff --git a/api/pubspec.lock b/api/pubspec.lock index 1d657023f77..1de0c871f46 100644 --- a/api/pubspec.lock +++ b/api/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: "5aaf60d96c4cd00fe7f21594b5ad6a1b699c80a27420f8a837f4d68473ef09e3" url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "68.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.1.0" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "21f1d3720fd1c70316399d5e2bccaebb415c434592d778cce8acb967b8578808" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.5.0" args: dependency: transitive description: @@ -69,10 +74,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" build_resolvers: dependency: transitive description: @@ -85,10 +90,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" + sha256: "1414d6d733a85d8ad2f1dfcb3ea7945759e35a123cb99ccfac75d0758f75edfa" url: "https://pub.dev" source: hosted - version: "2.4.9" + version: "2.4.10" build_runner_core: dependency: transitive description: @@ -165,8 +170,8 @@ packages: dependency: "direct main" description: path: "packages/dart_leap" - ref: "805e87db09d83b20209645e2ae130597863ecd51" - resolved-ref: "805e87db09d83b20209645e2ae130597863ecd51" + ref: d45bd54f2efd6a861d6f44a8b833575b0482dc4c + resolved-ref: d45bd54f2efd6a861d6f44a8b833575b0482dc4c url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "1.0.0" @@ -206,10 +211,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1 + sha256: "5606fb95d54f3bb241b3e12dcfb65ba7494c775c4cb458334eccceb07334a3d9" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.3" freezed_annotation: dependency: "direct main" description: @@ -322,6 +327,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "12e8a9842b5a7390de7a781ec63d793527582398d16ea26c60fed58833c9ae79" + url: "https://pub.dev" + source: hosted + version: "0.1.0-main.0" matcher: dependency: transitive description: @@ -430,10 +443,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" source_gen: dependency: transitive description: @@ -627,4 +640,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.4.0 <4.0.0" diff --git a/api/pubspec.yaml b/api/pubspec.yaml index a5a68e783b2..fd19e43d225 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: dart_leap: git: url: https://github.com/LinwoodDev/dart_pkgs - ref: 805e87db09d83b20209645e2ae130597863ecd51 + ref: d45bd54f2efd6a861d6f44a8b833575b0482dc4c path: packages/dart_leap dev_dependencies: build_runner: ^2.4.9 diff --git a/app/lib/pages/calendar/item.dart b/app/lib/pages/calendar/item.dart index 2d331591b70..d46f4deae33 100644 --- a/app/lib/pages/calendar/item.dart +++ b/app/lib/pages/calendar/item.dart @@ -104,243 +104,225 @@ class _CalendarItemDialogState extends State { break; } - return AlertDialog( - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(title), - Row( - children: [ - if (tabs) - IconButton( - icon: const PhosphorIcon(PhosphorIconsLight.trash), - onPressed: () async { - await _service?.deleteCalendarItem(_item.id!); - if (context.mounted) { - Navigator.of(context).pop(); - } - }, + return ResponsiveAlertDialog( + title: Text(title), + constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800), + headerActions: [ + if (tabs) + IconButton( + icon: const PhosphorIcon(PhosphorIconsLight.trash), + onPressed: () async { + await _service?.deleteCalendarItem(_item.id!); + if (context.mounted) { + Navigator.of(context).pop(); + } + }, + ), + MenuAnchor( + builder: (context, controller, child) => IconButton( + icon: const PhosphorIcon(PhosphorIconsLight.dotsThreeVertical), + onPressed: () => + controller.isOpen ? controller.close() : controller.open(), + ), + menuChildren: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Text( + AppLocalizations.of(context).convertTo, + style: Theme.of(context).textTheme.titleMedium, + ), + ), + MenuItemButton( + leadingIcon: const PhosphorIcon(PhosphorIconsLight.calendar), + onPressed: () => _convertTo(CalendarItemType.appointment), + child: Text(AppLocalizations.of(context).appointment), + ), + MenuItemButton( + leadingIcon: const PhosphorIcon(PhosphorIconsLight.smiley), + onPressed: () => _convertTo(CalendarItemType.moment), + child: Text(AppLocalizations.of(context).moment), + ), + MenuItemButton( + leadingIcon: const PhosphorIcon(PhosphorIconsLight.clock), + onPressed: () => _convertTo(CalendarItemType.pending), + child: Text(AppLocalizations.of(context).pending), + ), + ], + ), + ], + content: DefaultTabController( + length: tabs ? 2 : 1, + child: Column( + children: [ + if (tabs) + TabBar( + tabs: [ + ( + PhosphorIconsLight.faders, + AppLocalizations.of(context).general ), - MenuAnchor( - builder: (context, controller, child) => IconButton( - icon: - const PhosphorIcon(PhosphorIconsLight.dotsThreeVertical), - onPressed: () => controller.isOpen - ? controller.close() - : controller.open(), + ( + PhosphorIconsLight.checkCircle, + AppLocalizations.of(context).notes ), - menuChildren: [ - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Text( - AppLocalizations.of(context).convertTo, - style: Theme.of(context).textTheme.titleMedium, - ), - ), - MenuItemButton( - leadingIcon: - const PhosphorIcon(PhosphorIconsLight.calendar), - onPressed: () => _convertTo(CalendarItemType.appointment), - child: Text(AppLocalizations.of(context).appointment), - ), - MenuItemButton( - leadingIcon: const PhosphorIcon(PhosphorIconsLight.smiley), - onPressed: () => _convertTo(CalendarItemType.moment), - child: Text(AppLocalizations.of(context).moment), - ), - MenuItemButton( - leadingIcon: const PhosphorIcon(PhosphorIconsLight.clock), - onPressed: () => _convertTo(CalendarItemType.pending), - child: Text(AppLocalizations.of(context).pending), - ), - ], - ), - ], - ), - ], - ), - content: SizedBox( - width: 500, - height: 500, - child: DefaultTabController( - length: tabs ? 2 : 1, - child: Column( - children: [ - if (tabs) - TabBar( - tabs: [ - ( - PhosphorIconsLight.faders, - AppLocalizations.of(context).general - ), - ( - PhosphorIconsLight.checkCircle, - AppLocalizations.of(context).notes - ), - ] - .map((e) => HorizontalTab( - icon: PhosphorIcon(e.$1), - label: Text(e.$2), - )) - .toList()), - Flexible( - child: TabBarView( - children: [ - Material( - color: Colors.transparent, - child: ListView( - shrinkWrap: true, - children: [ - if (widget.source == null) ...[ - SourceDropdown( - value: _source, - buildService: (e) => e.calendarItem, - onChanged: (connected) { - _source = connected?.source ?? ''; - _item = _item.copyWith( - eventId: null, - groupId: null, - placeId: null, - ); - _service = connected?.model; - }, - ), - const SizedBox(height: 16), - ], - const SizedBox(height: 16), - EventSelectTile( - source: _source, - value: _item.eventId, - onChanged: (value) { - _item = _item.copyWith(eventId: value?.model); + ] + .map((e) => HorizontalTab( + icon: PhosphorIcon(e.$1), + label: Text(e.$2), + )) + .toList()), + Flexible( + child: TabBarView( + children: [ + Material( + color: Colors.transparent, + child: ListView( + shrinkWrap: true, + children: [ + if (widget.source == null) ...[ + SourceDropdown( + value: _source, + buildService: (e) => e.calendarItem, + onChanged: (connected) { + _source = connected?.source ?? ''; + _item = _item.copyWith( + eventId: null, + groupId: null, + placeId: null, + ); + _service = connected?.model; }, ), const SizedBox(height: 16), - DropdownMenu( - initialSelection: _item.status, - dropdownMenuEntries: EventStatus.values - .map((value) => DropdownMenuEntry( - value: value, - leadingIcon: PhosphorIcon( - value.icon(PhosphorIconsStyle.light), - color: value.getColor()), - label: value.getLocalizedName(context), - )) - .toList(), - onSelected: (EventStatus? value) { - _item = - _item.copyWith(status: value ?? _item.status); - }, - label: Text(AppLocalizations.of(context).status), - leadingIcon: - const PhosphorIcon(PhosphorIconsLight.info), - expandedInsets: const EdgeInsets.all(4), + ], + const SizedBox(height: 16), + EventSelectTile( + source: _source, + value: _item.eventId, + onChanged: (value) { + _item = _item.copyWith(eventId: value?.model); + }, + ), + const SizedBox(height: 16), + DropdownMenu( + initialSelection: _item.status, + dropdownMenuEntries: EventStatus.values + .map((value) => DropdownMenuEntry( + value: value, + leadingIcon: PhosphorIcon( + value.icon(PhosphorIconsStyle.light), + color: value.getColor()), + label: value.getLocalizedName(context), + )) + .toList(), + onSelected: (EventStatus? value) { + _item = + _item.copyWith(status: value ?? _item.status); + }, + label: Text(AppLocalizations.of(context).status), + leadingIcon: + const PhosphorIcon(PhosphorIconsLight.info), + expandedInsets: const EdgeInsets.all(4), + ), + const SizedBox(height: 16), + TextFormField( + initialValue: _item.name, + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const PhosphorIcon(PhosphorIconsLight.folder), ), - const SizedBox(height: 16), - TextFormField( - initialValue: _item.name, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: - const PhosphorIcon(PhosphorIconsLight.folder), - ), - onChanged: (value) => - _item = _item.copyWith(name: value), + onChanged: (value) => + _item = _item.copyWith(name: value), + ), + const SizedBox(height: 16), + MarkdownField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: const OutlineInputBorder(), + icon: + const PhosphorIcon(PhosphorIconsLight.fileText), ), - const SizedBox(height: 16), - MarkdownField( - decoration: InputDecoration( - labelText: - AppLocalizations.of(context).description, - border: const OutlineInputBorder(), - icon: const PhosphorIcon( - PhosphorIconsLight.fileText), - ), - onChanged: (value) => - _item = _item.copyWith(description: value), - value: _item.description, + onChanged: (value) => + _item = _item.copyWith(description: value), + value: _item.description, + ), + const SizedBox(height: 16), + GroupSelectTile( + source: _source, + value: _item.groupId, + onChanged: (value) { + _item = _item.copyWith(groupId: value?.model); + }, + ), + PlaceSelectTile( + source: _source, + value: _item.placeId, + onChanged: (value) { + _item = _item.copyWith(placeId: value?.model); + }, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).location, + icon: const PhosphorIcon(PhosphorIconsLight.mapPin), ), - const SizedBox(height: 16), - GroupSelectTile( - source: _source, - value: _item.groupId, + minLines: 1, + maxLines: 2, + initialValue: _item.location, + onChanged: (value) => + _item = _item.copyWith(location: value), + ), + const SizedBox(height: 16), + if (type == CalendarItemType.appointment) ...[ + DateTimeField( + label: AppLocalizations.of(context).start, + initialValue: _item.start, + icon: const PhosphorIcon( + PhosphorIconsLight.calendarBlank), onChanged: (value) { - _item = _item.copyWith(groupId: value?.model); + _item = _item.copyWith(start: value); }, + canBeEmpty: true, ), - PlaceSelectTile( - source: _source, - value: _item.placeId, + const SizedBox(height: 8), + DateTimeField( + label: AppLocalizations.of(context).end, + initialValue: _item.end, + icon: const PhosphorIcon( + PhosphorIconsLight.calendarBlank), onChanged: (value) { - _item = _item.copyWith(placeId: value?.model); + _item = _item.copyWith(end: value); }, + canBeEmpty: true, ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).location, - icon: - const PhosphorIcon(PhosphorIconsLight.mapPin), - ), - minLines: 1, - maxLines: 2, - initialValue: _item.location, - onChanged: (value) => - _item = _item.copyWith(location: value), + ], + if (type == CalendarItemType.moment) ...[ + DateTimeField( + label: AppLocalizations.of(context).time, + initialValue: _item.start, + icon: const PhosphorIcon( + PhosphorIconsLight.calendarBlank), + onChanged: (value) { + _item = _item.copyWith(start: value, end: value); + }, + canBeEmpty: true, ), - const SizedBox(height: 16), - if (type == CalendarItemType.appointment) ...[ - DateTimeField( - label: AppLocalizations.of(context).start, - initialValue: _item.start, - icon: const PhosphorIcon( - PhosphorIconsLight.calendarBlank), - onChanged: (value) { - _item = _item.copyWith(start: value); - }, - canBeEmpty: true, - ), - const SizedBox(height: 8), - DateTimeField( - label: AppLocalizations.of(context).end, - initialValue: _item.end, - icon: const PhosphorIcon( - PhosphorIconsLight.calendarBlank), - onChanged: (value) { - _item = _item.copyWith(end: value); - }, - canBeEmpty: true, - ), - ], - if (type == CalendarItemType.moment) ...[ - DateTimeField( - label: AppLocalizations.of(context).time, - initialValue: _item.start, - icon: const PhosphorIcon( - PhosphorIconsLight.calendarBlank), - onChanged: (value) { - _item = - _item.copyWith(start: value, end: value); - }, - canBeEmpty: true, - ), - ], ], - ), + ], ), - if (tabs) - NotesView( - model: widget.item!, - connector: connector, - source: _source, - ), - ], - ), + ), + if (tabs) + NotesView( + model: widget.item!, + connector: connector, + source: _source, + ), + ], ), - ], - ), + ), + ], ), ), actions: [ diff --git a/app/lib/pages/events/event.dart b/app/lib/pages/events/event.dart index 35440859eec..b6037ad5c15 100644 --- a/app/lib/pages/events/event.dart +++ b/app/lib/pages/events/event.dart @@ -3,6 +3,7 @@ import 'package:flow/pages/groups/select.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart'; import 'package:flow_api/models/event/model.dart'; import 'package:flow_api/models/event/service.dart'; @@ -34,99 +35,91 @@ class EventDialog extends StatelessWidget { final nameController = TextEditingController(text: currentEvent.name); final locationController = TextEditingController(text: currentEvent.location); - return AlertDialog( + return ResponsiveAlertDialog( title: Text(create ? AppLocalizations.of(context).createEvent : AppLocalizations.of(context).editEvent), - content: SizedBox( - width: 500, - height: 500, - child: Material( - color: Colors.transparent, - child: ListView( - shrinkWrap: true, - children: [ - const SizedBox(height: 16), - if (source == null) ...[ - SourceDropdown( - value: currentSource, - buildService: (source) => source.event, - onChanged: (connected) { - currentSource = connected?.source ?? ''; - currentService = connected?.model; - currentEvent = currentEvent.copyWith( - groupId: null, - placeId: null, - ); - }, - ), - const SizedBox(height: 16), - ], - const SizedBox(height: 16), - TextFormField( - controller: nameController, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - filled: true, - ), - onChanged: (value) => - currentEvent = currentEvent.copyWith(name: value), - ), - const SizedBox(height: 16), - MarkdownField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - border: const OutlineInputBorder(), - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - ), - value: currentEvent.description, - onChanged: (value) => - currentEvent = currentEvent.copyWith(description: value), - ), - const SizedBox(height: 16), - GroupSelectTile( - source: currentSource, - value: currentEvent.groupId, - onChanged: (value) { - currentEvent = currentEvent.copyWith(groupId: value?.model); - }, - ), - const SizedBox(height: 16), - PlaceSelectTile( - source: currentSource, - value: currentEvent.placeId, - onChanged: (value) { - currentEvent = currentEvent.copyWith(placeId: value?.model); - }, - ), - const SizedBox(height: 8), - StatefulBuilder( - builder: (context, setState) => CheckboxListTile( - secondary: - const Icon(PhosphorIconsLight.circleHalfTilt), - title: Text(AppLocalizations.of(context).blocked), - value: currentEvent.blocked, - onChanged: (value) => setState( - () => currentEvent = currentEvent.copyWith( - blocked: value ?? currentEvent.blocked), - ), - )), - const SizedBox(height: 8), - TextField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).location, - icon: const PhosphorIcon(PhosphorIconsLight.mapPin), - ), - minLines: 1, - maxLines: 2, - controller: locationController, - onChanged: (value) => - currentEvent = currentEvent.copyWith(location: value), - ), - ], + constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800), + content: ListView( + shrinkWrap: true, + children: [ + if (source == null) ...[ + SourceDropdown( + value: currentSource, + buildService: (source) => source.event, + onChanged: (connected) { + currentSource = connected?.source ?? ''; + currentService = connected?.model; + currentEvent = currentEvent.copyWith( + groupId: null, + placeId: null, + ); + }, + ), + const SizedBox(height: 16), + ], + const SizedBox(height: 16), + TextFormField( + controller: nameController, + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + filled: true, + ), + onChanged: (value) => + currentEvent = currentEvent.copyWith(name: value), ), - ), + const SizedBox(height: 16), + MarkdownField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: const OutlineInputBorder(), + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + ), + value: currentEvent.description, + onChanged: (value) => + currentEvent = currentEvent.copyWith(description: value), + ), + const SizedBox(height: 16), + GroupSelectTile( + source: currentSource, + value: currentEvent.groupId, + onChanged: (value) { + currentEvent = currentEvent.copyWith(groupId: value?.model); + }, + ), + const SizedBox(height: 16), + PlaceSelectTile( + source: currentSource, + value: currentEvent.placeId, + onChanged: (value) { + currentEvent = currentEvent.copyWith(placeId: value?.model); + }, + ), + const SizedBox(height: 8), + StatefulBuilder( + builder: (context, setState) => CheckboxListTile( + secondary: const Icon(PhosphorIconsLight.circleHalfTilt), + title: Text(AppLocalizations.of(context).blocked), + value: currentEvent.blocked, + onChanged: (value) => setState( + () => currentEvent = currentEvent.copyWith( + blocked: value ?? currentEvent.blocked), + ), + )), + const SizedBox(height: 8), + TextField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).location, + icon: const PhosphorIcon(PhosphorIconsLight.mapPin), + ), + minLines: 1, + maxLines: 2, + controller: locationController, + onChanged: (value) => + currentEvent = currentEvent.copyWith(location: value), + ), + ], ), actions: [ TextButton( diff --git a/app/lib/pages/groups/group.dart b/app/lib/pages/groups/group.dart index b8f971eedd2..6ecee7506d1 100644 --- a/app/lib/pages/groups/group.dart +++ b/app/lib/pages/groups/group.dart @@ -4,6 +4,7 @@ import 'package:flow/widgets/source_dropdown.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart'; import 'package:flow_api/models/group/model.dart'; import 'package:flow_api/models/group/service.dart'; @@ -29,49 +30,47 @@ class GroupDialog extends StatelessWidget { var currentService = context.read().getService(currentSource).group; final nameController = TextEditingController(text: currentGroup.name); - return AlertDialog( + return ResponsiveAlertDialog( title: Text(create ? AppLocalizations.of(context).createGroup : AppLocalizations.of(context).editGroup), - content: SizedBox( - width: 500, - child: Column(mainAxisSize: MainAxisSize.min, children: [ - if (source == null) ...[ - SourceDropdown( - value: currentSource, - buildService: (e) => e.group, - onChanged: (connected) { - currentSource = connected?.source ?? ''; - currentService = connected?.model; - }, - ), - const SizedBox(height: 16), - ], - TextField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - filled: true, - ), - controller: nameController, - onChanged: (value) { - currentGroup = currentGroup.copyWith(name: value); + constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800), + content: ListView(shrinkWrap: true, children: [ + if (source == null) ...[ + SourceDropdown( + value: currentSource, + buildService: (e) => e.group, + onChanged: (connected) { + currentSource = connected?.source ?? ''; + currentService = connected?.model; }, ), const SizedBox(height: 16), - MarkdownField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - border: const OutlineInputBorder(), - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - ), - value: currentGroup.description, - onChanged: (value) { - currentGroup = currentGroup.copyWith(description: value); - }, - ) - ]), - ), + ], + TextField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + filled: true, + ), + controller: nameController, + onChanged: (value) { + currentGroup = currentGroup.copyWith(name: value); + }, + ), + const SizedBox(height: 16), + MarkdownField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: const OutlineInputBorder(), + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + ), + value: currentGroup.description, + onChanged: (value) { + currentGroup = currentGroup.copyWith(description: value); + }, + ) + ]), actions: [ TextButton( onPressed: () { diff --git a/app/lib/pages/notes/note.dart b/app/lib/pages/notes/note.dart index 09a61d40864..a033eac16f9 100644 --- a/app/lib/pages/notes/note.dart +++ b/app/lib/pages/notes/note.dart @@ -3,6 +3,7 @@ import 'package:flow/widgets/markdown_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart'; import 'package:flow_api/models/note/model.dart'; import 'package:flow_api/models/note/service.dart'; @@ -42,94 +43,87 @@ class _NoteDialogState extends State { Widget build(BuildContext context) { final create = widget.create || widget.note == null || widget.source == null; - return AlertDialog( - title: Row( - children: [ - Expanded( - child: Text( - create - ? AppLocalizations.of(context).createNote - : AppLocalizations.of(context).editNote, - ), - ), - if (_newNote.status != null) - Checkbox( - value: _newNote.status?.done, - tristate: true, - onChanged: (value) { - setState(() { - _newNote = _newNote.copyWith( - status: NoteStatusExtension.fromDone(value)); - }); - }, - ), - ], + return ResponsiveAlertDialog( + title: Text( + create + ? AppLocalizations.of(context).createNote + : AppLocalizations.of(context).editNote, ), - scrollable: true, - content: SizedBox( - width: 400, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (widget.source == null) ...[ - SourceDropdown( - value: _newSource, - onChanged: (connected) { - _newSource = connected?.source ?? ''; - _service = connected?.model; - }, - buildService: (e) => e.note, - ), - const SizedBox(height: 16), - ], - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - icon: const PhosphorIcon(PhosphorIconsLight.textT), - filled: true, - ), - initialValue: _newNote.name, - onChanged: (value) { - _newNote = _newNote.copyWith(name: value); - }, - ), - const SizedBox(height: 16), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).priority, - icon: const PhosphorIcon(PhosphorIconsLight.arrowSquareUp), - border: const OutlineInputBorder(), - ), - initialValue: _newNote.priority.toString(), - keyboardType: TextInputType.number, - onChanged: (value) { + constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800), + headerActions: [ + if (_newNote.status != null) + Checkbox( + value: _newNote.status?.done, + tristate: true, + onChanged: (value) { + setState(() { _newNote = _newNote.copyWith( - priority: int.tryParse(value) ?? _newNote.priority); + status: NoteStatusExtension.fromDone(value)); + }); + }, + ), + ], + content: ListView( + shrinkWrap: true, + children: [ + if (widget.source == null) ...[ + SourceDropdown( + value: _newSource, + onChanged: (connected) { + _newSource = connected?.source ?? ''; + _service = connected?.model; }, + buildService: (e) => e.note, ), const SizedBox(height: 16), - MarkdownField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - border: const OutlineInputBorder(), - ), - value: _newNote.description, - onChanged: (value) { - _newNote = _newNote.copyWith(description: value); - }, + ], + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + icon: const PhosphorIcon(PhosphorIconsLight.textT), + filled: true, ), - const SizedBox(height: 16), - CheckboxListTile( - title: Text(AppLocalizations.of(context).todo), - value: _newNote.status != null, - onChanged: (value) { - setState(() => _newNote = _newNote.copyWith( - status: value == true ? NoteStatus.todo : null)); - }, + initialValue: _newNote.name, + onChanged: (value) { + _newNote = _newNote.copyWith(name: value); + }, + ), + const SizedBox(height: 16), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).priority, + icon: const PhosphorIcon(PhosphorIconsLight.arrowSquareUp), + border: const OutlineInputBorder(), ), - ], - ), + initialValue: _newNote.priority.toString(), + keyboardType: TextInputType.number, + onChanged: (value) { + _newNote = _newNote.copyWith( + priority: int.tryParse(value) ?? _newNote.priority); + }, + ), + const SizedBox(height: 16), + MarkdownField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + border: const OutlineInputBorder(), + ), + value: _newNote.description, + onChanged: (value) { + _newNote = _newNote.copyWith(description: value); + }, + ), + const SizedBox(height: 16), + CheckboxListTile( + title: Text(AppLocalizations.of(context).todo), + value: _newNote.status != null, + onChanged: (value) { + setState(() => _newNote = _newNote.copyWith( + status: value == true ? NoteStatus.todo : null)); + }, + ), + ], ), actions: [ TextButton( diff --git a/app/lib/pages/places/place.dart b/app/lib/pages/places/place.dart index 40be3118bb7..f0688d459de 100644 --- a/app/lib/pages/places/place.dart +++ b/app/lib/pages/places/place.dart @@ -2,6 +2,7 @@ import 'package:flow/widgets/markdown_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; import 'package:phosphor_flutter/phosphor_flutter.dart'; import 'package:flow_api/models/model.dart'; import 'package:flow_api/models/place/model.dart'; @@ -29,49 +30,46 @@ class PlaceDialog extends StatelessWidget { var currentSource = source ?? ''; var currentService = context.read().getService(currentSource).place; - return AlertDialog( + return ResponsiveAlertDialog( title: Text(create ? AppLocalizations.of(context).createPlace : AppLocalizations.of(context).editPlace), - content: SizedBox( - width: 500, - child: Column(children: [ - if (source == null) ...[ - SourceDropdown( - value: currentSource, - buildService: (e) => e.place, - onChanged: (connected) { - currentSource = connected?.source ?? ''; - }, - ), - const SizedBox(height: 16), - ], - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - ), - initialValue: currentPlace.name, - onChanged: (value) { - currentPlace = currentPlace.copyWith(name: value); + constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800), + content: ListView(shrinkWrap: true, children: [ + if (source == null) ...[ + SourceDropdown( + value: currentSource, + buildService: (e) => e.place, + onChanged: (connected) { + currentSource = connected?.source ?? ''; }, ), const SizedBox(height: 16), - MarkdownField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - border: const OutlineInputBorder(), - icon: const PhosphorIcon(PhosphorIconsLight.fileText), - ), - value: currentPlace.description, - onChanged: (value) { - currentPlace = currentPlace.copyWith(description: value); - }, - ) - ]), - ), - scrollable: true, + ], + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + ), + initialValue: currentPlace.name, + onChanged: (value) { + currentPlace = currentPlace.copyWith(name: value); + }, + ), + const SizedBox(height: 16), + MarkdownField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: const OutlineInputBorder(), + icon: const PhosphorIcon(PhosphorIconsLight.fileText), + ), + value: currentPlace.description, + onChanged: (value) { + currentPlace = currentPlace.copyWith(description: value); + }, + ) + ]), actions: [ TextButton( onPressed: () => Navigator.of(context).pop(), diff --git a/app/pubspec.lock b/app/pubspec.lock index d83ac37a1cb..aac6ed176a8 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" build_resolvers: dependency: transitive description: @@ -117,10 +117,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" + sha256: "1414d6d733a85d8ad2f1dfcb3ea7945759e35a123cb99ccfac75d0758f75edfa" url: "https://pub.dev" source: hosted - version: "2.4.9" + version: "2.4.10" build_runner_core: dependency: transitive description: @@ -237,8 +237,8 @@ packages: dependency: transitive description: path: "packages/dart_leap" - ref: "805e87db09d83b20209645e2ae130597863ecd51" - resolved-ref: "805e87db09d83b20209645e2ae130597863ecd51" + ref: d45bd54f2efd6a861d6f44a8b833575b0482dc4c + resolved-ref: d45bd54f2efd6a861d6f44a8b833575b0482dc4c url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "1.0.0" @@ -415,10 +415,10 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: c0f402067fb0498934faa6bddd670de0a3db45222e2ca9a068c6177c9a2360a4 + sha256: "8496a89eea74e23f92581885f876455d9d460e71201405dffe5f55dfe1155864" url: "https://pub.dev" source: hosted - version: "9.1.1" + version: "9.2.1" flutter_secure_storage_linux: dependency: transitive description: @@ -431,27 +431,26 @@ packages: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "8cfa53010a294ff095d7be8fa5bb15f2252c50018d69c5104851303f3ff92510" + sha256: b768a7dab26d6186b68e2831b3104f8968154f0f4fdbf66e7c2dd7bdf299daaf url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: "301f67ee9b87f04aef227f57f13f126fa7b13543c8e7a93f25c5d2d534c28a4a" + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" flutter_secure_storage_web: dependency: "direct overridden" description: - path: flutter_secure_storage_web - ref: ce09c8a5fd2b3a48949e386c7cc2849451961b46 - resolved-ref: ce09c8a5fd2b3a48949e386c7cc2849451961b46 - url: "https://github.com/CodeDoctorDE/flutter_secure_storage.git" - source: git - version: "1.1.2" + name: flutter_secure_storage_web + sha256: "4f95c4d5389fee7d19a41e776426e5c1b3e34319cd670c58da2dc4811d9c59bf" + url: "https://pub.dev" + source: hosted + version: "2.0.0-beta.1" flutter_secure_storage_windows: dependency: transitive description: @@ -514,10 +513,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "7685acd06244ba4be60f455c5cafe5790c63dc91fc03f7385b1e922a6b85b17c" + sha256: aa073287b8f43553678e6fa9e8bb9c83212ff76e09542129a8099bbc8db4df65 url: "https://pub.dev" source: hosted - version: "14.1.1" + version: "14.1.2" graphs: dependency: transitive description: @@ -690,8 +689,8 @@ packages: dependency: "direct main" description: path: "packages/material_leap" - ref: fa2fa0e74c8d749e77b7f085a4c7656043bdca92 - resolved-ref: fa2fa0e74c8d749e77b7f085a4c7656043bdca92 + ref: ff93bce26d1f8d5160cbfe66b548cf9286d0576d + resolved-ref: ff93bce26d1f8d5160cbfe66b548cf9286d0576d url: "https://github.com/LinwoodDev/dart_pkgs" source: git version: "0.0.1" @@ -971,10 +970,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" simple_icons: dependency: "direct main" description: @@ -1264,18 +1263,18 @@ packages: dependency: transitive description: name: win32 - sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.5.1" window_manager: dependency: "direct main" description: name: window_manager - sha256: b3c895bdf936c77b83c5254bec2e6b3f066710c1f89c38b20b8acc382b525494 + sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" url: "https://pub.dev" source: hosted - version: "0.3.8" + version: "0.3.9" xdg_directories: dependency: transitive description: @@ -1301,5 +1300,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.19.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index ba9f579cdc1..486908c3dd4 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -37,7 +37,7 @@ dependencies: material_leap: git: url: https://github.com/LinwoodDev/dart_pkgs - ref: fa2fa0e74c8d749e77b7f085a4c7656043bdca92 + ref: ff93bce26d1f8d5160cbfe66b548cf9286d0576d path: packages/material_leap phosphor_flutter: ^2.1.0 path: ^1.8.3 @@ -80,11 +80,7 @@ dev_dependencies: json_serializable: ^6.7.1 espresso: ^0.3.0+8 dependency_overrides: - flutter_secure_storage_web: - git: - url: https://github.com/CodeDoctorDE/flutter_secure_storage.git - ref: ce09c8a5fd2b3a48949e386c7cc2849451961b46 - path: flutter_secure_storage_web + flutter_secure_storage_web: ^2.0.0-beta.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/fastlane/metadata/android/en-US/changelogs/7.txt b/fastlane/metadata/android/en-US/changelogs/7.txt index e045caa02d4..dbc2faf0bb2 100644 --- a/fastlane/metadata/android/en-US/changelogs/7.txt +++ b/fastlane/metadata/android/en-US/changelogs/7.txt @@ -9,6 +9,7 @@ * Improve custom title bar window buttons * Improve material 3 colors of chips * Improve child notes layout +* Improve dialogs to go full screen on mobile * Use default page transition instead of fade * Unify select dialogs * Upgrade to flutter 3.19