Created
June 25, 2020 12:31
-
-
Save velotiotech/b3b0ee39b55e27e8979f0097b83c0584 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