Card Widget
/// Card widget : Card always expects a "child" widget
import "package:flutter/material.dart";
void main() {
runApp(MyApplication(),);
}
class MyApplication extends StatelessWidget {
MyApplication({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: "Card Widget in Flutter",
theme: ThemeData(
primarySwatch: Colors.brown,
),
home: CardDemo(),
);
}
}
class CardDemo extends StatelessWidget {
CardDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Card Widget"),
),
body: Center(child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Card(elevation: 30.0,
shadowColor: Colors.orange,
// shape: OutlineInputBorder(gapPadding: 50.0,),
// shape: LinearBorder(),
// shape: StadiumBorder(),
// shape: OvalBorder(),
// shape: UnderlineInputBorder(),
// shape: RoundedRectangleBorder(side: BorderSide(),),
child: Text("Hello World!!", style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold,),),
),
SizedBox(height: 80.0,),
Card(
elevation: 20.0,
shadowColor: Colors.brown,
color: Colors.brown,
child: ElevatedButton(
onPressed: (){},
child: Text("Click Here!"),
),
),
SizedBox(height: 80.0,),
Card(elevation: 20.0,
shadowColor: Colors.brown,
child: Text("Another Example",
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold,),),
),
],
),
),
);
}
}
Comments
Post a Comment