小编Kom*_*hsh的帖子

自动补全不适用于 Vscode 中没有美元符号的 php 变量

我定义一个变量像

$name = 'Komail';
Run Code Online (Sandbox Code Playgroud)

在 PhpStorm 中,当我输入不带美元符号的名称时,PhpStorm 显示$name在自动完成框中,我只需输入即可。VScode 有这个选项设置吗?

php visual-studio-code

7
推荐指数
1
解决办法
472
查看次数

我如何为地图的 RxList 的初始值定义一个空列表

我在项目中使用 Getx 包,我想在控制器中定义这样的列表

  RxList<UserType> usersNames = [
    UserType(name: 'komail', isActive: true),
    UserType(name: 'ali', isActive: true),
  ].obs;
Run Code Online (Sandbox Code Playgroud)

这是 UserType 类

class UserType {
  String name;
  bool isActive;

  UserType({
    required this.name,
    required this.isActive,
  });
}
Run Code Online (Sandbox Code Playgroud)

usersNames 列表的初始值为空。但是当我想像下面这样定义这个变量时,我收到这个错误。

  RxList<UserType> usersNames = [].obs;
Run Code Online (Sandbox Code Playgroud)
A value of type 'RxList<dynamic>' can't be assigned to a variable of type 'RxList<UserType>'.
Try changing the type of the variable, or casting the right-hand type to 'RxList<UserType>'
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-getx

0
推荐指数
1
解决办法
2332
查看次数

标签 统计

dart ×1

flutter ×1

flutter-getx ×1

php ×1

visual-studio-code ×1