All Projects → MaikuB → supnews

MaikuB / supnews

Licence: BSD-3-Clause license
A simple Flutter app for showing stories from Hacker News using MobX and provider

Programming Languages

dart
5743 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language
shell
77523 projects
java
68154 projects - #9 most used programming language

supnews

Codemagic build status

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

NOTE: when the app was originally written, the ProxyProvider class wasn't available yet in the provider package. It should be possible to update the app to make of use of it

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].