getWidgetsCollection method

  1. @override
Future<List<IotWidget>> getWidgetsCollection({
  1. String? jsonString,
})
override

Implementation

@override
Future<List<IotWidget>> getWidgetsCollection({String? jsonString}) async {
  if (jsonString != null) {
    try {
      var list = json.decode(jsonString) as List;
      return list.map((wgt) => IotWidget.fromJson(wgt)).toList();
    } catch (_) {
      throw 'Failed to get widgets collection';
    }
  }

  return [];
}