skip to Main Content

i just created a hello_world flutter project and got those errors :

/C:/flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Dart library 'dart:ui' is not available on this platform.
import 'dart:ui' as ui;
       ^
/C:/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;
       ^
/C:/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;
       ^
/C:/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;
       ^
/C:/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;
       ^
/C:/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;
       ^
/C:/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;
       ^
/C:/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;

just in case :
jdk version : 20
gradle version : 8.6
it should be compatible since 8.3 it is
distributionUrl=https://services.gradle.org/distributions/gradle-8.6-all.zip

i’ve been searching for almost two days now and i didn’t solve this issue
i would really appreaciate some help !

2

Answers


  1. Chosen as BEST ANSWER

    flutter upgrade, clean, pub get didn't work fd : tried that and it didn't work fd : Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22631.3155], locale en-US) • Flutter version 3.19.1 on channel stable at C:flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision abb292a07e (5 days ago), 2024-02-20 14:35:05 -0800 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1

    [√] Windows Version (Installed version of Windows is version 10 or higher)

    [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:UsersUserAppDataLocalAndroidsdk • Platform android-VanillaIceCream, build-tools 34.0.0 • Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314) • All Android licenses accepted.

    [√] Chrome - develop for the web • Chrome at C:Program FilesGoogleChromeApplicationchrome.exe

    [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.1) • Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community • Visual Studio Community 2022 version 17.9.34616.47 • Windows 10 SDK version 10.0.22621.0

    [√] Android Studio (version 2023.1) • Android Studio at C:Program FilesAndroidAndroid Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

    [√] VS Code (version 1.86.2) • VS Code at C:UsersUserAppDataLocalProgramsMicrosoft VS Code • Flutter extension version 3.82.0

    [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3155] • Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.69 • Edge (web) • edge • web-javascript • Microsoft Edge 121.0.2277.128

    [√] Network resources • All expected network resources are available.

    • No issues found!


  2. Have you tried:

    1. Running flutter clean and then flutter pub get?
    2. Running dart upgrade?

    If both don’t work, please run flutter doctor -v and add it to your question.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search