-
Notifications
You must be signed in to change notification settings - Fork 0
Expandable Menu for Large Screens #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06137a4
Expandable fab menu support for Checklists screen (large version)
gabrielbmoro 3c06193
Expandable fab menu support for Checklists screen (large version)
gabrielbmoro 2039e61
Expandable fab menu support for Checklists screen (large version)
gabrielbmoro ca4c2d9
Clip the ripple effect of task widget cell to edge
gabrielbmoro 70a536d
Update widget components to use the suffix 'widget'
gabrielbmoro 53bbb0a
Add blur effect and auto-close - Expandable fab menu
gabrielbmoro 56fb288
Support for share and sort - Checklist full screen
gabrielbmoro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class CardWrapperWidget extends StatelessWidget { | ||
| final Color backgroundColor; | ||
| final Function()? onTap; | ||
| final Widget child; | ||
|
|
||
| const CardWrapperWidget( | ||
| {super.key, | ||
| required this.child, | ||
| required this.onTap, | ||
| required this.backgroundColor}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Card( | ||
| elevation: 2, | ||
| shape: const RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.all(Radius.circular(12)), | ||
| ), | ||
| color: backgroundColor, | ||
| clipBehavior: Clip.hardEdge, | ||
| child: InkWell( | ||
| onTap: onTap, | ||
| child: child, | ||
| ), | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
lib/ui/components/widgets/checklist/checklist_navigation_rail_menu.dart
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
lib/ui/components/widgets/checklist/fabmenu/checklist_expandable_fab_menu.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; | ||
| import 'package:todoapp/ui/components/widgets/checklist/fabmenu/checklist_fabmenu_item.dart'; | ||
| import 'package:todoapp/ui/l10n/app_localizations.dart'; | ||
|
|
||
| class ChecklistExpandableFabMenu extends StatefulWidget { | ||
| final Function() onNewChecklistPressed; | ||
| final Function() onNewTaskPressed; | ||
| final Function() onSharePressed; | ||
| final Function() onSortPressed; | ||
|
|
||
| const ChecklistExpandableFabMenu({ | ||
| super.key, | ||
| required this.onNewChecklistPressed, | ||
| required this.onNewTaskPressed, | ||
| required this.onSharePressed, | ||
| required this.onSortPressed, | ||
| }); | ||
|
|
||
| @override | ||
| State<ChecklistExpandableFabMenu> createState() => | ||
| _ChecklistExpandableFabMenuState(); | ||
| } | ||
|
|
||
| class _ChecklistExpandableFabMenuState | ||
| extends State<ChecklistExpandableFabMenu> { | ||
| final _key = GlobalKey<ExpandableFabState>(); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| final localizations = AppLocalizations.of(context)!; | ||
|
|
||
| return ExpandableFab( | ||
| key: _key, | ||
| type: ExpandableFabType.side, | ||
| overlayStyle: const ExpandableFabOverlayStyle( | ||
| blur: 1.0, | ||
| ), | ||
| children: [ | ||
| ChecklistFabMenuItem( | ||
| heroTag: 'new_task', | ||
| onPressed: () => { | ||
| _key.currentState?.close(), | ||
| widget.onNewTaskPressed(), | ||
| }, | ||
| label: localizations.task, | ||
| icon: Icons.add_task, | ||
| ), | ||
| ChecklistFabMenuItem( | ||
| heroTag: 'new_checklist', | ||
| onPressed: () => { | ||
| _key.currentState?.close(), | ||
| widget.onNewChecklistPressed(), | ||
| }, | ||
| label: localizations.checklist, | ||
| icon: Icons.plus_one, | ||
| ), | ||
| ChecklistFabMenuItem( | ||
| heroTag: 'share', | ||
| onPressed: () => { | ||
| _key.currentState?.close(), | ||
| widget.onSharePressed(), | ||
| }, | ||
| label: localizations.share, | ||
| icon: Icons.share, | ||
| ), | ||
| ChecklistFabMenuItem( | ||
| heroTag: 'sort', | ||
| onPressed: () => { | ||
| _key.currentState?.close(), | ||
| widget.onSortPressed(), | ||
| }, | ||
| label: localizations.sort, | ||
| icon: Icons.sort, | ||
| ) | ||
| ], | ||
| ); | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
lib/ui/components/widgets/checklist/fabmenu/checklist_fabmenu_item.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class ChecklistFabMenuItem extends StatelessWidget { | ||
| final String heroTag; | ||
| final String label; | ||
| final IconData icon; | ||
| final Function() onPressed; | ||
|
|
||
| const ChecklistFabMenuItem( | ||
| {super.key, | ||
| required this.label, | ||
| required this.onPressed, | ||
| required this.icon, | ||
| required this.heroTag}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Column( | ||
| children: [ | ||
| FloatingActionButton.small( | ||
| heroTag: heroTag, | ||
| onPressed: onPressed, | ||
| child: Icon(icon), | ||
| ), | ||
| const SizedBox(height: 8), | ||
| Text(label), | ||
| ], | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class FormFieldWidget extends StatelessWidget { | ||
| final String labelText; | ||
| final TextEditingController controller; | ||
| final String? Function(String?)? validator; | ||
|
|
||
| const FormFieldWidget({ | ||
| super.key, | ||
| required this.labelText, | ||
| required this.controller, | ||
| this.validator, | ||
| }); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return TextFormField( | ||
| autofocus: true, | ||
| maxLines: 3, | ||
| controller: controller, | ||
| decoration: InputDecoration( | ||
| labelText: labelText, | ||
| labelStyle: Theme.of(context).textTheme.titleMedium, | ||
| border: const OutlineInputBorder(), | ||
| ), | ||
| validator: validator, | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increase the input text field to be more a kind of text area