mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 14:10:37 -04:00
ui cleanup
This commit is contained in:
parent
d460a0388c
commit
77c68aa45f
57 changed files with 1158 additions and 914 deletions
37
lib/contacts/models/contact_spec.dart
Normal file
37
lib/contacts/models/contact_spec.dart
Normal file
|
@ -0,0 +1,37 @@
|
|||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
import '../../proto/proto.dart' as proto;
|
||||
|
||||
@immutable
|
||||
class ContactSpec extends Equatable {
|
||||
const ContactSpec({
|
||||
required this.nickname,
|
||||
required this.notes,
|
||||
required this.showAvailability,
|
||||
});
|
||||
|
||||
ContactSpec.fromProto(proto.Contact p)
|
||||
: nickname = p.nickname,
|
||||
notes = p.notes,
|
||||
showAvailability = p.showAvailability;
|
||||
|
||||
Future<proto.Contact> updateProto(proto.Contact old) async {
|
||||
final newProto = old.deepCopy()
|
||||
..nickname = nickname
|
||||
..notes = notes
|
||||
..showAvailability = showAvailability;
|
||||
|
||||
return newProto;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
final String nickname;
|
||||
final String notes;
|
||||
final bool showAvailability;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [nickname, notes, showAvailability];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue