"Dart library 'dart:ui' is not available on this platform" Error while running an Flutter project

157 views Asked by At

While running the Flutter project, it shows that the Dart library "'dart:ui' is not available on this platform." exists in the Many files. Many times I checked the reinstalling of the Flutter SDK and also upgraded the Flutter packages, but nothing changed on the error. Paths are correctly defined in environment variable and also android studio path settings.

Error Image1 , error image2

error on the terminal has,

../../../Documents/flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ Context: The unavailable library 'dart:ui' is imported through these packages:

package:flutter_to_do_app => package:flutter => dart:ui
...

Detailed import paths for (some of) the these imports:

package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/change_notifier.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/key.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/foundation.dart => package:flutter/src/foundation/memory_allocations.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/scheduler.dart => package:flutter/src/scheduler/binding.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/scheduler.dart => package:flutter/src/scheduler/binding.dart => package:flutter/src/scheduler/priority.dart => package:flutter/foundation.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/scheduler.dart => package:flutter/src/scheduler/binding.dart => package:flutter/src/scheduler/priority.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/scheduler.dart => package:flutter/src/scheduler/binding.dart => package:flutter/src/scheduler/priority.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/assertions.dart => package:flutter/src/foundation/diagnostics.dart => package:flutter/src/foundation/debug.dart => dart:ui
package:flutter_to_do_app/main.dart => package:flutter/material.dart => package:flutter/src/material/about.dart => package:flutter/scheduler.dart => package:flutter/src/scheduler/binding.dart => package:flutter/src/scheduler/priority.dart => package:flutter/foundation.dart => package:flutter/src/foundation/binding.dart => package:flutter/src/foundation/debug.dart => dart:ui
...

../../../Documents/flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/badge_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/banner_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/bottom_navigation_bar_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/bottom_sheet.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/bottom_sheet_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^ ../../../Documents/flutter/packages/flutter/lib/src/material/button_bar_theme.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform. import 'dart:ui' show lerpDouble; ^

Process finished with exit code 254

How this happened and how it will be gone, I am using Android Studio and Flutter. What should I do next?

0

There are 0 answers