Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@immutable class complaint #1

Open
robertgao2023 opened this issue Feb 13, 2024 · 0 comments
Open

@immutable class complaint #1

robertgao2023 opened this issue Feb 13, 2024 · 0 comments

Comments

@robertgao2023
Copy link

As a newbie I was trying to test drive the Flutter-Basics. I was wondering, this sample code could run on all supported platforms? Or it only runs on certain platforms?

So far I have tried it on an android-x64 emulator, and chrome platform and here is what I encountered:
I am getting following problems and was wondering if you can help me by pointing to the right direction:

  1. running on Chrome, the output showing:
    [Running] dart "c:\Users\rober\MyDevSandBox\Flutter-Basics\lib\main.dart"
    ../my-flutter-app/flutter/packages/flutter/lib/src/material/animated_icons.dart:9:8: Error: Dart library 'dart:ui' is not available on this platform.
    import 'dart:ui' as ui show Canvas, Paint, Path, lerpDouble;
    ^
    Context: The unavailable library 'dart:ui' is imported through these packages:

    package:fitness => package:flutter => dart:ui

  2. On both platforms tested, the Problem window showing:
    [{
    "resource": "/C:/Users/rober/MyDevSandBox/Flutter-Basics/lib/pages/home.dart",
    "owner": "generated_diagnostic_collection_name@immutable class complaint #1",
    "code": {
    "value": "must_be_immutable",
    "target": {
    "$mid": 1,
    "path": "/diagnostics/must_be_immutable",
    "scheme": "https",
    "authority": "dart.dev"
    }
    },
    "severity": 4,
    "message": "This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: HomePage.categories, HomePage.diets, HomePage.popularDiets",
    "source": "dart",
    "startLineNumber": 7,
    "startColumn": 7,
    "endLineNumber": 7,
    "endColumn": 15
    }]

Please help, Thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant