We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab7b2ed commit 971b602Copy full SHA for 971b602
lib/main.dart
@@ -19,8 +19,7 @@ class Home extends StatefulWidget {
19
}
20
21
class _HomeState extends State<Home> {
22
- List<Map> _todoList = [];
23
-
+ List<dynamic> _todoList = [];
24
Map<String, dynamic> _ultimoRemovido;
25
int _ultimoRemovidoPosicao;
26
@@ -163,7 +162,12 @@ class _HomeState extends State<Home> {
163
162
164
Future<File> _getArquivo() async {
165
final diretorio = await getApplicationDocumentsDirectory();
166
- return File("${diretorio.path}/tarefas.json");
+ final archive = File("${diretorio.path}/tarefas.json");
+ if (archive.existsSync()) {
167
+ return archive;
168
+ } else {
169
+ return File("${diretorio.path}/tarefas.json");
170
+ }
171
172
173
Future<File> _saveTarefas() async {
0 commit comments