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: 'Flutter Demo',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome'),
),
body: const Center(
child: Text(
'Hello World',
style: TextStyle(fontSize: 24),
),
),
),
);
}
}We use a MaterialApp as the root widget to provide material design styling. Inside it, a Scaffold gives us a basic page layout with an AppBar titled 'Welcome'. The main content is centered using Center, and inside it, a Text widget displays 'Hello World' with a font size of 24 to make it easy to read.