-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.dart
More file actions
20 lines (17 loc) · 789 Bytes
/
main.dart
File metadata and controls
20 lines (17 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import 'package:flutter/material.dart';
void main() { // Main method from where the `main.dart` is executed
// runApp() is a method through which the app is actually run.
runApp(
HelloFlutterApp()
// HelloFlutterApp is the name of the class in which the logic(code) of the app is written
);
}
class HelloFlutterApp extends StatelessWidget {
// We declare a class `HelloFlutterApp` which extends to (inherits from) the
// `StatelessWidget` class.
// `StatelessWidget` class is used to build apps whose data and properties don't change.
@override // overriding the default build method of `StatelessWidget` base class
Widget build(BuildContext context) { // a method to build the widget structure of the flutter app
return Text('Hello'); // Main code
}
}