Last active
July 11, 2023 15:23
-
-
Save richard457/31d5183ebab41bbbc06895a06715e73e to your computer and use it in GitHub Desktop.
Rounded shape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const FigmaToCodeApp()); | |
} | |
// Generated by: https://www.figma.com/community/plugin/842128343887142055/ | |
class FigmaToCodeApp extends StatelessWidget { | |
const FigmaToCodeApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.dark().copyWith( | |
scaffoldBackgroundColor: const Color.fromARGB(255, 18, 32, 47), | |
), | |
home: Scaffold( | |
body: ListView(children: [ | |
Shapes(), | |
]), | |
), | |
); | |
} | |
} | |
class Shapes extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
children: [ | |
Container( | |
width: 59, | |
height: 59, | |
clipBehavior: Clip.antiAlias, | |
decoration: ShapeDecoration( | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(24), | |
), | |
), | |
child: Stack( | |
children: [ | |
Positioned( | |
left: 0, | |
top: 0, | |
child: Container( | |
width: 59, | |
height: 59, | |
decoration: ShapeDecoration( | |
color: Colors.black.withOpacity(0.00009999999747378752), | |
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)), | |
), | |
), | |
), | |
Positioned( | |
left: 0, | |
top: 0, | |
child: Container( | |
width: 59, | |
height: 59, | |
decoration: ShapeDecoration( | |
color: Colors.red, | |
shape: RoundedRectangleBorder( | |
side: BorderSide( | |
width: 0.12, | |
strokeAlign: BorderSide.strokeAlignCenter, | |
), | |
), | |
), | |
child: Stack( | |
children: [ | |
Positioned( | |
left: 0, | |
top: 0, | |
child: Container( | |
width: 59, | |
height: 59, | |
decoration: ShapeDecoration( | |
shape: RoundedRectangleBorder( | |
side: BorderSide( | |
width: 0.12, | |
strokeAlign: BorderSide.strokeAlignCenter, | |
), | |
), | |
), | |
child: Stack( | |
children: [ | |
Positioned( | |
left: 0, | |
top: 0, | |
child: Container( | |
width: 59, | |
height: 59, | |
decoration: BoxDecoration( | |
color: Colors.red, | |
), | |
), | |
), | |
], | |
), | |
), | |
), | |
Positioned( | |
left: 0, | |
top: 0, | |
child: Container(width: 59, height: 59), | |
), | |
], | |
), | |
), | |
), | |
], | |
), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment