https://github.com/flutter/flutter
Flutter Logo (Google): https://flutter.io/
In this flutter video tutorial, we take a look at one of the older projects; the geolocation weather application. In the nine months since this application was initially built, the main Geolocation flutter library was depreciated and dropped by its maintainer. As a result it has become completely incompatible with Dart 2.0 and Flutter's release candidate. Along with finding a new geolocation based Library for this application, we update the other dependencies, which includes removing old deprecated APIs.
When a library is abandoned by it's maintainer, there are a few options that a developer can take: they can replace the library, build their own replacement or fork the original library. Since the main idea of this application is centered around being able to determine the user's location a library like Geolocation is mandatory. The Dart community is fairly prolific and its ecosystem is rapidly changing therefore it makes sense to find a new library. We want this new library to have a similar API to the old Geolocation Library so that we don't have to make a large amount of changes to the business logic of our application. To locate a new library, we can make use of the Dart Packages website.
The new library that was chosen for this particular application is called Geolocator. This library has a very similar API to the other Geolocation library. It has the ability to give us location data via streams and futures. We also have the ability to modify the location accuracy along with a few other important options. The library gives us access to longitude and latitude values which is precisely what we need in this case. Above is the main logic for finding the GPS status and location using this library. As with before, we want to determine whether or not the application has access to location services. Afterwards, we also want to be able to then get a future with the new positional data inside of it.
When this application was originally built, the RxCommand and RxWidget libraries were in their infancy. RxCommand featured a large amount of functions which determined the type of RxCommand that the user could create based on the input function. These originaly functions had names like async1 or sync3 based on whether or not the input function was asynchronous, had parameters, and had return values. After nine months and the release of Flutter 1.0, the API for this library has changed with the older functions being replaced.
In the above image, we can see some of the new RxCommand constructor names. Rather then name the constructors by number, there are more descriptive names. For example, if the input function doesn't contain any parameters, has a return type and is asynchronous, then the RxCommand constructor would be called createAsyncNoParam. Also, each RxCommand function now features an optional canExecute field to allow the developer to combine boolean observable with the resulting command stream. This new feature along with a plethora of other optional parameters gives the developer fine grain control over the RxCommands in a way that simply wasn't possible with the original API.
The Source Code for this video may be found here: https://github.com/tensor-programming/Weather_Tutorial/tree/tensor-programming-patch-4
Stand Alone Projects:
- Dart Flutter Cross Platform Chat Application Tutorial
- Building a Temperature Conversion Application using Dart's Flutter Framework
- Managing State with Flutter Flux and Building a Crypto Tracker Application with Dart's Flutter Framework
Utopian Rocks Example
- Advanced Flutter Project - Setting Up the Basic Structure - Part One
- Advanced Flutter Project - Adding a Second BloC - Part Two
- Advanced Flutter Project - Best Practices - Generic BLoC Providers - Part Three
- Advanced Flutter Project - Adding Fonts and Fuzzy Timestamps - Part Four
- Advanced Flutter Project - Filtering Contributions and Building Aesthetics - Part Five
Building a Calculator
- Building a Calculator Layout using Dart's Flutter Framework
- Finishing our Calculator Application with Dart's Flutter Framework
Movie Searcher Application
- Building a Movie Searcher with RxDart and SQLite in Dart's Flutter Framework (Part 1)
- Building a Movie Searcher with RxDart and SQLite in Dart's Flutter Framework (Part 2)
- Building a Movie Searcher with RxDart and SQLite in Dart's Flutter Framework (Part 3, Final)
Minesweeper Game
- Building a Mine Sweeper Game using Dart's Flutter Framework (Part 1)
- Building a Mine Sweeper Game using Dart's Flutter Framework (Part 2)
- Building a Mine Sweeper Game using Dart's Flutter Framework (Part 3)
- Building a Mine Sweeper Game using Dart's Flutter Framework (Part 4, Final)
Redux Todo App