Giter Site home page Giter Site logo

asc-lab / personal-insurance-flutter-poc Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 3.0 776 KB

Flutter project example covering concerns commonly encountered in business apps.

License: Other

Java 0.86% Objective-C 1.77% Dart 97.36%
dart flutter flutter-app insurance mobile-app mockoon

personal-insurance-flutter-poc's Introduction

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.


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
  • 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.

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
        <true/>
</dict>  

Otherwise this error is going to happen.

Cannot start load of Task <xx-xx>.<x> since it does not conform to ATS policy.

personal-insurance-flutter-poc's People

Contributors

ebytharon avatar scriptam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

personal-insurance-flutter-poc's Issues

Consider adapting API URL per Platform

Considering switching to the correct localhost loopback URI per platform. This will prevent the need to change the Helper.apiURL and recompile when switching across platform runs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.