A Redux Implementation With the New Kid on the Block: Flutter

A Redux Implementation With the New Kid on the Block: Flutter

A while ago my colleague, Victor, took an initial look at Flutter, a new framework for mobile development from Google. At the time Flutter was still in its early stages, the first beta having just been released. Here, we will look into how to extend an app with a Redux store, Thunk future actions, and the Redux Persistor.

A while ago my colleague, Victor, took an initial look at Flutter, a new framework for mobile development from Google. At the time Flutter was still in its early stages, the first beta having just been released. Here, we will look into how to extend an app with a Redux store, Thunk future actions, and the Redux Persistor.

What is Redux?

Redux is a container for a store of information for applications. It started with Redux for the React.js framework, where it alleviated a lot of the issues with passing information around the app tree. In React, just like in Flutter, an application is composed of components (in Flutter called Widgets), which are related to each other in a parent-child structure. The data flow is then top-down: the parent provides its children with prop(ertie)s and each component can have its own state.

Image for post

For small applications this is not a big problem — the data can be centralised at the root node, or just passed around with props. However, with any application that has any degree of complexity, this gets rather tricky. Take as an example, an online shopping app and its integral part — the shopping cart. The cart has to follow the user around any screen that they might navigate to, and sometimes even share its information with other components like a checkout page. Passing that data around, with easy access to its modification would be a lot of work. And here comes in Redux — a single source of truth that is accessible from any component within the app, no matter where it is in the tree.

A Redux store is therefore mostly just an object that holds information about the state of the app and handles its delivery and changes. Any component connected to the store can emit Actions — think API calls or reactions to user input — that take a copy of the current state and modify it. That new state is then committed to the store through the Reducers. After the commit, the changes are visible to every component that relies on them, triggering a re-rendering to reflect the shift in state.

Image for post

google flutter-app-development flutter app-development redux

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

Hire Flutter Developer

Are you looking for next-generation mobile applications to increase business benefits? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** is one of the most reputable mobile app development company, which provides Flutter...

Flutter – A Boon to Mobile App Developers

Flutter app development is in trend; ever since flutter - the mobile app development framework, has been helping app developers to build amazing applications.

Flutter App Development | Skenix Infotech

Hire Flutter Developers from foremost Flutter app development company, Skenix Infotech to get a full spectrum of cross-platform flutter development services.