fayaz07/ots

Migration guide from progress_dialog to otis?

Opened this issue · 2 comments

Is there a guide or can you tell me how I can migrate this code to OTS?

  ProgressDialog _contextProgressDialog({required BuildContext context}) {
    var dialog = ProgressDialog(context, type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
    dialog.style(
      messageTextStyle:
          TextWidgetComposer.montserratStyle(fontSize: 16.0, fontColor: Colors.black, fontWeight: FontWeight.w600),
      backgroundColor: Colors.white,
      progressWidget: ImageWidgetComposer.myCustomLoaderAnimatedImage(),
      insetAnimCurve: Curves.decelerate,
    );

    return dialog;
  }

Hi @robert-sperse ,

One thing I can suggest you is, create a widget(as the dialog you wrote in your code) and embed it as a loader widget while configuring the OTS widget

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return OTS(
      showNetworkUpdates: true,
      persistNoInternetNotification: false,
      bottomInternetNotificationPadding: 16.0,
      /// pass your custom loader here
      loader: CustomWidget(),
//      child: MaterialApp(
//      title: 'OTS Test',
//        home: Home(),
//      ),
      child: CupertinoApp(
        title: 'OTS Test',
        home: Home(),
      ),
    );
  }
}

Assuming the snippet was helpful and closing this. Feel free to re-open