parent
a54004736b
commit
0fcbc275cd
3 changed files with 326 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import "package:material_ui/material_ui.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/room_order.dart";
|
||||
import "package:nexus/models/typing_indicators.dart";
|
||||
|
||||
part "settings.freezed.dart";
|
||||
part "settings.g.dart";
|
||||
|
|
@ -16,6 +17,7 @@ class const Settings({
|
|||
final bool swipeToReply = false,
|
||||
final bool hideMembershipEvents = false,
|
||||
final RoomOrder roomOrder = .unreadFirst,
|
||||
final TypingIndicators typingIndicators = .showAndSend,
|
||||
}) with _$Settings {
|
||||
Map<String, Object?> toJson() => _$SettingsToJson(this);
|
||||
|
||||
|
|
|
|||
14
lib/models/typing.dart
Normal file
14
lib/models/typing.dart
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "typing.freezed.dart";
|
||||
part "typing.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable(createToJson: false)
|
||||
class const Typing({
|
||||
required final String roomId,
|
||||
final IList<String> userIds = const .empty(),
|
||||
}) with _$Typing {
|
||||
factory Typing.fromJson(Map<String, Object?> json) => _$TypingFromJson(json);
|
||||
}
|
||||
1
lib/models/typing_indicators.dart
Normal file
1
lib/models/typing_indicators.dart
Normal file
|
|
@ -0,0 +1 @@
|
|||
enum TypingIndicators { showAndSend, show, neither }
|
||||
Loading…
Reference in a new issue