simple_flutter_i18n 1.1.1+1-hotfix copy "simple_flutter_i18n: ^1.1.1+1-hotfix" to clipboard
simple_flutter_i18n: ^1.1.1+1-hotfix copied to clipboard

outdated

a package that makes it easy to have multiple langauges in your application

example/main.dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../lib/simple_flutter_i18n.dart';
import './screens/homeScreen.dart';

void main() => runApp(MyApp());

Map<String, dynamic> en = {'isRtl': false, 'welcome': "Welcome"};

class MyApp extends StatelessWidget {
  Widget _builder(context, child) {
    final isRtl = Provider.of<I18n>(context).isRtl;

    return Directionality(
      textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
      child: child,
    );
  }

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [ChangeNotifierProvider.value(value: I18n())],
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(),
        builder: _builder,
        home: HomeScreen(),
      ),
    );
  }
}
9
likes
0
pub points
0%
popularity

Publisher

unverified uploader

a package that makes it easy to have multiple langauges in your application

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, shared_preferences

More

Packages that depend on simple_flutter_i18n