0% found this document useful (0 votes)
12 views

Main Dart

This document shows how to build a basic Flutter app using MaterialApp, Scaffold, AppBar and other widgets. It imports necessary packages and defines a StatelessWidget class with a build method that returns the widget tree.

Uploaded by

kisalovey78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Main Dart

This document shows how to build a basic Flutter app using MaterialApp, Scaffold, AppBar and other widgets. It imports necessary packages and defines a StatelessWidget class with a build method that returns the widget tree.

Uploaded by

kisalovey78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import 'package:flutter/material.

dart';

void main() {
runApp(const MyApp());
}

// With Flutter, you create user interfaces by combining "widgets"


// You'll learn all about them (and much more) throughout this course!
class MyApp extends StatelessWidget {
const MyApp({super.key});

// Every custom widget must have a build() method


// It tells Flutter, which widgets make up your custom widget
// Again: You'll learn all about that throughout the course!
@override
Widget build(BuildContext context) {
// Below, a bunch of built-in widgets are used (provided by Flutter)
// They will be explained in the next sections
// In this course, you will, of course, not just use them a lot but
// also learn about many other widgets!
return MaterialApp(
title: 'Flutter First App',
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: const [
Text(
'Flutter - The Complete Guide',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy