flutter tv应用
In this article, You can learn how to add support for your existing apps to run on Android TVs and how you can enable navigation using the remote control.
在本文中,您可以学习如何增加对现有应用程序的支持以在Android TV上运行,以及如何使用遥控器启用导航。
Note: This article is meant for developers who are already familiar with the basics of flutter
注意:本文适用于已经熟悉flutter基础知识的开发人员
Here, we will take the example of a modified version of the demo counter app that comes with Flutter.
在这里,我们将以Flutter随附的演示计数器应用程序的修改版本为例。
This is the code we will work with, In case you are not familiar with it.
这是我们将使用的代码,以防您不熟悉它。
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';void main() {
runApp(MyApp());
}class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);final String title;@override
_MyHomePageState createState() => _MyHomePageState();
}class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;void _incrementCounter() {
setState(() {
_counter++;
});
}

本文介绍了如何将Android TV功能整合到Flutter应用中,详细翻译自一篇Medium文章。
最低0.47元/天 解锁文章
2448

被折叠的 条评论
为什么被折叠?



