Skip to content

Commit 6b23bbf

Browse files
feat(cat-voices): Upload file dialog (#932)
* 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]>
1 parent 0f060ac commit 6b23bbf

File tree

17 files changed

+564
-12
lines changed

17 files changed

+564
-12
lines changed

catalyst_voices/lib/widgets/modals/voices_desktop_dialog.dart

+16-5
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,30 @@ class VoicesSinglePaneDialog extends StatelessWidget {
1010
final BoxConstraints constraints;
1111
final Color? backgroundColor;
1212
final bool showBorder;
13+
final VoidCallback? onCancel;
1314
final Widget child;
1415

1516
const VoicesSinglePaneDialog({
1617
super.key,
1718
this.constraints = const BoxConstraints(minWidth: 900, minHeight: 600),
1819
this.backgroundColor,
1920
this.showBorder = false,
21+
this.onCancel,
2022
required this.child,
2123
});
2224

2325
@override
2426
Widget build(BuildContext context) {
2527
return _VoicesDesktopDialog(
26-
backgroundColor: Theme.of(context).colors.iconsBackground,
27-
showBorder: true,
28+
backgroundColor: backgroundColor,
29+
showBorder: showBorder,
2830
constraints: constraints,
2931
child: Stack(
3032
children: [
3133
child,
32-
const _DialogCloseButton(),
34+
_DialogCloseButton(
35+
onCancel: onCancel,
36+
),
3337
],
3438
),
3539
);
@@ -121,7 +125,11 @@ class _VoicesDesktopDialog extends StatelessWidget {
121125
}
122126

123127
class _DialogCloseButton extends StatelessWidget {
124-
const _DialogCloseButton();
128+
final VoidCallback? onCancel;
129+
130+
const _DialogCloseButton({
131+
this.onCancel,
132+
});
125133

126134
@override
127135
Widget build(BuildContext context) {
@@ -134,7 +142,10 @@ class _DialogCloseButton extends StatelessWidget {
134142
child: IconButtonTheme(
135143
data: const IconButtonThemeData(style: buttonStyle),
136144
child: XButton(
137-
onTap: () => Navigator.of(context).pop(),
145+
onTap: () {
146+
onCancel?.call();
147+
Navigator.of(context).pop();
148+
},
138149
),
139150
),
140151
);

0 commit comments

Comments
 (0)