transliteration 0.0.6 copy "transliteration: ^0.0.6" to clipboard
transliteration: ^0.0.6 copied to clipboard

Transliteration package which transliterates "English" to more than 20 languagues.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:transliteration/response/transliteration_response.dart';
import 'package:transliteration/transliteration.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Transliteration Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String hindiTransliterations = '';

  setHindiTransliteration() async {
    TransliterationResponse _response =
        await Transliteration.transliterate("Hello", Languages.HINDI);
    hindiTransliterations = _response.transliterationSuggestions.toString();
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    setHindiTransliteration();
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Hello will be Transliterated in Hindi : ',
            ),
            Text(
              hindiTransliterations,
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
9
likes
150
points
92
downloads

Publisher

unverified uploader

Weekly Downloads

Transliteration package which transliterates "English" to more than 20 languagues.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on transliteration