mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-04-23 00:29:14 -04:00
38 lines
942 B
Dart
38 lines
942 B
Dart
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];
|
|
}
|