Skip to content

Commit

Permalink
feat: 首页刷新todo成功会提示刷新成功
Browse files Browse the repository at this point in the history
  • Loading branch information
meowrain committed Oct 13, 2024
1 parent 95ea4bc commit 1621248
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/views/todolist/todolist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ class _TodoListState extends State<TodoList> {
}

Future<void> _refreshTodos() async {
//TODO: 刷新成功提示刷新成功
await context.read<Todoprovider>().syncTodoListProvider();
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text(
"同步成功!",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
),
behavior: SnackBarBehavior.floating,
duration: Duration(seconds: 1),
backgroundColor: Colors.green,
));
}

@override
Expand Down

0 comments on commit 1621248

Please sign in to comment.