Skip to content

Instantly share code, notes, and snippets.

View XeBastian's full-sized avatar
💻
Working from home

Ernest Sebastian XeBastian

💻
Working from home
View GitHub Profile
@XeBastian
XeBastian / language_repo.dart
Created January 14, 2023 09:46
Localization in flutter and persisting data to local storage
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 = {
@CoderNamedHendrick
CoderNamedHendrick / onboard_cards.dart
Last active January 22, 2022 09:17
Basic onboard cards
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) {
@eduardoflorence
eduardoflorence / main.dart
Last active November 14, 2024 06:21
Getx - Sample SuperController and FullLifeCycleController
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
page: () => HomePage(),
@naumanahmed19
naumanahmed19 / version-check.dart
Last active February 25, 2024 14:51
Flutter Force Update IOS and Android App Version
//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';