Initial (redacted) commit.
This commit is contained in:
commit
655f8a036a
368 changed files with 20949 additions and 0 deletions
31
app/lib/sembast/hydration.dart
Normal file
31
app/lib/sembast/hydration.dart
Normal file
|
@ -0,0 +1,31 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'hydration.freezed.dart';
|
||||
part 'hydration.g.dart';
|
||||
|
||||
@freezed
|
||||
class Hydration with _$Hydration {
|
||||
const factory Hydration({
|
||||
required String widgetType,
|
||||
required String name,
|
||||
required int button1Amount,
|
||||
required int button2Amount,
|
||||
required int goal,
|
||||
required int current,
|
||||
required bool isExpanded,
|
||||
required bool isVisible,
|
||||
required String createdOn,
|
||||
required String completedOn,
|
||||
@Default(-1) int id,
|
||||
}) = _Hydration;
|
||||
|
||||
factory Hydration.fromJson(Map<String, Object?> json) =>
|
||||
_$HydrationFromJson(json);
|
||||
}
|
||||
|
||||
extension JsonWithoutId on Hydration {
|
||||
Map<String, dynamic> toJsonWithoutId() {
|
||||
final map = toJson()..remove('id');
|
||||
return map;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue