使用VSCode在flutter中键入List>时,Linux系统崩溃

问题描述 投票:0回答:1

我正在学习扑腾。每当我打字的时候

List<Map<String,String>>

我的系统被绞死了。我在Linux Mint中使用VS Code。我已经尝试了8到10次,每次打开代码时,代码都会显示分析并在10-15秒后挂起。

下面是我正在修改的文件。

import 'package:flutter/material.dart';

class ProductManager extends StatefulWidget {
  final Map<String, String> initialProduct;
  ProductManager({this.initialProduct});
  @override
  _ProductManagerState createState() => _ProductManagerState();
}

class _ProductManagerState extends State<ProductManager> {
  List<Map<String,String>> _products = [];

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

问题出在哪里,是我在VS Code中使用的dart / flutter插件,还是在VS Code本身。有人可以帮我解决这个问题吗?

visual-studio-code dart flutter
1个回答
0
投票

我怀疑你在分析服务器中遇到了这个bug(VS Code扩展使用了很多语言功能):

https://github.com/dart-lang/sdk/issues/34850

它已被修复,但修复可能还没有使Flutter稳定通道。尝试暂时切换到Flutter dev通道,如果你仍然在那里看到它,请在GitHub上提交一个新问题。

© www.soinside.com 2019 - 2024. All rights reserved.