Skip to content

Commit

Permalink
feat(cat-voices): Upload file dialog (#932)
Browse files Browse the repository at this point in the history
* feat: Upload file dialog - initial commit

* feat: Upload file dialog - fix bg and border for dialogs

* feat: Upload file dialog - extract and implement subwidgets

* feat: Upload file dialog - inkwell + spannable

* feat: Upload file dialog - add file_picker

* feat: Upload file dialog - implement dragging + details

* feat: Upload file dialog - extract voices_file.dart

* feat: Upload file dialog - pass onUpload

* feat: Upload file dialog - pass title

* feat: Upload file dialog - add allowedExtensions property

* feat: Upload file dialog - onCancel callback

* feat: Upload file dialog - isUploading conditions

* feat: Upload file dialog - show progress indicator

* feat: Upload file dialog - pass info and itemNameToUpload

* feat: Upload file dialog - l10n

* feat: Upload file dialog - SizedBox and Future<void>

* feat: Upload file dialog - fix l10n

* feat: Upload file dialog - add dependencies to melos.yaml

* feat: Upload file dialog - merge main

* fix dependencies

* fix web dependency

---------

Co-authored-by: Dominik Toton <[email protected]>
  • Loading branch information
digitalheartxs and dtscalac authored Oct 3, 2024
1 parent 0f060ac commit 6b23bbf
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 12 deletions.
21 changes: 16 additions & 5 deletions catalyst_voices/lib/widgets/modals/voices_desktop_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@ class VoicesSinglePaneDialog extends StatelessWidget {
final BoxConstraints constraints;
final Color? backgroundColor;
final bool showBorder;
final VoidCallback? onCancel;
final Widget child;

const VoicesSinglePaneDialog({
super.key,
this.constraints = const BoxConstraints(minWidth: 900, minHeight: 600),
this.backgroundColor,
this.showBorder = false,
this.onCancel,
required this.child,
});

@override
Widget build(BuildContext context) {
return _VoicesDesktopDialog(
backgroundColor: Theme.of(context).colors.iconsBackground,
showBorder: true,
backgroundColor: backgroundColor,
showBorder: showBorder,
constraints: constraints,
child: Stack(
children: [
child,
const _DialogCloseButton(),
_DialogCloseButton(
onCancel: onCancel,
),
],
),
);
Expand Down Expand Up @@ -121,7 +125,11 @@ class _VoicesDesktopDialog extends StatelessWidget {
}

class _DialogCloseButton extends StatelessWidget {
const _DialogCloseButton();
final VoidCallback? onCancel;

const _DialogCloseButton({
this.onCancel,
});

@override
Widget build(BuildContext context) {
Expand All @@ -134,7 +142,10 @@ class _DialogCloseButton extends StatelessWidget {
child: IconButtonTheme(
data: const IconButtonThemeData(style: buttonStyle),
child: XButton(
onTap: () => Navigator.of(context).pop(),
onTap: () {
onCancel?.call();
Navigator.of(context).pop();
},
),
),
);
Expand Down
Loading

0 comments on commit 6b23bbf

Please sign in to comment.