Skip to content

Instantly share code, notes, and snippets.

@richard457
Last active July 11, 2023 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richard457/31d5183ebab41bbbc06895a06715e73e to your computer and use it in GitHub Desktop.
Save richard457/31d5183ebab41bbbc06895a06715e73e to your computer and use it in GitHub Desktop.
Rounded shape
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