Haskell FrontEnd UI Flutter Backend Logic

To make Flutter and Haskell interoperate for backend development, you can use a combination of the following approaches:

  1. RESTful APIs: One common approach is to build a RESTful API in Haskell that exposes endpoints for your Flutter frontend to communicate with. Haskell has several web frameworks, such as Yesod, Servant, and Scotty, which can help you build RESTful APIs easily. You can define routes, handle requests, and process data in Haskell, and then communicate with the backend API using HTTP requests from your Flutter application.
  2. JSON Serialization: Since both Haskell and Flutter support JSON, you can use JSON serialization to exchange data between the backend and frontend. Haskell has libraries like aeson and servant, which provide JSON serialization and deserialization capabilities. On the Flutter side, you can use libraries like http or dio to make HTTP requests to the backend API and handle JSON serialization and deserialization.
  3. gRPC: Another option is to use gRPC for communication between the Haskell backend and the Flutter frontend. gRPC is a high-performance, open-source framework that allows you to define service interfaces and generate client and server code in multiple languages. Haskell has gRPC libraries such as gRPC-haskell, and Flutter has Dart support for gRPC as well. This approach provides a more efficient and type-safe way of communication compared to RESTful APIs.
  4. GraphQL: GraphQL is a query language and runtime that enables efficient data fetching and flexible API design. You can use Haskell libraries like Hasura or graphql-api to build GraphQL APIs on the backend. On the Flutter side, there are various GraphQL client libraries like graphql_flutter or gql to interact with the backend API and perform GraphQL queries and mutations.

These approaches provide different levels of integration between Haskell and Flutter, and the choice depends on the specific needs of your project. RESTful APIs are widely used and provide good interoperability, while gRPC and GraphQL offer more advanced features but require additional setup and tooling. Evaluate the requirements of your application and the strengths of each approach to determine the most suitable method for your Haskell and Flutter integration.

When Flutter does not save you – Level Up Coding

Flutter (or the other similar Framework “React-Native” ) is only doing its best at UI for single-code development in multi-platform (iOS, Android).

When you need to add on some non-UI features in your apps (eg. customized QR-code, customized foreign language keyboard, etc), you need to develop in native codes (C/C++… ) then called by Flutter / React-Native (Which Choice ? )

https://levelup.gitconnected.com/when-flutter-does-not-save-you-c8fcefc6ba93

Flutter vs React Native vs Xamarin or Native Codes: Which is the best choice for 2019?

Mobile Apps developed for cross-platform : iOS, Android, Web… (Huawei HongMengOS ? )

  1. Flutter (Google) — Dart
  2. Xamarin (Microsoft) — C#
  3. React Native (Facebook) —Javascript

https://towardsdatascience.com/flutter-vs-react-native-vs-xamarin-which-is-the-best-choice-for-2019-2bc30fc76442

The above analysis for the 3 tools is neutral – beauty is in the eye of the beholder – they are more or less the same family based on current Object-Oriented paradigm.

However, I would recommend a 4th option with additional future-promising Functional Pragramming (FP) paradigm for multi-platform mobile apps:

4. Native Codes in C++ (Version 17) with Standard Template Library.

  • C++ can be developed in Android Studio, called by Java / Kotlin / Flutter via JNI interface.
  • Or in React Native IDE.
  • IEEE 2019 Ranking : C++ / C is ranked 3rd popular language behind Python (1st) & Java (2nd), but it is unique in multi-paradigm & multi-platform, an advantage compared to the others.

“The dawn of a new era in app development”

[Source: please read the below link:]

“The dawn of a new era in app development” by gk_ https://link.medium.com/fDulXo3zWZ

The dilemma of maintaining 4 code bases for multi-platfofms:

  1. iOS,
  2. Android,
  3. Windows,
  4. Web.

Key Points:

  • Cross-platform tools for Web / Native codes.
  • Google’s future Android-replacement Fuchsia OS (OO&FP Logic : C++/C, Phone UI: Dart, Web: Rust, Server: Go) Flutter framework for iOS / Android / Windows / Web [Notice: the conspicuous absense of Java]

华为 鸿蒙 Huawei HongMeng‘s answer : “1+8+N” iOT multi-platforms (which will soon obsolete Apple iOS & Google Android)

  1. Smart HD TV (out in August 2019)
  2. Mobile Phones / Notepads (April 2020 Huawei P40)
  3. Driverless Car
  4. PC Desktop
  5. Earphones
  6. AI Sound boxes
  7. Virtual Reality (VR)
  8. Wearables
  9. (+ N) All iOT devices

Remark:

C++ version 17 (Standard Template Library STL‘ for Functional Programming) is multi-paradigm : Imperative, OO & FP. It curently supports Android as Native codes (ie bypass JVM).

Flutter Tutorial

1. Best Introduction : Start From the Basics

https://medium.freecodecamp.org/an-introduction-to-flutter-the-basics-9fe541fd39e2

Useful tips (Android Studio)

“Comd S” : Hot Reload

“Comd – >” : rotate iPhone simulator 90 degree

2. Coding Tutorials

2.1 Layouts

Widget Tree:

https://flutter.io/docs/development/ui/layout#flutters-approach-to-layout

2.2 More (… eg. Regex Validation Input)

View at Medium.com

Google Cross-platform Mobile App Tool : Flutter 1.0

Today 4 Dec 2018 is a “Big Day” with Flutter 1.0 finally out from Beta. Just like Kotlin was announced by Google in 2017 to substitute the painful old Java.

Flutter is the UI design tool for next Google secretive OS “Fuchsia” to replace Android.

https://www.theverge.com/platform/amp/2018/12/4/18125053/google-flutter-1-0-skia-mobile-app-cross-platform-developers