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

flutter_colorpicker dependency uses removed properties, app won't launch after flutter 3.22.0 #1865

Closed
1 task done
dezsocsete opened this issue May 14, 2024 · 11 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@dezsocsete
Copy link

dezsocsete commented May 14, 2024

Is there an existing issue for this?

Flutter Quill version

^9.3.11

Steps to reproduce

  1. Upgrade flutter to 3.22.0
  2. flutter create .
  3. Add the code sample to the main.dart

Expected results

App would run

Actual results

App does not launch

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: QuillEditor.basic(
        configurations: QuillEditorConfigurations(
          controller: QuillController.basic(),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/colorpicker.dart:659:53: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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 'bodyText1'.
                        Theme.of(context).textTheme.bodyText1,
                                                    ^^^^^^^^^
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/colorpicker.dart:669:53: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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'.
                        Theme.of(context).textTheme.bodyText2,
                                                    ^^^^^^^^^
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/palette.dart:951:55: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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 'bodyText1'.
                          Theme.of(context).textTheme.bodyText1,
                                                      ^^^^^^^^^
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/palette.dart:960:57: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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'.
                            Theme.of(context).textTheme.bodyText2,
                                                        ^^^^^^^^^
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/palette.dart:1042:58: Error: The getter 'bodyText1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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 'bodyText1'.
          Text('Hex', style: Theme.of(context).textTheme.bodyText1),
                                                         ^^^^^^^^^
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/palette.dart:1045:47: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/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'.
          width: (Theme.of(context).textTheme.bodyText2?.fontSize ?? 14) * 10,
                                              ^^^^^^^^^
@mqaa
Copy link

mqaa commented May 14, 2024

The issue is caused by the flutter_colorpicker package. See mchome/flutter_colorpicker#105
This is the error I get when I build by app:

../../../.pub-cache/hosted/pub.dev/flutter_colorpicker-1.0.3/lib/src/colorpicker.dart:659:53: Error: The getter 'bodyText1' 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 'bodyText1'.
    Theme.of(context).textTheme.bodyText1,

@myfknoll
Copy link
Contributor

Same here =/

@Tanthus
Copy link

Tanthus commented May 14, 2024

The fix was published on Github for Colorpicker, was fixed for the master branch but not published (ref)

I was able to get my code to compile by adding this temporary fix to my pubspec.yaml file.

dependency_overrides:
  flutter_colorpicker:
    git:
      url: https://github.com/mchome/flutter_colorpicker
      ref: master  # or 786d04363f587b818ce585d25b9c2bb62de95aba  

@mqaa
Copy link

mqaa commented May 15, 2024

@Tanthus That does fix the issue for me too. Hope the packages will be updated so no override is required anymore.

@certainlyWrong
Copy link

The fix was published on Github for Colorpicker, was fixed for the master branch but not published (ref)

I was able to get my code to compile by adding this temporary fix to my pubspec.yaml file.

dependency_overrides:
  flutter_colorpicker:
    git:
      url: https://github.com/mchome/flutter_colorpicker
      ref: master  # or 786d04363f587b818ce585d25b9c2bb62de95aba  

flutter_colorpick It's a shameful package. I don't even use tags to version the code, flutter_quill can't continue depending on it.

@rsegecin
Copy link

adding the dependency override for flutter_colorpicker did make my code run but it lost some color references, like if I wasn't working with material 3 anymore.

@tbusot
Copy link

tbusot commented May 17, 2024

@rsegecin keep in mind that Material 3 deprecates background, onBackground, and surfaceVariants colors. Pretty major changes unfortunately. Read more here Introduce new ColorScheme roles for Material 3

@singerdmx
Copy link
Owner

should we consider forking flutter_colorpicker and publish a new package?

@myfknoll
Copy link
Contributor

myfknoll commented May 18, 2024

should we consider forking flutter_colorpicker and publish a new package?

Last activity was Apr 5, 2024, so there might be hope.
But since there are not much contributions in the last year, it would be a good approach.

As a workaround for others, I was forking both repos for now which works temporary:

flutter_quill: git: url: https://github.com/pocketshop-app/flutter-quill ref: update

@ellet0
Copy link
Collaborator

ellet0 commented May 18, 2024

Hi, can you try the latest version now?

@ellet0
Copy link
Collaborator

ellet0 commented May 19, 2024

Fixed in the latest release, flutter_colorpicker package changes has been published

@ellet0 ellet0 closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants