Added a lobbyScreen to generate a unique Code and invite other Players and the possibility to workout together, by using the pocketbase realtime feature.
18 lines
555 B
Dart
18 lines
555 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'party.freezed.dart';
|
|
part 'party.g.dart';
|
|
|
|
@freezed
|
|
abstract class Party with _$Party {
|
|
const factory Party({
|
|
required String id,
|
|
required String code,
|
|
@JsonKey(name: 'host_id') required String hostId,
|
|
required String status, // 'waiting', 'active', 'finished'
|
|
@Default(0) @JsonKey(name: 'current_hp') int currentHp,
|
|
@Default(0) @JsonKey(name: 'max_hp') int maxHp,
|
|
}) = _Party;
|
|
|
|
factory Party.fromJson(Map<String, dynamic> json) => _$PartyFromJson(json);
|
|
}
|