库比蒂诺风格 showModalBottomSheet

发布于 2025-01-18 14:33:31 字数 381 浏览 0 评论 0原文

我想问一下默认情况下是否有库比蒂诺风格的“ Showmodalbottomsheet”?我正在为iOS设计该应用程序,这是我要在应用程序的“添加记录”过程中包含的内容之一。

我想实现这一目标:

”在此处输入图像描述“

在iOS上也有动画紧密,其中背景屏幕“放大了一点”。

我以为它将是库比蒂诺包装的一部分,但我还没有找到它。

感谢您提供的任何指导/帮助!

I wanted to ask if there is any Cupertino style “showModalBottomSheet” available by default in Flutter? I’m designing the app for iOS and that’s one of the things I want to include for my “Add record” process of the app.

I would like to achieve this:

enter image description here

On iOS there is also animation tight to that where background screen is “zoomed out a bit”.

I would thought that it will be part of the Cupertino package but I haven’t found it there.

Appreciate any guidance/help you can provide!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖树树初阳… 2025-01-25 14:33:31

使用showcupertinomodalpopup,

导入“软件包:flutter/cupertino.dart”之前。

use showCupertinoModalPopup,

import 'package:flutter/cupertino.dart' before using it.

听,心雨的声音 2025-01-25 14:33:31

根据您的要求修改此内容

showBottomModalDialog({
        required BuildContext context,
        required bool isLight,
        required List<Widget> children,
      }) {
        showCupertinoModalPopup(
            barrierDismissible: false,
            context: context,
            builder: (BuildContext modalContext) => Container(
                height: Get.height * 0.90,
                decoration: BoxDecoration(
                  color: isLight
                      ? LightThemeColors.white
                      : DarkThemeColors.cardBackground,
                  borderRadius:
                      const BorderRadius.vertical(top: Radius.circular(25.0)),
                ),
                child: Material(
                    borderRadius:
                        const BorderRadius.vertical(top: Radius.circular(25.0)),
                    color: isLight
                        ? LightThemeColors.white
                        : DarkThemeColors.cardBackground,
                    child: Column(
                        mainAxisSize: MainAxisSize.max, children: children))));
      }

Modify this as your requirements

showBottomModalDialog({
        required BuildContext context,
        required bool isLight,
        required List<Widget> children,
      }) {
        showCupertinoModalPopup(
            barrierDismissible: false,
            context: context,
            builder: (BuildContext modalContext) => Container(
                height: Get.height * 0.90,
                decoration: BoxDecoration(
                  color: isLight
                      ? LightThemeColors.white
                      : DarkThemeColors.cardBackground,
                  borderRadius:
                      const BorderRadius.vertical(top: Radius.circular(25.0)),
                ),
                child: Material(
                    borderRadius:
                        const BorderRadius.vertical(top: Radius.circular(25.0)),
                    color: isLight
                        ? LightThemeColors.white
                        : DarkThemeColors.cardBackground,
                    child: Column(
                        mainAxisSize: MainAxisSize.max, children: children))));
      }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文