Last active
October 25, 2021 09:08
-
-
Save misterfourtytwo/7d7f4b94328d6a06055df3e6a8664912 to your computer and use it in GitHub Desktop.
wrap with padding
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'; | |
const 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( | |
color: Colors.amber[200], | |
height: 400, | |
width: 400, | |
child: Stack(children: [ | |
Positioned( | |
right: 0, | |
width: 32, | |
height: 28, | |
top: 0, | |
child: Placeholder(color: Colors.black), | |
), | |
Positioned.fill( | |
child: Wrap( | |
spacing: 8.0, | |
runSpacing: 4.0, | |
runAlignment: WrapAlignment.start, | |
alignment: WrapAlignment.end, | |
// direction: | |
textDirection: TextDirection.rtl, | |
children: [ | |
SizedBox(width: 20), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('AH')), | |
label: const Text('lton'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('ayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('fay'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('Lafayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('Lafayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('Lafay'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('ette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('ayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('ette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('LLL'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('Lafayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('ML')), | |
label: const Text('Lafayette'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('HM')), | |
label: const Text('Mulligan'), | |
), | |
Chip( | |
avatar: CircleAvatar( | |
backgroundColor: Colors.blue.shade900, | |
child: const Text('JL')), | |
label: const Text('Laurens'), | |
), | |
], | |
), | |
), | |
]), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment