What is the difference between Flutter packages widgets.dart, material.dart and cupertino.dart?

Posted by Editorial Staff | Updated on

What is the difference between Flutter packages widgets.dart, material.dart and cupertino.dart? 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:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers