flutter_telegram_login 0.0.2 copy "flutter_telegram_login: ^0.0.2" to clipboard
flutter_telegram_login: ^0.0.2 copied to clipboard

A Flutter package that implements the required function in order to login with Telegram.

flutter_telegram_login #

A Flutter plugin providing the required functions in order to implement login with Telegram.

Usage #

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

Example #

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

final TelegramLogin telegramLogin = TelegramLogin(<PHONE_NUMBER:String>, <BOT_ID:String>, <BOT_DOMAIN:String>);

void main() => runApp(
  MaterialApp(
    home: Material(
      child: Center(
        child: Column(
          children: [
            ElevatedButton(
                onPressed: telegramLogin.loginTelegram,
                child: const Text("loginTelegram")
            ),
            ElevatedButton(
                onPressed: () async {
                  var success = await telegramLogin.checkLogin();
                  print(success);
                },
                child: const Text("checkLogin")
            ),
            ElevatedButton(
                onPressed: () async {
                  var data = await telegramLogin.getData();
                  print(data);
                  if (data) {
                    print(telegramLogin.userData);
                  }
                },
                child: const Text("getData")
            ),
            ElevatedButton(
                onPressed: () async {
                  await telegramLogin.telegramLaunch();
                },
                child: const Text("openTelegram")
            ),
          ]
        )
      )
    )
  )
);
17
likes
120
pub points
77%
popularity

Publisher

verified publisherdart.cawa.dev

A Flutter package that implements the required function in order to login with Telegram.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, http, url_launcher

More

Packages that depend on flutter_telegram_login