is_tv_ffi 0.7.1 copy "is_tv_ffi: ^0.7.1" to clipboard
is_tv_ffi: ^0.7.1 copied to clipboard

Detects whether a Flutter app is running on a TV: Android TV, tvOS, webOS, Tizen and TV-mode Linux and Windows, using FFI and JNI rather than platform channels.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    // `isTv` is a synchronous read of a native API, so there is nothing to
    // await and no need to hold it in state.
    final isTv = const IsTvFfi().isTv;

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Center(child: Text('Is device a tv: $isTv')),
      ),
    );
  }
}
0
likes
160
points
22
downloads

Documentation

API reference

Publisher

verified publishermathiewabbas.dev

Weekly Downloads

Detects whether a Flutter app is running on a TV: Android TV, tvOS, webOS, Tizen and TV-mode Linux and Windows, using FFI and JNI rather than platform channels.

Repository (GitHub)
View/report issues

Topics

#tv #ffi #android-tv #tvos #smart-tv

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, jni, jni_flutter, web

More

Packages that depend on is_tv_ffi

Packages that implement is_tv_ffi