This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LanguageRepo { | |
// contains all the values. | |
// for readability when the translations are too much, consider moving all translations to their own files like | |
// en_US.dart and assign the en_US in the following line to the referenced value | |
static Map<String, String> en_US = { | |
"hello": "Hello", | |
"good_morning": "Good Morning", | |
"i_love_you": "I Love you", | |
}; | |
static Map<String, String> ny_NY = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
void main() { | |
runApp(GetMaterialApp( | |
initialRoute: '/home', | |
getPages: [ | |
GetPage( | |
name: '/home', | |
page: () => HomePage(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Prompt users to update app if there is a new version available | |
//Uses url_launcher package | |
import 'package:url_launcher/url_launcher.dart'; | |
const APP_STORE_URL = | |
'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=YOUR-APP-ID&mt=8'; | |
const PLAY_STORE_URL = | |
'https://play.google.com/store/apps/details?id=YOUR-APP-ID'; |