Рет қаралды 206
In this video, we'll implement the functionality to add a new note and at the same time, we'll use the Provider package to manage the app state. You'll learn how to use the Consumer as well as the Selector widget to granularly listen to state changes and rebuild the widgets.
You'll also learn how to add a dialog and also avoid accidental back navigation.
Like & subscribe to get the upcoming videos of the series, on time!
Source code 👨🏻💻: github.com/sm-sayedi/awesome_...
Links 🔗 used in the video
pub.dev/packages/flutter_quill
pub.dev/packages/provider
pub.dev/packages/intl
api.flutter.dev/flutter/intl/...
Timecodes (Chapters)
00:00:00 - Introduction
00:01:04 - Migrate the flutter-quill to the new version
00:15:17 - Solve the keyboard-focus bug
00:17:07 - Create model class for Note
00:20:17 - Add Provider as the state management solution
00:22:09 - Use ChangeNotifierProvider widget
00:23:40 - Use Consumer widget
00:28:48 - Manage the absence of notes
00:30:02 - Add an asset-image to the app
00:34:35 - Manage creating notes seperately
00:35:38 - Introduce a Change Notifier for creating notes
00:39:32 - Use Selector widget
00:47:42 - Properly use provider in initstate
00:50:06 - Collect title, content, and tags for creating a note
00:56:19 - Create a dialog for adding tags to the note
01:12:00 - Validate user input using GlobalKey
01:24:24 - Properly use Selector widget with List
01:30:03 - Add a note
01:37:00 - Use DateFormat from intl package to format date
01:42:13 - Prevent empty notes from adding
01:45:09 - Prevent accidental back navigation
01:56:02 - Refactor the code
01:58:58 - Final words
#flutter #fluttertutorial #provider #consumer #selector #firebase #flutterfirebase #firestore