Skip to main content

Modul kontaktů

Veškeré zdrojové soubory se nachází v ./contacts

ContactsWidget

class ContactsWidget extends StatelessWidget {
final String url;
const ContactsWidget({super.key, required this.url});
ParameterTypeDescription
urlStringZákladní URL Rest API

Metody

List<FItem> getItems(List<Contact> contacts)

Vytvoří seznam interaktivních kontaktů

Future<List<Contact>> fetchContacts()

Získá data kontaktu a uloží je do atributu contacts

Contact

class Contact {
final String name;
final String function;
final String phoneNumber;

Contact({
required this.name,
required this.function,
required this.phoneNumber,
});
ParameterTypeDescription
nameStringJméno osoby
functionStringPozice osoby
phoneNumberStringTelefoní číslo osoby

Metody

Contact.fromJson(Map<String, dynamic> json)

Pojmenováný konstruktor pro načtení z JSONu