【发布时间】:2021-06-05 13:29:16
【问题描述】:
在我将flutter sdk更新为>=2.12.0 The argument type 'Color?' can't be assigned to the parameter type 'Color',这是怎么回事?
Card(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.blue[300], width: 2.0),
borderRadius: BorderRadius.circular(15.0)
),
child: Text('Demo')),
重现错误的完整代码:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: Card(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.blue[300], width: 2.0),
borderRadius: BorderRadius.circular(15.0),
),
child: Text('Demo')),
),
),
);
}
}
【问题讨论】:
标签: flutter