Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
riverpod
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
You can find the code of the project up until now in this repository. So, let's go to our projects pubspec.yaml file and add the following packages.
With the Firebase Storage we will not use a default bucket to store images whose URL will be fetched to save on Firestore. So, what's up with this logic? You see google places API doesn't provide images, it's provided by details api. We'll not be using it. But instead, I have some random(4 in numbers) Hindu images that I downloaded from Unsplash, which I'll store in storage and fetch a random URL among images and assign it to the temple model. You don't have to do it and provide the hardcoded image URL for imageRef, but it's to practice reading storage.
I would recommend you to learn another state-management package since the provider is not a perfect one. There are only two packages I recommend either Riverpod or Bloc. There are other packages too which are good but I would learn animation and designs instead of learning state-management one after another.
As a part of the user-screen flow, we already have access to the user location. In this 10th chapter, we'll use the user's location to fetch the nearest twenty temples using google's Places API. We'll fetch places with the HTTP package, then we'll write another HTTPS Callable with Firebase Functions to store those temples in Firestore. Since we're using an API key, we'll use the flutter_dotenv package to keep it secret. Find the source code to start this section from here.
After creating an initial project, this chapter will walk through the steps to set up the app with a launch icon and also create and set a splash screen for our app with packages already available at Pub.Dev.
I would recommend you to learn another state-management package since the provider is not a perfect one. There are only two packages I recommend either Riverpod or Bloc. There are other packages too which are good but I would learn animation and designs instead of learning state-management one after another.
Related posts
- Exploring Speed Up Mobile App Development Approaches
- How use riverpod_generator on a class ? my todo property doesn't refresh on UI
- Maximizing Your Flutter App's Performance with (Async)NotifierProvider, Freezed & Riverpod Code Generators
- Am I super dumb or is Riverpod SO complicated?
- State Management in Flutter: Choosing the Right Approach for Your App.