An open API service indexing awesome lists of open source software.

https://github.com/asc-lab/personal-insurance-flutter-poc

Flutter project example covering concerns commonly encountered in business apps.
https://github.com/asc-lab/personal-insurance-flutter-poc

dart flutter flutter-app insurance mobile-app mockoon

Last synced: 13 days ago
JSON representation

Flutter project example covering concerns commonly encountered in business apps.

Awesome Lists containing this project

README

        

# Flutter PoC: Personal Insurance

A Flutter project example covering concerns commonly encountered in business apps.




## Blog Post

https://altkomsoftware.pl/blog/flutter-dart-quickly-build-mobile-app-without-losing-much-hair/

# Dependency

The application attempts to access a running Mockoon Mock API at startup. If the local server is not running, application will simply fail with a blank screen.

- Mockoon
- https://mockoon.com/
- https://github.com/mockoon/mockoon
- e.g. MacOS Install: `brew cask install mockoon`


# Running

- Ensure Mockoon Environment is configured with `mockoon_environment` - (import JSON into Mockoon).
- Ensure Mockoon is running locally
- Ensure API routes are accessible on `0.0.0.0` i.e. `localhost`, `127.0.0.1`
- e.g. http://localhost:3000/personalInsuranceFlutter/getDicts
- Ensure the `apiURL` static field in `lib/services/Helper` class is correctly set
- Localhost setting for `apiURL` for The Android and iOS will differ, see below.
- The helper will auto-adapt the `apiURL` based on `Platform`.


If the local server is not running, application will show an error on startup.



## Android

- `apiURL = "http://10.0.2.2:3000/personalInsuranceFlutter/";`
- Ensure the emulator can access `localhost` via `10.0.2.2` in Dart code.


## iOS

- `apiURL = "http://localhost:3000/personalInsuranceFlutter/";`

The iOS Simulator uses the host machine network so you should be able to just use `localhost` or your machines IP address, whichever IP your web service is listening on.

More info on https://stackoverflow.com/questions/6077888/how-do-i-access-the-host-machine-itself-from-the-iphone-simulator

You will need to add the following to the project's `Info.plist`.

```
NSAppTransportSecurity

NSAllowsArbitraryLoads


```

Otherwise this error is going to happen.

```
Cannot start load of Task . since it does not conform to ATS policy.
```