telegram_bot_crashlytics 1.1.0 copy "telegram_bot_crashlytics: ^1.1.0" to clipboard
telegram_bot_crashlytics: ^1.1.0 copied to clipboard

A new Flutter package which xullas apidan kelgan bad responcelani telegram guruhingizga tashlab beradi

example/lib/main.dart

import 'dart:async';

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

void main() {
  final crashlytics = TelegramBotCrashlytics(
    botToken: 'YOUR_BOT_TOKEN',
    chatId: 123456789,
  );
  // If you wand add to dio interceptor
  // final dio = Dio();
  // dio.interceptors.add(crashlytics.interceptor);

  runZonedGuarded(
    () => const MyApp(),
    (error, stack) {
      crashlytics.sendErrorToTelegram('Error: $error\nStack: $stack');
    },
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Example app for Telegram Bot Crashlytics'),
        ),
        body: const Center(
          child: Text('Hello, World!'),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            TelegramBotCrashlytics.instance.sendInfoToTelegram('Example info message');
          },
          child: const Icon(Icons.send),
        ),
      ),
    );
  }
}
12
likes
0
points
392
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter package which xullas apidan kelgan bad responcelani telegram guruhingizga tashlab beradi

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

device_info_plus, dio, flutter, http, logging

More

Packages that depend on telegram_bot_crashlytics