dimanche 13 juin 2021

Can anyone please provide me some resources where flutter factory method is explained with various relevant examples and hands on practices

What is factory method(constructor) in flutter and what problem does it solve.

class TrialClass {
  TrialClass({this.property});
  factory TrialClass.fromMap(Map<String, Object> map) {
    return TrialClass(
      property: map['property'] as int,
    );
  }
  final int property;
}

Aucun commentaire:

Enregistrer un commentaire