Last active
April 1, 2021 20:03
-
-
Save shumiyao/6ef547a692c0af483a16c1f7ba2e3a28 to your computer and use it in GitHub Desktop.
Wrap Test
This file contains 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue), | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Center( | |
child: MyWidget(), | |
), | |
), | |
); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
padding: EdgeInsets.all(0), | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(52), | |
border: Border.all(width: 7, color: Color(0xffFFD1A3)), | |
color: Color(0xffFFFFFF), | |
shape: BoxShape.rectangle, | |
boxShadow: [ | |
BoxShadow( | |
color: Colors.black.withOpacity(0.2), | |
blurRadius: 0.5, | |
offset: Offset(1, 1), | |
spreadRadius: 1), | |
BoxShadow( | |
color: Colors.white.withOpacity(0.6), | |
blurRadius: 0.5, | |
offset: Offset(-1, -1), | |
spreadRadius: 1), | |
], | |
), | |
margin: EdgeInsets.only(left: 12, right: 12, top: 2, bottom: 2), | |
child: Container( | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(48), | |
border: Border.all(width: 7, color: Color(0xffFFFFDB)), | |
color: Color(0xffFFFFFF), | |
shape: BoxShape.rectangle, | |
gradient: RadialGradient( | |
colors: [ | |
Color(0xffFFC1A3).withOpacity(0.2), | |
Color(0xffFFEDBF).withOpacity(0.2), | |
Color(0xffFFD1A3).withOpacity(0.2) | |
], | |
center: Alignment(0.6, -0.3), | |
focal: Alignment(0.3, -0.1), | |
focalRadius: 1.0, | |
), | |
), | |
padding: EdgeInsets.all(5), | |
margin: EdgeInsets.all(0), | |
child: Wrap( | |
direction: Axis.vertical, | |
alignment: WrapAlignment.spaceEvenly, | |
crossAxisAlignment: WrapCrossAlignment.center, | |
spacing: 10, | |
children: [ | |
Text("Text Line 1", | |
textAlign: TextAlign.center, | |
style: TextStyle(fontSize: 32,color: Color(0xFF555555))), | |
Text( 'Text Line 2', | |
textAlign: TextAlign.center, | |
style: TextStyle(fontSize: 24,color: Color(0xFF555555))), | |
], | |
)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment