Skip to content

Instantly share code, notes, and snippets.

@Vanethos
Created January 13, 2020 08:19
Show Gist options
  • Save Vanethos/863bd0d9ca9d13c3d79315de1cce7583 to your computer and use it in GitHub Desktop.
Save Vanethos/863bd0d9ca9d13c3d79315de1cce7583 to your computer and use it in GitHub Desktop.
// main_common.dart
// This will hold all the common logic to be used in each application
void mainCommon(Config config) async {
// Ensure that the Flutter Framework is available to access
await WidgetsFlutterBinding.ensureInitialized();
SharedPreferences prefs = await SharedPreferences.getInstance();
final r = prefs.getInt('r');
final g = prefs.getInt('g');
final b = prefs.getInt('b');
final color = Color.fromRGBO(r, g, b, 1.0);
runApp(
MyApp(config, color)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment