我已经将这段代码添加到这个文件中的Ffltter app->Android->src->main->androidhow.xml中,但现在仍在运行

<!-- Intent filter for handling deep links -->
<intent-filter>
    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <!-- Accepts URIs that begin with "https://www.example.com/gizmos" -->
    <data
        android:scheme="https"
        android:host="www.example.com"
        android:pathPrefix="/gizmos" />
</intent-filter>

添加此后仍然不工作

推荐答案

您必须先在项目中添加uni_link包

import 'package:uni_links/uni_links.dart';void main() {  runApp(MyApp());}class MyApp extends StatefulWidget {  @override  MyAppState createState() => MyAppState();}class _MyAppState extends State<MyApp> {  @override  void initState() {    super.initState();    initUniLinks();  }  void initUniLinks() async {    String initialLink = await getInitialLink();    // Handle the initial link, e.g., by navigating to a specific screen  }  @override  Widget build(BuildContext context) {    // Your app's build method  }}

Flutter相关问答推荐

Flutter 中不存在URI的目标

如何在Flutter 中不从getX库中初始化GetxController中的变量

点击表情符号按钮后,Flutter 文本域文本编辑控制器将文本恢复为原始值

Flutter 隔离.使用多个参数运行

悬停时打开Flutter 下拉按钮

Android上火焰瓷砖之间的线条飘动

如何使用flutter_local_notification包处理通知操作?

Flutter 块消费者仅对特定的状态属性更改做出react

通过Ffltter应用程序与Docker服务器进行交互以进行身份验证

SingleChildScrollView在ErrorWidget.builder中不工作

BaseInputfield和Textfield有什么不同?

在 Flutter 中使用条件语句设置 ImageProvider Object 类型的背景图像

NotifierProvider 每次更新都会重新构建并且值不更新

课程中的访问Provider

文本溢出文本框 - Flutter

通过点击缩略图加载全屏图像

改变步进器的线条 colored颜色 Flutter

如何修复int类型不是String类型的子类型

Flutter Firebase:如何判断返回值是否是特定对象

如何将所有行项目平等地放在一行中?Flutter