SafeArea Widget Example 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: "SafeArea Widget",
debugShowCheckedModeBanner: false,
theme: ThemeData(
appBarTheme: const AppBarTheme(
backgroundColor: Colors.grey,
centerTitle: true,
),
),
home: const SafeAreaExample(),
);
}
}

class SafeAreaExample extends StatelessWidget {
const SafeAreaExample({super.key});

@override
Widget build(BuildContext context) {
return SafeArea(
child: Container(
color: Colors.white,
child: const Text(
"Hello World",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
);
}
}


Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Stack Container Scrollable Card widget UI with Custom Widget

Pagination with Bloc Pattern in Flutter