小编Adi*_*ham的帖子

错误:运行flutter蓝色插件时,包androidx.core.app不存在

我正在使用Flutter,并使用Flutter blue插件。一切都在开始时运行良好,但是由于蓝色插件版本的波动,程序突然无法执行构建。

    dependencies:
      vector_math: any
      path_provider: ^1.3.0
      flutter:
        sdk: flutter
      flutter_map:
      flutter_blue: ^0.6.3+1
      cupertino_icons: ^0.1.2
Run Code Online (Sandbox Code Playgroud)

这是错误消息

    C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_blue-0.6.3+1\android\
    src\main\java\com\pauldemarco\flutter_blue\FlutterBluePlugin.java:43:
    error: package androidx.core.app does not exist import androidx.core.app.ActivityCompat;
    ^
    error: package androidx.core.content does not exist
    import androidx.core.content.ContextCompat;
Run Code Online (Sandbox Code Playgroud)

dependencies bluetooth android-studio flutter androidx

3
推荐指数
1
解决办法
819
查看次数

Navigator.pop 不会关闭 flutter 中的 simpledialog

我正在使用颤振构建 android 应用程序。我在以编程方式关闭简单对话框时遇到问题。

现在我有一个名为 ListVessel 的有状态页面。此页面包含来自数组 otherVessels 的 listTile。
下面是这个页面的代码。

class ListVessel extends StatefulWidget {
  final Function() notifyParent;
  ListVessel({Key key, @required this.notifyParent}) : super(key: key);

  @override
  _ListVesselState createState() => _ListVesselState();
}

class _ListVesselState extends State<ListVessel> {
  @override
  Widget build(BuildContext context) {
      return ListView.separated(
        separatorBuilder: (context, index) => Divider(color: Colors.blueGrey),
        itemCount: otherVessels.length,
        itemBuilder: (context, index) {
          return ListTile(
            title: Text("Name: "+otherVessels[index]["shipName"]),
            onTap: () {
              showDialog (
                  context: context,
                  builder: (_){
                    return otherTap(idx:index);
                  }
              );
            }
          );
        },
      );
    }
  }
} …
Run Code Online (Sandbox Code Playgroud)

android showdialog navigator simpledialog flutter

0
推荐指数
2
解决办法
2460
查看次数