88 lines
2.0 KiB
Dart
88 lines
2.0 KiB
Dart
// ignore_for_file: unnecessary_getters_setters
|
|
|
|
import '/backend/schema/util/schema_util.dart';
|
|
|
|
import 'index.dart';
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
|
|
class ActionStruct extends BaseStruct {
|
|
ActionStruct({
|
|
String? title,
|
|
String? icon,
|
|
}) : _title = title,
|
|
_icon = icon;
|
|
|
|
// "title" field.
|
|
String? _title;
|
|
String get title => _title ?? '';
|
|
set title(String? val) => _title = val;
|
|
|
|
bool hasTitle() => _title != null;
|
|
|
|
// "icon" field.
|
|
String? _icon;
|
|
String get icon => _icon ?? '';
|
|
set icon(String? val) => _icon = val;
|
|
|
|
bool hasIcon() => _icon != null;
|
|
|
|
static ActionStruct fromMap(Map<String, dynamic> data) => ActionStruct(
|
|
title: data['title'] as String?,
|
|
icon: data['icon'] as String?,
|
|
);
|
|
|
|
static ActionStruct? maybeFromMap(dynamic data) =>
|
|
data is Map ? ActionStruct.fromMap(data.cast<String, dynamic>()) : null;
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
'title': _title,
|
|
'icon': _icon,
|
|
}.withoutNulls;
|
|
|
|
@override
|
|
Map<String, dynamic> toSerializableMap() => {
|
|
'title': serializeParam(
|
|
_title,
|
|
ParamType.String,
|
|
),
|
|
'icon': serializeParam(
|
|
_icon,
|
|
ParamType.String,
|
|
),
|
|
}.withoutNulls;
|
|
|
|
static ActionStruct fromSerializableMap(Map<String, dynamic> data) =>
|
|
ActionStruct(
|
|
title: deserializeParam(
|
|
data['title'],
|
|
ParamType.String,
|
|
false,
|
|
),
|
|
icon: deserializeParam(
|
|
data['icon'],
|
|
ParamType.String,
|
|
false,
|
|
),
|
|
);
|
|
|
|
@override
|
|
String toString() => 'ActionStruct(${toMap()})';
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return other is ActionStruct && title == other.title && icon == other.icon;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => const ListEquality().hash([title, icon]);
|
|
}
|
|
|
|
ActionStruct createActionStruct({
|
|
String? title,
|
|
String? icon,
|
|
}) =>
|
|
ActionStruct(
|
|
title: title,
|
|
icon: icon,
|
|
);
|