I want to use those basic classes (such as Offset, Size, and Color), in a pure-dart program. I cannot import them in a pure dart project. How can I use them?
Offset
Size
Color
dart
Those classes are really fundamental and quite helpful. For example, with Color (and Colors) the color system can be easily used. So I would appreciate it if I could use them.
Colors
I have tried this, but it gives me the following error: Error: Not found: 'dart:ui'. I have also tried copying and pasting, but that is a bit ugly...
Error: Not found: 'dart:ui'
Well in short, you can't, unless you copy the code from the source class in package:flutter/material.dart.
package:flutter/material.dart
2.1m questions
2.1m answers
60 comments
57.0k users