Created
February 15, 2023 20:48
-
-
Save kostasoft/e06478f9afa051f3dbfde0aebef5c414 to your computer and use it in GitHub Desktop.
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(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| Widget item(String title, String text, Color background) => ColoredBox( | |
| color: background, | |
| child: Column( | |
| mainAxisSize: MainAxisSize.min, | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| ColoredBox( | |
| color: Colors.blueGrey, | |
| child: Padding(padding: const EdgeInsets.all(8.0), child: Text(title)), | |
| ), | |
| Padding(padding: const EdgeInsets.all(8.0), child: Text(text)), | |
| ])); | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter App', | |
| home: Scaffold( | |
| backgroundColor: Colors.white, | |
| body: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| item('1111', '222222222', Colors.grey), | |
| const SizedBox(height: 8.0), | |
| item('11111111111', '222', Colors.grey), | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment