Last active
March 12, 2020 04:34
-
-
Save androidfanatic/df5a9fa5b395d38084ff71584404febf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// imports widgets from the material design | |
import 'package:flutter/material.dart'; | |
void main() => runApp(TodoApp()); | |
/// Stateless widgets must implement the build() method and return a widget. | |
/// The first parameter passed to build function is the context in which this widget is built | |
class TodoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'TODO', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: TodoList(), | |
); | |
} | |
} | |
/// Stateful widgets must implement the createState method | |
/// State of a stateless widget against has a build() method with context | |
class TodoList extends StatefulWidget { | |
@override | |
State<StatefulWidget> createState() => TodoListState(); | |
} | |
class TodoListState extends State<TodoList> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Todo'), | |
), | |
body: Text('Todo List'), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment