代码之家  ›  专栏  ›  技术社区  ›  Nikolay Suvandzhiev

在颤振中以模态出现?

  •  1
  • Nikolay Suvandzhiev  · 技术社区  · 8 年前

    如何在颤振中对路径进行模态表示?

    我知道如何使用通常的“推”转换导航到路线,但我正在努力实现模式转换。请参见附加的动画(使用本机iOS完成)。如何以模式呈现一个屏幕(一个本身可以被推到更多屏幕的屏幕)。

    请参见下面的示例。我正在挣扎的过渡是从“A”到“C”(当然,这也是一种将其忽略并返回“A”的方法)。

    enter image description here

    1 回复  |  直到 8 年前
        1
  •  28
  •   Anit Kumar    5 年前

    你可以这样推:

    Navigator.of(context).push(
            CupertinoPageRoute(
                    fullscreenDialog: true,
                    builder: (context) => SomePage(),
            ),
    );
    

    希望这有帮助。

        2
  •  23
  •   Zaid Pathan    7 年前

    去 B部分

    Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) => SectionBRoute()),
                  );
    

    去 (以模态呈现)动画可以通过以下方式实现:

    Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) => SectionCRoute(), fullscreenDialog: true),
                  );