Skip to content

Instantly share code, notes, and snippets.

@kmvignesh
Last active November 16, 2022 12:15
Show Gist options
  • Select an option

  • Save kmvignesh/d84c6af02527b81fd6fe0c60b0aa715c to your computer and use it in GitHub Desktop.

Select an option

Save kmvignesh/d84c6af02527b81fd6fe0c60b0aa715c to your computer and use it in GitHub Desktop.
Container background color
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