# 01 Flutter: Hello World

## **Displaying Hello World on the screen**

{% code title="main.dart" %}

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(
    new Center(
      child: new Text(
        'Hello, world!'
      ),
    ),
  );
}
```

{% endcode %}

![](https://155039435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGEPVmc__fR1yWV7R5B%2F-LGEPdughN-CN-5gf0LC%2F-LGEQwhTEeUN1DryLgmQ%2Fflutter-hello-world-512x1024.png?alt=media\&token=1997bfcb-ddcb-42bf-9668-cfd1082be685)

## **Hello World app using a Stateless widget**

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(
    new MaterialApp(
      title: 'Hello World App',
      home: new myApp(),
    )
  );
}

class myApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Hello World App'),
      ),
      body: new Center(
        child: new Text(
          'Hello, world!'
        ),
      ),
    );
  }
}
```

![](https://155039435-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGEPVmc__fR1yWV7R5B%2F-LGEPdughN-CN-5gf0LC%2F-LGERDSl6CYu7KEfbZxq%2Fflutter-stateless-widget-512x1024.png?alt=media\&token=d08fec57-4932-4501-bdde-8e33d27cd4e1)
