This file contains hidden or 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
_fetchLocale() async { | |
var prefs = await SharedPreferences.getInstance(); | |
if (prefs.getString('languageCode') == null) { | |
return null; | |
} | |
print('_fetchLocale():' + | |
(prefs.getString('languageCode') +':' + prefs.getString('countryCode'))); | |
return Locale( |
This file contains hidden or 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
localizationsDelegates: [ | |
AppLocalizationsDelegate(), | |
GlobalMaterialLocalizations.delegate, | |
GlobalWidgetsLocalizations.delegate, | |
], | |
supportedLocales: [ | |
const Locale('en', ''), // English | |
const Locale('hi', ''), // Hindi | |
], | |
locale: locale, |
This file contains hidden or 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
void _updateLocale(String lang, String country) async { | |
var prefs = await SharedPreferences.getInstance(); | |
prefs.setString('languageCode', lang); | |
prefs.setString('countryCode', country); | |
MyApp.setLocale(context, Locale(lang, country)); | |
} |
This file contains hidden or 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
dependencies: | |
flutter: | |
sdk: flutter | |
flutter_localizations: | |
sdk: flutter |
This file contains hidden or 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
package adhoc.successive.com.fluttergallaryplugin; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.app.Application; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.database.Cursor; | |
import android.net.Uri; |
This file contains hidden or 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 Flutter | |
import UIKit | |
import Photos | |
public class SwiftFlutterGallaryPlugin: NSObject, FlutterPlugin { | |
public static func register(with registrar: FlutterPluginRegistrar) { | |
let channel = FlutterMethodChannel(name: "image_gallery", binaryMessenger: registrar.messenger()) | |
let instance = SwiftFlutterGallaryPlugin() | |
registrar.addMethodCallDelegate(instance, channel: channel) | |
} |
This file contains hidden or 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 'dart:io'; | |
import 'dart:async'; | |
import 'package:flutter/services.dart'; | |
import 'package:image_gallery/image_gallery.dart'; | |
void main() => runApp( | |
new MyApp()); |
NewerOlder