我一添加import语句就发生此错误:import 'package:syncfusion_flutter_datepicker/datepicker.dart';
重新创建此错误不需要剩余代码
代码:
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
// static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: SfDateRangePicker(),
));
}
}
错误:
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.4.48/lib/src/date_picker/date_picker.dart:7596:37: Error: The argument type 'ScrollableState?' can't be assigned to the parameter type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
- 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../snap/flutter/common/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
scrollableState: Scrollable.of(context),
2条答案
按热度按时间6ioyuze21#
此错误在此问题中提及。
https://github.com/syncfusion/flutter-examples/issues/730
您应该修复pubspec.yaml中syncfusion_flutter_datepicker的版本
https://github.com/syncfusion/flutter-examples/issues/730#issuecomment-1413788831
hgb9j2n62#
使用MaterialApp Package 您的支架