Skip to content

The app doesn't compile with Flutter 3.22.3 #3

@jfahrenkrug

Description

@jfahrenkrug

When I checkout the app and the tutorial_step_0 branch, I get a bunch of compilation errors:

flutter_sdk_tutorial git:(tutorial_step_0) ✗ flutter run -d chrome
Downloading Web SDK...                                           2,456ms
Launching lib/main.dart on Chrome in debug mode...
Warning: In index.html:37: Local variable for "serviceWorkerVersion" is deprecated. Use "{{flutter_service_worker_version}}" template
token instead.
Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load" instead.
lib/main.dart:43:13: Error: No named parameter with the name 'backgroundColor'.
            backgroundColor: Colors.blueGrey[50],
            ^^^^^^^^^^^^^^^
../../../../flutter/packages/flutter/lib/src/material/theme_data.dart:268:11: Context: Found this candidate, but the arguments don't
match.
  factory ThemeData({
          ^
lib/widgets/message_left.dart:18:56: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
 ('../../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
    TextStyle? fontStyle = Theme.of(context).textTheme.bodyText2;
                                                       ^^^^^^^^^
lib/widgets/message_left.dart:75:28: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
 ('../../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
                          .caption!
                           ^^^^^^^
lib/widgets/message_left.dart:96:54: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
 ('../../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
                  style: Theme.of(context).textTheme.bodyText2!.apply(
                                                     ^^^^^^^^^
lib/widgets/message_right.dart:45:28: Error: The getter 'caption' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
 ('../../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'caption'.
                          .caption!
                           ^^^^^^^
lib/widgets/message_right.dart:66:54: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart'
 ('../../../../flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
                  style: Theme.of(context).textTheme.bodyText2!.apply(
                                                     ^^^^^^^^^
Waiting for connection from debug service on Chrome...             13.5s
Failed to compile application.

Maybe it has to do with a change from Material 2 to Material 3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions