Гость
Радиус границы незатронутый флаттер
Сообщение
Гость » 14 мар 2024, 04:48
Я пытаюсь преобразовать пользовательский интерфейс Figma во флаттер, эллипс не позволяет контейнеру уменьшать радиус под одним углом.
вот пользовательский интерфейс Figma:
Код, который я пытаюсь:
Код: Выделить всё
child: Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x40000000),
spreadRadius: 4.0,
blurRadius: 4.0,
offset: Offset(-5.0, 4.0),
),
],
borderRadius: BorderRadius.all(Radius.circular(15.0)),
),
alignment: Alignment.center,
child: Stack(
children: [
Positioned(
top: -92.26,
left: -117.71,
child: Container(
height: 183.47,
width: 170.36,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
blurRadius: 100,
spreadRadius: 6,
color: Color.fromARGB(255, 125, 223, 247),
),
],
),
),
),
],
),
),
The result is giving:
Источник:
https://stackoverflow.com/questions/781 ... ed-flutter
1710380909
Гость
Я пытаюсь преобразовать пользовательский интерфейс Figma во флаттер, эллипс не позволяет контейнеру уменьшать радиус под одним углом. вот пользовательский интерфейс Figma: [img]https://i.stack.imgur.com/LzyMF.png[/img] Код, который я пытаюсь: [code]child: Container( decoration: BoxDecoration( boxShadow: [ BoxShadow( color: Color(0x40000000), spreadRadius: 4.0, blurRadius: 4.0, offset: Offset(-5.0, 4.0), ), ], borderRadius: BorderRadius.all(Radius.circular(15.0)), ), alignment: Alignment.center, child: Stack( children: [ Positioned( top: -92.26, left: -117.71, child: Container( height: 183.47, width: 170.36, decoration: BoxDecoration( shape: BoxShape.circle, boxShadow: [ BoxShadow( blurRadius: 100, spreadRadius: 6, color: Color.fromARGB(255, 125, 223, 247), ), ], ), ), ), ], ), ), [/code] The result is giving: [img]https://i.stack.imgur.com/CIgTH.png[/img] Источник: [url]https://stackoverflow.com/questions/78157263/border-radius-unaffected-flutter[/url]