【问题标题】:How to achieve this kind of a design in Flutter? [closed]如何在 Flutter 中实现这种设计? [关闭]
【发布时间】:2021-02-13 18:38:24
【问题描述】:

如何使用这些曲线在 Flutter 中进行此设计:https://i.stack.imgur.com/QMZrQ.png。我想知道是否应该使用剪贴画或堆栈小部件。因为元素在彼此之上。这有点令人困惑,因为一方面白色小部件在背面,另一方面,黑色小部件在白色小部件上

【问题讨论】:

    标签: flutter user-interface dart mobile-application


    【解决方案1】:

    希望您指的是这种设计:

    class _SingInScreenState extends State<SingInScreen> {
    double height;
    double width;
    @override
    Widget build(BuildContext context) {
      height = MediaQuery.of(context).size.height;
      width = MediaQuery.of(context).size.width;
      return Scaffold(
        body: Column(
          children: [
            Container(
              height: height * .4,
              decoration: BoxDecoration(
                color: Colors.black,
                borderRadius: BorderRadius.only(
                  bottomRight: Radius.circular(50),
                ),
              ),
            ),
            Container(
              height: height * .6,
              color: Colors.black,
              child: Container(
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(50),
                  ),
                ),
                height: height * .5,
              ),
            ),
          ],
        ),
      );
    }
    

    }

    【讨论】:

    • 完美,谢谢兄弟。从来没有想过有 3 个容器。好主意,完美运行
    猜你喜欢
    • 2019-01-09
    • 2021-09-13
    • 1970-01-01
    • 2021-08-14
    • 2015-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-21
    相关资源
    最近更新 更多