Last active
November 16, 2022 12:15
-
-
Save kmvignesh/d84c6af02527b81fd6fe0c60b0aa715c to your computer and use it in GitHub Desktop.
Container background color
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 StatefulWidget { | |
| const MyApp({Key? key}) : super(key: key); | |
| @override | |
| State<MyApp> createState() => _MyAppState(); | |
| } | |
| class _MyAppState extends State<MyApp> { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| home: Scaffold( | |
| body: Center( | |
| child: Column( | |
| children: [ | |
| Container( | |
| padding: const EdgeInsets.all(10), | |
| color: Colors.green, | |
| child: const Text('test'), | |
| ), | |
| const SizedBox(height: 10), | |
| Container( | |
| padding: const EdgeInsets.all(10), | |
| decoration: BoxDecoration( | |
| color: Colors.green, | |
| borderRadius: BorderRadius.circular(10), | |
| ), | |
| child: const Text('test'), | |
| ) | |
| ], | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment