Skip to content

Commit 6b31ae1

Browse files
[APP-9877] Implement button functionality (pose) (#442)
* add pose widget * add pose functionality * use theme data * use pose instead of list
1 parent 8fb0762 commit 6b31ae1

File tree

3 files changed

+210
-86
lines changed

3 files changed

+210
-86
lines changed

lib/src/utils.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:fixnum/fixnum.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
24
import 'package:grpc/grpc.dart';
35
import 'package:logger/logger.dart';
46

@@ -121,3 +123,19 @@ String getVersionMetadata() {
121123

122124
return 'flutter;$sdkVersion;$apiTag';
123125
}
126+
127+
/// Show an error dialog with one action: OK, which simply dismisses the dialog
128+
Future<void> showErrorDialog(BuildContext context, {String title = 'An Error Occurred', String? error}) async {
129+
return showAdaptiveDialog(
130+
context: context,
131+
builder: (context) => AlertDialog.adaptive(
132+
title: Text(title),
133+
content: error == null ? null : Text(error),
134+
actions: [
135+
PlatformDialogAction(
136+
onPressed: Navigator.of(context).pop,
137+
child: Text('OK'),
138+
)
139+
],
140+
));
141+
}

0 commit comments

Comments
 (0)