【发布时间】:2021-02-13 18:38:24
【问题描述】:
如何使用这些曲线在 Flutter 中进行此设计:https://i.stack.imgur.com/QMZrQ.png。我想知道是否应该使用剪贴画或堆栈小部件。因为元素在彼此之上。这有点令人困惑,因为一方面白色小部件在背面,另一方面,黑色小部件在白色小部件上
【问题讨论】:
标签: flutter user-interface dart mobile-application
如何使用这些曲线在 Flutter 中进行此设计:https://i.stack.imgur.com/QMZrQ.png。我想知道是否应该使用剪贴画或堆栈小部件。因为元素在彼此之上。这有点令人困惑,因为一方面白色小部件在背面,另一方面,黑色小部件在白色小部件上
【问题讨论】:
标签: flutter user-interface dart mobile-application
希望您指的是这种设计:
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,
),
),
],
),
);
}
}
【讨论】: