Рет қаралды 19,520
Take your Flutter skills to the next level with this Flutter tutorial. Learn how to apply SOLID principles and manage data from a remote API with ease using the Repository Pattern and Clean Architecture framework. You'll come away with the tools to create cleaner, more scalable code that's easy to maintain and update in your own Flutter projects.
☺ Support the channel:
Any donation is gratefully received, thank you!
- Via my website: davidserrano.io/sponsor
- Via KZfaq's Super Thanks (⬆ Button labeled THANKS above ⬆)
🔔 Subscribe:
Subscribe to my channel to see more videos like this:
www.youtube.com/@david-serrano...
📖 Useful resources:
- Remote API used in this tutorial:
rapidapi.com/SAdrian/api/movi...
- Quicktype (quickly convert JSON to Dart entities):
app.quicktype.io/
- Open source project created in this video:
github.com/svprdga/Flutter-Mo...
📖 Flutter libraries used:
- In this tutorial, freezed is used to generate the domain models:
pub.dev/packages/freezed
- Data models are autogenerated with json_serializable:
pub.dev/packages/json_seriali...
- The logger package is used to write to the log:
pub.dev/packages/logger
- The provider package is used for dependency injection and state management:
pub.dev/packages/provider
- Images are displayed and cached with the cached_network_image package:
pub.dev/packages/cached_netwo...
- Internationalization and language-related tools:
pub.dev/packages/intl
- You can create an infinite scrollable list with infinite_scroll_pagination:
pub.dev/packages/infinite_scr...
- We will use sqflite to work with a local database:
pub.dev/packages/sqflite
🔵 Follow me:
Find out about my latest videos and publications:
davidserrano.io/
/ svprdga
hashnode.com/@svprdga
dev.to/svprdga
mastodon.social/@svprdga
⏳ Timecodes:
00:00 - Introduction
02:15 - Project setup & domain model creation with freezed
06:27 - Create the network entity models
08:07 - Map network entities to domain models
10:45 - Create the API client with dio
15:21 - Create the Movie Repository
19:13 - Load local configuration & setup dependency injection tree
26:10 - Create MoviePreview widget
30:26 - Infinite scrollable list with infinite_scroll_pagination
33:47 - Create the database entities
36:37 - Database mapper & Data Access Objects (DAO)
41:38 - Adjust the repository to work with the database
44:50 - Synchronize the local database with new data available in the API
50:34 - Dart analyze, Dart format, and final conclusion