Skip to content

Commit

Permalink
Updated deprecated widgets with new one
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh-technocrat committed Feb 1, 2021
1 parent 2f6767f commit 5460e7e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 67 deletions.
2 changes: 1 addition & 1 deletion testing_app/lib/screens/favorites.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FavoriteItemTile extends StatelessWidget {
icon: Icon(Icons.close),
onPressed: () {
Provider.of<Favorites>(context, listen: false).remove(itemNo);
Scaffold.of(context).showSnackBar(
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Removed from favorites.'),
duration: Duration(seconds: 1),
Expand Down
2 changes: 1 addition & 1 deletion testing_app/lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ItemTile extends StatelessWidget {
!favoritesList.items.contains(itemNo)
? favoritesList.add(itemNo)
: favoritesList.remove(itemNo);
Scaffold.of(context).showSnackBar(
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(favoritesList.items.contains(itemNo)
? 'Added to favorites.'
Expand Down
Loading

0 comments on commit 5460e7e

Please sign in to comment.