onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  _dio = Dio(
    BaseOptions(
      connectTimeout: 30 * 1000,
      receiveTimeout: 30 * 1000,
      // baseUrl: Urls.baseUrl,
      // headers: {
      //   'accept': 'text/plain',
      //   'LanguageCode': get_network.Get.locale!.languageCode.capitalizeFirst,
      //   'Platform': 'Mobile'
      // },
    ),
  );
  if (!kReleaseMode) {
    _dio?.interceptors.add(LoggingInterceptor());
  }
  super.onInit();
}