tencent_live_uikit 2.2.2 copy "tencent_live_uikit: ^2.2.2" to clipboard
tencent_live_uikit: ^2.2.2 copied to clipboard

TUILiveKit enables interactive live streaming for scenarios such as social entertainment, shopping, and fitness classes.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tencent_live_uikit/common/index.dart';
import 'package:tencent_live_uikit/tencent_live_uikit.dart';
import 'package:tencent_live_uikit_example/generated/l10n.dart';
import 'package:tencent_live_uikit_example/src/view/index.dart';

void main() {
  runApp(const MyApp());
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
    statusBarColor: Colors.transparent,
  ));
}

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) {
    S.load(View.of(context).platformDispatcher.locale);
    return MaterialApp(
        navigatorObservers: [
          TUILiveKitNavigatorObserver.instance
        ],
        localizationsDelegates: const [
          ...LiveKitLocalizations.localizationsDelegates,
        ],
        supportedLocales: [
          ...S.delegate.supportedLocales,
          ...LiveKitLocalizations.supportedLocales
        ],
        builder: (context, child) => Scaffold(
              resizeToAvoidBottomInset: false,
              body: GestureDetector(
                onTap: () {
                  hideKeyboard(context);
                },
                child: child,
              ),
            ),
        home: const LoginWidget());
  }

  void hideKeyboard(BuildContext context) {
    FocusScopeNode currentFocus = FocusScope.of(context);
    if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
      FocusManager.instance.primaryFocus?.unfocus();
    }
  }
}
1
likes
120
points
186
downloads

Publisher

verified publishertrtc.io

Weekly Downloads

TUILiveKit enables interactive live streaming for scenarios such as social entertainment, shopping, and fitness classes.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_localizations, fluttertoast, intl, permission_handler, plugin_platform_interface, rtc_room_engine, tencent_cloud_chat_sdk, tencent_cloud_uikit_core, tencent_trtc_cloud

More

Packages that depend on tencent_live_uikit