Card Widget
import "package:flutter/material.dart";
void main()
{
runApp(const MyApp());
}
class MyApp extends StatelessWidget
{
const MyApp({super.key});
@override
Widget build(BuildContext context)
{
return MaterialApp(
title: "Hello",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.teal,
),
home: const FlutterApp(),
);
}
}
class FlutterApp extends StatelessWidget
{
const FlutterApp({super.key});
@override
Widget build(BuildContext context)
{
return Scaffold(
appBar: AppBar(
title: const Text("Hello Flutter Application",
style: TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
backgroundColor: Colors.grey,
),
body: const Center(
child: Card( //"Card" Widget provides shadow. creates illusion.
shadowColor: Colors.red, //"shadow" gives desired color shadow effect.
elevation: 12, //"elevation" gives shadow size.
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text("Hello, How are you ?"),
)),
),
);
}
}
Comments
Post a Comment