applanga_flutter

A Flutter plugin for Applanga.

For a sample Usage see the example.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Usage

Installation

To use this plugin, add applanga_flutter as a dependency in your pubspec.yaml file.

Applanga settings file

Declare your applanga settings file in your pubspec.yaml as it is commented out in the attached example.

iOS: Be aware to add the supported languages to the info.plist. Find more here.

Import

import 'package:applanga_flutter/applanga_flutter.dart';

Methods

Note: The Flutter to native bridge is asynchronous. So all Methods are asynchronous calls.

ApplangaFlutter.getString("string_key", "default_message")

If string_key does not exists, default_message gets uploaded (see topic String Upload).

ApplangaFlutter.getUpdate()

Fetches changes from the dashboard and updates the local Applanga Database. You have to rerender your UI to see latest changes. Be aware that due to our CDN-Caching it can take up to 15 minutes to be able to fetch new translations.

ApplangaFlutter.localizeMap(
	{
		"en": {
			"hello_world": "Hello World"
		},
		"de" : {
			"hello_world": "Hallo Welt"
		}
	}
);

ApplangaFlutter.localizeMap(map) returns the same map but with the actual Applanga localizations.

String Upload

Strings from ApplangaFlutter.getString(String, String) and Strings which are located in the map of ApplangaFlutter.localizeMap(map), will be uploaded if the app is in debug mode and fulfill one of the two points: They are non existent on the Applanga Dashboard or the target text is empty.

Debug mode for iOS

Open your ios/*.xcodeproj or ios/*.xcworkspace in XCode and run your app.

Debug mode for Android

Open Android Studio, File - Open. android/ directory. Run "Debug 'app'".

Libraries

applanga_flutter

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]