Add new flutter example of todo app with provider (#78)

This commit is contained in:
Rene Lazo Mendez
2021-07-25 14:51:35 -04:00
committed by GitHub
parent dd23466cd4
commit 89f48b8f1e
74 changed files with 1637 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
class Todo extends ChangeNotifier {
final String id;
String title;
bool done;
Todo({@required this.id, this.title, this.done = false});
/// Toggles the value of the item and notify to listeners
void toggle() {
this.done = !this.done;
notifyListeners();
}
}