settingListItem method

void settingListItem()

Implementation

void settingListItem() async {
  settingList.clear();
  if (GetStorage().hasData("setting")) {
    var map = await GetStorage().read("setting");
    var map1 = jsonDecode(map) as List;

    for (int i = 0; i < map1.length; i++) {
      var conferenceModelList = <SettingModel>[];

      var subList = map1[i]['settingList'] as List;
      for (int j = 0; j < subList.length; j++) {
        conferenceModelList
            .add(SettingModel(subList[j]['name'], subList[j]['isStatus']));
      }
      settingList.add(SettingModelList(map1[i]['name'], conferenceModelList));
      print("asdsd ${map1[i]['settingList']}");
    }
  } else {
    var conferenceModelList = <SettingModel>[];
    conferenceModelList
        .add(SettingModel("Ask To Confirm When Leaving Meeting", false));
    conferenceModelList.add(SettingModel("Auto Copy Invite Link", false));
    conferenceModelList.add(SettingModel("Show My Connected Time", false));
    settingList
        .add(SettingModelList("Conference Settings", conferenceModelList));

    var meetingSoundsList = <SettingModel>[];
    meetingSoundsList.add(SettingModel("New Chat Message", false));
    meetingSoundsList.add(SettingModel("Beep on Entry", false));
    meetingSoundsList.add(SettingModel("Beep on Exit", false));
    meetingSoundsList.add(SettingModel("Start Recording", false));
    meetingSoundsList.add(SettingModel("Stop Recording", false));
    meetingSoundsList.add(SettingModel("End of Meeting", false));
    settingList.add(SettingModelList("Meeting Sounds", meetingSoundsList));

    // settingList.toString()

    String jsonString = jsonEncode(settingList);
    print("GetStorage ${jsonString}");

    GetStorage().write("setting", jsonString);
  }
}