Skip to content

Commit e983da1

Browse files
committed
SDK Dialogs #2
- Add more options for show dialog action. - Enable navigation arrows for show dialog action.
1 parent ae38f13 commit e983da1

13 files changed

+45
-18
lines changed

lib/src/api/models/action/action.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ enum ActionType {
1010
/// Navigate to a page.
1111
navigation,
1212

13+
/// Show a dialog.
14+
showDialog,
15+
1316
/// Open a link.
1417
link,
1518

@@ -32,10 +35,7 @@ enum ActionType {
3235
callApi,
3336

3437
/// Update data in local storage.
35-
setStorage,
36-
37-
/// Show a dialog.
38-
showDialog;
38+
setStorage;
3939

4040
/// Displayable string representation of the [ActionType].
4141
String get prettify {

lib/src/api/models/action/api_call_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/call_function_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/link_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/navigation_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/set_storage_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/set_value_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/set_variable_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/set_variant_action.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/show_dialog_action.dart

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ import 'package:codelessly_json_annotation/codelessly_json_annotation.dart';
66
import 'package:equatable/equatable.dart';
77

88
import '../../mixins.dart';
9-
import '../condition.dart';
10-
import 'action.dart';
9+
import '../models.dart';
1110

1211
part 'show_dialog_action.g.dart';
1312

1413
/// An action that navigates to a new page.
1514
@JsonSerializable()
1615
class ShowDialogAction extends ActionModel
1716
with EquatableMixin, SerializableMixin {
18-
1917
/// Destination canvas node's ID.
2018
final String destinationId;
2119

@@ -25,27 +23,45 @@ class ShowDialogAction extends ActionModel
2523
/// Whether the dialog is dismissible by tapping outside the dialog.
2624
final bool barrierDismissible;
2725

26+
/// Color of the barrier that is shown behind the dialog.
27+
final ColorRGBA? barrierColor;
28+
29+
/// Whether to show a close button on the dialog.
30+
final bool showCloseButton;
31+
2832
/// Creates a new [ShowDialogAction].
2933
ShowDialogAction({
3034
required this.destinationId,
3135
Map<String, String>? params,
36+
this.barrierColor = ColorRGBA.black54,
3237
this.barrierDismissible = true,
38+
this.showCloseButton = false,
3339
}) : params = {...params ?? {}},
3440
super(type: ActionType.showDialog);
3541

3642
@override
37-
List<Object?> get props => [destinationId, params, barrierDismissible];
43+
List<Object?> get props => [
44+
destinationId,
45+
params,
46+
barrierDismissible,
47+
barrierColor,
48+
showCloseButton,
49+
];
3850

3951
/// Duplicates this [ShowDialogAction] with given data overrides.
4052
ShowDialogAction copyWith({
4153
String? destinationId,
4254
Map<String, String>? params,
4355
bool? barrierDismissible,
56+
ColorRGBA? barrierColor,
57+
bool? showCloseButton,
4458
}) =>
4559
ShowDialogAction(
4660
destinationId: destinationId ?? this.destinationId,
4761
params: {...this.params, ...params ?? {}},
4862
barrierDismissible: barrierDismissible ?? this.barrierDismissible,
63+
barrierColor: barrierColor ?? this.barrierColor,
64+
showCloseButton: showCloseButton ?? this.showCloseButton,
4965
);
5066

5167
/// Creates a new [ShowDialogAction] instance from a JSON data.

0 commit comments

Comments
 (0)