ClipOval Widget in Flutter
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: "ClipOval",
debugShowCheckedModeBanner: false,
theme: ThemeData(
appBarTheme: const AppBarTheme(
backgroundColor: Colors.grey,
centerTitle: true,
),
),
home: const ClipOvalPractice(),
);
}
}
class ClipOvalPractice extends StatelessWidget {
const ClipOvalPractice({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(
"ClipOval",
style: TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
),
body: Center(
child: ClipOval(
child:
Image.asset("assets/images/Natural_image.jpg", fit: BoxFit.cover),
),
),
);
}
}
Comments
Post a Comment