showAdaptiveDialog static method

void showAdaptiveDialog({
  1. required BuildContext context,
  2. Key? key,
  3. Widget? title,
  4. String? barrierLabel,
  5. bool useRootNavigator = true,
  6. bool barrierDismissible = false,
  7. RouteSettings? routeSettings,
  8. Offset? anchorPoint,
  9. Widget? content,
  10. List<Widget> actions = const <Widget>[],
  11. ScrollController? scrollController,
  12. ScrollController? actionScrollController,
  13. Duration insetAnimationDuration = const Duration(milliseconds: 100),
  14. Curve insetAnimationCurve = Curves.decelerate,
})

Implementation

static void showAdaptiveDialog({
  required BuildContext context,
  Key? key,
  Widget? title,
  String? barrierLabel,
  bool useRootNavigator = true,
  bool barrierDismissible = false,
  RouteSettings? routeSettings,
  Offset? anchorPoint,
  Widget? content,
  List<Widget> actions = const <Widget>[],
  ScrollController? scrollController,
  ScrollController? actionScrollController,
  Duration insetAnimationDuration = const Duration(milliseconds: 100),
  Curve insetAnimationCurve = Curves.decelerate,
}){
  if(TencentCloudChatPlatformAdapter().isIOS || TencentCloudChatPlatformAdapter().isMacOS){
    showCupertinoDialog(
      context: context,
      barrierDismissible: barrierDismissible,
      useRootNavigator: useRootNavigator,
      barrierLabel: barrierLabel,
      routeSettings: routeSettings,
      anchorPoint: anchorPoint,
      builder: (_) => CupertinoAlertDialog(
        title: title,
        content: content,
        actions: actions,
        scrollController: scrollController,
        actionScrollController: actionScrollController,
        insetAnimationCurve: insetAnimationCurve,
        insetAnimationDuration: insetAnimationDuration,
        key: key,
      ),
    );
  } else{
    showDialog(
      barrierDismissible: barrierDismissible,
      useRootNavigator: useRootNavigator,
      barrierLabel: barrierLabel,
      routeSettings: routeSettings,
      anchorPoint: anchorPoint,
      context: context,
      builder: (_) => AlertDialog(
        title: title,
        content: content,
        actions: actions,
        key: key,
      ),
    );
  }
}