Skip to content

Commit 1244b1b

Browse files
author
Pedro Girardi
committed
Contact - non-nullable attributes
1 parent 2e5f704 commit 1244b1b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/model.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ class ExchangeParams {
140140

141141
@immutable
142142
class Contact {
143-
final String? name;
144-
final Address? address;
143+
final String name;
144+
final Address address;
145145

146146
Contact({
147147
required this.name,

lib/screen/account.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ class _AccountScreenBodyState extends State<AccountScreenBody> {
227227
print('Alias $alias');
228228

229229
final _newContact = Contact(
230-
name: alias,
231-
address: address,
230+
name: alias!,
231+
address: address!,
232232
);
233233

234234
_appState.addContact(_newContact, isPersistent: true);

lib/screen/new_contact.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class _NewContactScreenBodyState extends State<NewContactScreenBody> {
9595
if (_formKey.currentState!.validate()) {
9696
context.read<AppState>().addContact(
9797
Contact(
98-
name: _name,
99-
address: _address,
98+
name: _name!,
99+
address: _address!,
100100
),
101101
isPersistent: true,
102102
);

0 commit comments

Comments
 (0)