translatelkt 0.2.0 copy "translatelkt: ^0.2.0" to clipboard
translatelkt: ^0.2.0 copied to clipboard

You can use instant translation simply by calling the library and you can translate into all languages

Getting started #

You can use instant translation simply by calling the library and you can translate into all languages

Package in action

Example #

import 'package:flutter/material.dart';
import 'package:translatlkt/translatelkt.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  var desc = ''; // Initialize desc

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              width: double.infinity,
            ),
            Text(desc),
            ElevatedButton(
              onPressed: () {
                translateAndSetState();
              },
              child: Text("Translate"),
            )
          ],
        ),
      ),
    );
  }

  // Function to translate and set the state
  void translateAndSetState() async {
    var translatedText = await translateLkt('en', 'ar', 'hello, how are you');
    setState(() {
      desc = translatedText;
    });
  }
}

2
likes
105
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

You can use instant translation simply by calling the library and you can translate into all languages

Documentation

API reference

License

unknown (license)

Dependencies

flutter, http

More

Packages that depend on translatelkt