[Flutter] Bug: @required参数报错 "undefined name 'required' used as an annotation"

144 阅读1分钟

参考

The solution is quite simple. Everything you need to do is to import the foundation library or the material library:

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

我一直以为这是dart自带的语法