mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
This PR: - Updates the fidelity of the home screen and contact list screens to near full fidelity - Renames "Contact Lists" to "Contact Groups". We have multiple collections of contacts, so having lists of lists felt confusing - Adds more functionality to the data models Comparison of the two screens against native: | Native | Flutter | | --- | --- | | <img width="418" alt="Screenshot 2025-02-19 at 2 59 58 PM" src="https://github.com/user-attachments/assets/1cc53d19-6bb5-4782-82fa-1a62cd75fd51" /> | <img width="397" alt="Screenshot 2025-02-19 at 2 58 54 PM" src="https://github.com/user-attachments/assets/ddab75f2-4aec-4239-a736-690a3185c196" /> | | <img width="409" alt="Screenshot 2025-02-19 at 2 59 41 PM" src="https://github.com/user-attachments/assets/ee0d81ee-ae60-47ad-b071-266f39ce9b70" /> | <img width="402" alt="Screenshot 2025-02-19 at 2 58 45 PM" src="https://github.com/user-attachments/assets/88bf22f9-d8bd-40d7-a9ca-f2ded439de6c" /> | Notably the container widget on the first screen is a placeholder, until a Cupertino collapsable widget is made.
46 lines
1.1 KiB
Dart
46 lines
1.1 KiB
Dart
// Copyright 2018 The Flutter team. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
class Contact {
|
|
Contact({
|
|
required this.id,
|
|
required this.firstName,
|
|
this.middleName,
|
|
required this.lastName,
|
|
this.suffix,
|
|
});
|
|
|
|
final int id;
|
|
final String firstName;
|
|
final String lastName;
|
|
final String? middleName;
|
|
final String? suffix;
|
|
}
|
|
|
|
final johnAppleseed = Contact(id: 0, firstName: 'John', lastName: 'Appleseed');
|
|
final kateBell = Contact(id: 1, firstName: 'Kate', lastName: 'Bell');
|
|
final annaHaro = Contact(id: 2, firstName: 'Anna', lastName: 'Haro');
|
|
final danielHiggins = Contact(
|
|
id: 3,
|
|
firstName: 'Daniel',
|
|
lastName: 'Higgins',
|
|
suffix: 'Jr.',
|
|
);
|
|
final davidTaylor = Contact(id: 4, firstName: 'David', lastName: 'Taylor');
|
|
final hankZakroff = Contact(
|
|
id: 5,
|
|
firstName: 'Hank',
|
|
middleName: 'M.',
|
|
lastName: 'Zakroff',
|
|
);
|
|
|
|
final Set<Contact> allContacts = <Contact>{
|
|
johnAppleseed,
|
|
kateBell,
|
|
annaHaro,
|
|
danielHiggins,
|
|
davidTaylor,
|
|
hankZakroff,
|
|
};
|