updateTheme method

dynamic updateTheme(
  1. int id, {
  2. bool isInit = false,
})

Implementation

updateTheme(int id, {bool isInit = false}) {
  staticThemeId = id;
  if (id == 1) {
    backColor = cVioletishColor;
    fontColor = Colors.black;
  } else if (id == 2) {
    backColor = cBluishColor;
    fontColor = Colors.black;
  } else if (id == 3) {
    backColor = Colors.white;
    fontColor = Colors.black;
  } else if (id == 4) {
    backColor = Colors.black;
    fontColor = Colors.white;
  } else {
    backColor = cPinkishColor;
    fontColor = Colors.black;
  }

  gs.write(libTheme, id);

  if (!isInit) {
    Navigator.of(context).pop();
    controllerPaging.paginate();
    updateUI();
  }
}