updateAppChatTheme static method

Future<Map<String, dynamic>> updateAppChatTheme()

Implementation

static Future<Map<String, dynamic>> updateAppChatTheme() async {
  final response = await RemoteData.getWidgetSetting();
  final body = jsonDecode(response.body);
  final data = body['data'];
  if (response.statusCode == 200) {
    StaticData.mobileChatTheme['bgColorTheme'] =
        data['style']['theme']['bg_color'];
    StaticData.mobileChatTheme['bgColorThemeOverlaid'] =
        Util.getOverlaidColor(StaticData.mobileChatTheme['bgColorTheme'],
            Constant.OVERLAY_COLOR, Constant.OVERLAY_OPACITY);
    StaticData.mobileChatTheme['fontColor'] = Util.calculateTextColorOutput(
        StaticData.mobileChatTheme['bgColorTheme']);
    StaticData.mobileChatTheme['textHeader'] = data['header']['text'];
    StaticData.mobileChatTheme['textDescription'] =
        data['description']['text'];
  }
  return StaticData.mobileChatTheme;
}