How to use the PI constant in Dart?

Posted by Jennifer | Updated on

Want to use the PI constant in Dart? you should import ‘dart:math’ as math; instead of just import ‘dart:math’;

Because when you use the as keyword you provide the imported library a name so you can reference it anywhere in your file.

Here is an example:


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