Skip to content
A simple Flutter app for showing stories from Hacker News using MobX and provider
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android Revert "bump dependencies" Jun 7, 2019
fonts remove unused font and update how placeholder story is rendered, upda… May 12, 2019
ios check in pod related updates May 30, 2019
lib replace usages of scaffolds Jun 14, 2019
.gitignore initial check in May 12, 2019
.metadata initial check in May 12, 2019
LICENSE Initial commit May 11, 2019
README.md add codemagic badge Jun 14, 2019
pubspec.lock bump provider to 3.0.0 Jun 7, 2019
pubspec.yaml bump provider to 3.0.0 Jun 7, 2019

README.md

supnews

Codemagic build status Get it on Google Play

A simple Flutter app for displaying stories retrieved from Hacker News. Uses the provider package along with MobX to managing the architecture

The app demonstrates

  • Using MobX for managing UI state where stores function as view models that may talk to other services i.e. how to follow the widget -> store -> service structure
  • Using provider organise stores and inject them into the appropriate widgets. Services are injected into the stores via provider as well. Both of these are done using the Consumer widget (and Consumer2 when injecting in two dependencies)
  • Using provider to resolve dependencies using the static Provider.of<T>(context) method
  • How to load more items into a ListView based on scroll position by invoking an action in MobX
  • Opening stories using the url_launcher package with the ability to load them in the browser instead of doing so "in-app"
  • Toggling between dark and light theme
  • Using custom fonts
  • Using a Cupertino widgets within a material app

When trying to debug on your machine via an Android device, you'll currently need to go to android/app/build.gradle and modify the contents to comment out/remove the store release related configuration. The latter configuration is there as I currently have this setup with Codemagic to deploy to the Google Play store. The relevant sections look like as follows

// beginning of config for store release
signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled true
        useProguard true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
// end of config related to store release

// for debugging
/*buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}*/

After modifying it so it can be debugged, it'll look like as follows

// beginning of config for store release
/*signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled true
        useProguard true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}*/
// end of config related to store release

// for debugging
buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

Attributions

Google Play and the Google Play logo are trademarks of Google LLC.

You can’t perform that action at this time.