What is the difference between Flutter packages widgets.dart, material.dart and cupertino.dart and which one to use?
What happens is, the class is defined in a lower part of the framework (here foundation
for FlutterError
)
And then higher layers of the framework reexport the content of the lower layers, using the export
directive.
This is done mainly to make sure that developers don't have to import 5+ different things when they usually need them all.
For example material.dart
looks roughltly like this:
export 'package:flutter/widget.dart';
class RaisedButton { }