refactor: Use adaptive dialog action
This commit is contained in:
parent
416cdc139f
commit
d1e211adee
9 changed files with 60 additions and 25 deletions
|
|
@ -14,6 +14,7 @@ import 'package:fluffychat/utils/localized_exception_extension.dart';
|
|||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/utils/size_string.dart';
|
||||
import 'package:fluffychat/widgets/adaptive_dialog_action.dart';
|
||||
import '../../utils/resize_video.dart';
|
||||
|
||||
class SendFileDialog extends StatefulWidget {
|
||||
|
|
@ -288,14 +289,12 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|||
title: Text(sendStr),
|
||||
content: contentWidget,
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// just close the dialog
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
},
|
||||
AdaptiveDialogAction(
|
||||
onPressed: () =>
|
||||
Navigator.of(context, rootNavigator: false).pop(),
|
||||
child: Text(L10n.of(context).cancel),
|
||||
),
|
||||
TextButton(
|
||||
AdaptiveDialogAction(
|
||||
onPressed: _send,
|
||||
child: Text(L10n.of(context).send),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:geolocator/geolocator.dart';
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/chat/events/map_bubble.dart';
|
||||
import 'package:fluffychat/widgets/adaptive_dialog_action.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
|
||||
class SendLocationDialog extends StatefulWidget {
|
||||
|
|
@ -114,12 +115,12 @@ class SendLocationDialogState extends State<SendLocationDialog> {
|
|||
title: Text(L10n.of(context).shareLocation),
|
||||
content: contentWidget,
|
||||
actions: [
|
||||
TextButton(
|
||||
AdaptiveDialogAction(
|
||||
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
||||
child: Text(L10n.of(context).cancel),
|
||||
),
|
||||
if (position != null)
|
||||
TextButton(
|
||||
AdaptiveDialogAction(
|
||||
onPressed: isSending ? null : sendAction,
|
||||
child: Text(L10n.of(context).send),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue