agora_rtm 2.2.1 copy "agora_rtm: ^2.2.1" to clipboard
agora_rtm: ^2.2.1 copied to clipboard

Flutter wrapper around the Agora Real Time Message SDKs for Android and iOS.

example/lib/main.dart

import 'package:agora_rtm_example/src/rtm_api_demo.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'src/log_sink.dart';

void main() {
  FlutterError.onError = (details) {
    FlutterError.presentError(details);
    logSink.log(details.toString());
  };

  // TODO(littlegnal): The newer version of Flutter SDK doc shows use of the
  // `PlatformDispatcher.instance.onError` but not `runZonedGuarded` to
  // handle "Errors not caught by Flutter",
  // see: https://docs.flutter.dev/testing/errors#handling-all-types-of-errors,
  // follow the Flutter SDK doc after we can bump the mini supported Flutter SDK (currently 2.10.x)
  // to the newer version of Flutter SDK.
  runZonedGuarded(() {
    runApp(const MyApp());
  }, (error, stackTrace) {
    logSink.log(error.toString());
  });
}

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('RTM example app'),
          actions: const [LogActionWidget()],
        ),
        body: const RtmApiDemo(),
      ),
    );
  }
}
73
likes
130
pub points
95%
popularity

Publisher

verified publisheragora.io

Flutter wrapper around the Agora Real Time Message SDKs for Android and iOS.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

async, ffi, flutter, iris_method_channel, json_annotation, meta

More

Packages that depend on agora_rtm