-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33bf2b5
commit 8ec3ed6
Showing
8 changed files
with
209 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:miria/model/account.dart'; | ||
import 'package:miria/providers.dart'; | ||
import 'package:miria/state_notifier/drive_page/drive_page_notifier.dart'; | ||
import 'package:miria/view/drive_page/drive_page.dart'; | ||
|
||
class DriveFolderSelectDialog extends StatelessWidget { | ||
const DriveFolderSelectDialog({ | ||
super.key, | ||
required this.account, | ||
}); | ||
|
||
final Account account; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ProviderScope( | ||
overrides: [ | ||
drivePageNotifierProvider.overrideWith(DrivePageNotifier.new), | ||
], | ||
child: Dialog( | ||
child: DrivePage( | ||
account: account, | ||
title: Text(S.of(context).selectFolder), | ||
floatingActionButtonBuilder: (context) => | ||
const DriveFolderSelectDialogFloatingActionButton(), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class DriveFolderSelectDialogFloatingActionButton extends ConsumerWidget { | ||
const DriveFolderSelectDialogFloatingActionButton({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return FloatingActionButton.extended( | ||
onPressed: () { | ||
final folder = | ||
ref.read(drivePageNotifierProvider).breadcrumbs.lastOrNull; | ||
Navigator.of(context).pop((folder,)); | ||
}, | ||
label: Text(S.of(context).select), | ||
icon: const Icon(Icons.check), | ||
); | ||
} | ||
} |
This file contains 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