Attach action to report bug on long press (#995)
This commit is contained in:
commit
5717473e20
|
@ -32,7 +32,7 @@ class EnteApp extends StatefulWidget {
|
|||
}) : super(key: key);
|
||||
|
||||
static void setLocale(BuildContext context, Locale newLocale) {
|
||||
_EnteAppState state = context.findAncestorStateOfType<_EnteAppState>()!;
|
||||
final state = context.findAncestorStateOfType<_EnteAppState>()!;
|
||||
state.setLocale(newLocale);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ class MenuItemWidget extends StatefulWidget {
|
|||
final double trailingExtraMargin;
|
||||
final FutureVoidCallback? onTap;
|
||||
final VoidCallback? onDoubleTap;
|
||||
final VoidCallback? onLongPress;
|
||||
final Color? menuItemColor;
|
||||
final bool alignCaptionedTextToLeft;
|
||||
|
||||
|
@ -74,6 +75,7 @@ class MenuItemWidget extends StatefulWidget {
|
|||
this.trailingExtraMargin = 0.0,
|
||||
this.onTap,
|
||||
this.onDoubleTap,
|
||||
this.onLongPress,
|
||||
this.menuItemColor,
|
||||
this.alignCaptionedTextToLeft = false,
|
||||
this.singleBorderRadius = 4.0,
|
||||
|
@ -144,6 +146,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
|
|||
: GestureDetector(
|
||||
onTap: _onTap,
|
||||
onDoubleTap: widget.onDoubleTap,
|
||||
onLongPress: widget.onLongPress,
|
||||
onTapDown: _onTapDown,
|
||||
onTapUp: _onTapUp,
|
||||
onTapCancel: _onCancel,
|
||||
|
@ -260,7 +263,9 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
|
|||
}
|
||||
|
||||
bool hasPassedGestureCallbacks() {
|
||||
return widget.onDoubleTap != null || widget.onTap != null;
|
||||
return widget.onDoubleTap != null ||
|
||||
widget.onTap != null ||
|
||||
widget.onLongPress != null;
|
||||
}
|
||||
|
||||
void _onTapUp(details) {
|
||||
|
|
|
@ -83,7 +83,7 @@ class SupportSectionWidget extends StatelessWidget {
|
|||
onTap: () async {
|
||||
await sendLogs(context, S.of(context).reportBug, bugsEmail);
|
||||
},
|
||||
onDoubleTap: () async {
|
||||
onLongPress: () async {
|
||||
final zipFilePath = await getZippedLogsFile(context);
|
||||
await shareLogs(context, bugsEmail, zipFilePath);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue