Decoration Property is used to set Container.
- Border
- Border Radius
- Border Shadow
Example
import 'package:flutter/material.dart';
void main(List<String> args) {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
// backgroundColor: Colors.amber,
appBar: AppBar(
backgroundColor: Colors.black,
title: const Text("Container"),
centerTitle: true,
),
body: Center(
child: Container(
// margin: EdgeInsets.all(20),
// padding: EdgeInsets.all(30),
// color: Colors.red,
height: 200,
width: 250,
decoration: BoxDecoration(
color: Colors.amber,
border: Border.all(
color: const Color.fromARGB(255, 212, 6, 6),
width: 5,
style: BorderStyle.solid),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(40),
bottomRight: Radius.circular(40)),
boxShadow: const [
BoxShadow(color: Colors.black, offset: Offset(6, 6))
]),
child: const Center(
child: Text(
"welcome",
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
),
),
),
));
}
No comments:
Post a Comment