MeCard.wifi constructor

MeCard.wifi({
  1. required String ssid,
  2. String type = 'WPA',
  3. String? password,
  4. bool hidden = false,
})

Create a WIFI MeCard type can be WEP or WPA

Implementation

factory MeCard.wifi({
  required String ssid,
  String type = 'WPA',
  String? password,
  bool hidden = false,
}) {
  final fields = <MeTuple>[];

  fields.add(MeTuple('S', ssid));

  if (password != null) {
    fields.add(MeTuple('T', type));
    fields.add(MeTuple('P', password));
  }
  if (hidden == true) {
    fields.add(MeTuple.bool('H', true));
  }

  return MeCard(type: 'WIFI', fields: fields);
}