【问题标题】:How can I convert CSS From Figma to Flutter?如何将 CSS 从 Figma 转换为 Flutter?
【发布时间】:2021-10-28 22:54:44
【问题描述】:

我使用 Figma,我需要创建一个带有下一个 CSS 属性的按钮

background: #FFA01F;
box-shadow: inset 12px -9px 20px rgba(0, 0, 0, 0.4);
border-radius: 100px;

【问题讨论】:

  • 给我们看figma照片你懂的

标签: css flutter figma


【解决方案1】:

您可以使用 Container 作为按钮的替代品,并使用BoxDecoration 来创建与它类似的东西。

 Container(
     decoration: BoxDecoration(
          color: const Color(#FFA01F),
          borderRadius: BorderRadius.circular(12),
          boxShadow: [
             BoxShadow(
               color: Colors.red,
               blurRadius: 2,
               offset: Offset(2, 4),  //position               
              )
          ]
     ),
  )

【讨论】:

  • 我已经做了,但我不知道如何定义盒子阴影属性
  • 我举了一个盒子阴影属性的例子,也许你可以尝试阅读文档以获取更多信息。
猜你喜欢
  • 2021-09-08
  • 2023-02-01
  • 1970-01-01
  • 2023-02-03
  • 2022-10-18
  • 2021-09-19
  • 2021-04-21
  • 2023-02-04
  • 2021-09-02
相关资源
最近更新 更多