flutter-quill icon indicating copy to clipboard operation
flutter-quill copied to clipboard

Removed properties, classes and no backward compatible with material 2 version for flutter web

Open MacDeveloper1 opened this issue 1 year ago • 63 comments

@ellet0 @singerdmx today I again update the package to version 9.0.5 and I get errors again!!! Why do you remove properties from QuillToolbarSelectHeaderStyleDropdownButtonOptions? I suggested my widget QuillToolbarSelectHeaderStyleDropdownButton as is. Why QuillToolbarSelectAlignmentButton does not contains properties showLeftAlignment, showCenterAlignment, showRightAlignment, showJustifyAlignment if the are alway the until 8.6.4

Please revert to the latest working version 8.6.4 or stop the always breaking. Please support backward compability because of your actions people could not compile their working projects.

Yesterday I spent more time to force my web app working and those modifications were merged but now may modifications are already absent.

Please restore my code QuillToolbarSelectHeaderStyleDropdownButton because it did not use MenuAnchor and its GUI must be similar to QuillToolbarFontFamilyButton and QuillToolbarFontSizeButton.

image

image

MacDeveloper1 avatar Dec 20 '23 07:12 MacDeveloper1

Let's consider the original code:

  Widget _buildContent(BuildContext context) {
    final theme = Theme.of(context);
    final hasFinalWidth = options.width != null;
    return Padding(
      padding: options.padding ?? const EdgeInsets.fromLTRB(10, 0, 0, 0),
      child: Row(
        mainAxisSize: !hasFinalWidth ? MainAxisSize.min : MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          UtilityWidgets.maybeWidget(
            enabled: hasFinalWidth,
            wrapper: (child) => Expanded(child: child),
            child: Text(
              _valueToText[_selectedAttribute]!,
              overflow: options.labelOverflow,
              style: options.style ??
                  TextStyle(
                    fontSize: iconSize / 1.15,
                    color:
                        iconTheme?.iconUnselectedColor ?? theme.iconTheme.color,
                  ),
            ),
          ),
          const SizedBox(width: 3),
          Icon(
            Icons.arrow_drop_down,
            size: iconSize / 1.15,
            color: iconTheme?.iconUnselectedColor ?? theme.iconTheme.color,
          )
        ],
      ),
    );
  }

The new code:

        builder: (context) {
          final isMaterial3 = Theme.of(context).useMaterial3;
          final child = Row(
            mainAxisSize: MainAxisSize.min,
            children: [
              Text(
                _label(_selectedItem),
                style: widget.options.textStyle ??
                    TextStyle(
                      fontSize: iconSize / 1.15,
                    ),
              ),
              Icon(
                Icons.arrow_drop_down,
                size: iconSize * iconButtonFactor,
              ),
            ],
          );
          if (!isMaterial3) {
            return RawMaterialButton(
              onPressed: _onDropdownButtonPressed,
              child: child,
            );
          }
          return IconButton(
            onPressed: _onDropdownButtonPressed,
            icon: child,
          );
        },
      ),
    );

You just simply remove padding for the whole Row?! You removed mainAxisAlignment and mainAxisSize even didn't understanding for what it is and that is can be used somewhere?! You removed the _showMenu which is similar to font family selection and where the selected item was highlighted by another color?!

Why? Why did you remove anything if you did not know how it is working.

MacDeveloper1 avatar Dec 20 '23 08:12 MacDeveloper1

I'm not removing anything this time, it just conflicts between many buttons made by PRs

EchoEllet avatar Dec 20 '23 08:12 EchoEllet

Replace with QuillToolbarSelectAlignmentButtons it has all the old properties you needs

EchoEllet avatar Dec 20 '23 08:12 EchoEllet

Please restore my code QuillToolbarSelectHeaderStyleDropdownButton because it did not use MenuAnchor and its GUI must be similar to QuillToolbarFontFamilyButton and QuillToolbarFontSizeButton.

I already told you, there was been conflicts and I need you to re add the options but you didn't respond so I had to remove them, I can restore them but I need you to use them in the widget

EchoEllet avatar Dec 20 '23 09:12 EchoEllet

To make it clear, you did upgrade from your local branch to 9.0.5?? it's not really related to 9.0.5 you can take a look at the the releases using tag

we did not remove them in 9.0.5

EchoEllet avatar Dec 20 '23 09:12 EchoEllet

Well.

This is a code from 8.6.4 in fil lib/src/widgets/toolbar/buttons/quill_icon_button.dart

  @override
  Widget build(BuildContext context) {
    return ConstrainedBox(
      constraints: BoxConstraints.tightFor(width: size, height: size),
      child: UtilityWidgets.maybeTooltip(
        message: tooltip,
        child: RawMaterialButton(
          visualDensity: VisualDensity.compact,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(borderRadius),
          ),
          fillColor: fillColor,
          elevation: 0,
          hoverElevation: hoverElevation,
          highlightElevation: hoverElevation,
          onPressed: () {
            onPressed?.call();
            afterPressed?.call();
          },
          child: icon,
        ),
      ),
    );
  }

As you may see it contains fillColor depending of isToggle, i.e. icon is colored when some style is selected.

Now let's see on latest code:

  Widget build(BuildContext context) {
    if (isFilled) {
      return IconButton.filled(
        padding: padding,
        onPressed: onPressed,
        icon: icon,
        style: iconStyle,
      );
    }
    return IconButton(
      padding: padding,
      onPressed: () {
        onPressed?.call();
        afterPressed?.call();
      },
      icon: icon,
      style: iconFilledStyle,
    );
  }

Do you understand that this is not equivalent modification? You removed constraints, you removed tooltip, you removed rounded rectangle, you removed afterPressed call. You break the visual representation completely.

How do you suggest me to restore rounded rectangle hovering, how do you suggest me to have the buttons size? Use the addiional ThemeData, wrap each icon in ConstarainedBox? Why do I need to do this if all was working fine before?

MacDeveloper1 avatar Dec 20 '23 09:12 MacDeveloper1

To make it clear, you did upgrade from your local branch to 9.0.5?? No. I upgraded from pub.dev:

dependency: flutter_quill: ^9.0.5

MacDeveloper1 avatar Dec 20 '23 09:12 MacDeveloper1

Replace with QuillToolbarSelectAlignmentButtons

Are you sure? I see the parameter options which I used to pass my own tooltips and where in the code of this class is it handled? So again breaking change without backward compability. This class is no go.

MacDeveloper1 avatar Dec 20 '23 09:12 MacDeveloper1

Just for experiment I added those class and what I see?

image

Where is correct vertical alignment for all buttons? Also I see different icon looks. Look at aligment sharp icons and remain ones which looks bigger. Again breaking change without backward compability.

@singerdmx versions from 8.6.4 is buggy and not backward compatible.

MacDeveloper1 avatar Dec 20 '23 09:12 MacDeveloper1

Just for experiment I added those class and what I see?

image

Where is correct vertical alignment for all buttons? Also I see different icon looks. Look at aligment sharp icons and remain ones which looks bigger. Again breaking change without backward compability.

@singerdmx versions from 8.6.4 is buggy and not backward compatible.

I don't know about your code sample, I test things in the example and it looks fine Please send it so I can test it

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

image

image

Why font family has rectangle highlighting (where rounding as before) and bold button has circle hightling (as it was rounding rectangle)?

MacDeveloper1 avatar Dec 20 '23 10:12 MacDeveloper1

I don't know about your code sample, I test things in the example and it looks fine What are you talking about. Until version 8.6.4 I updated version and I never had problems with GUI, it was not changed. The problems occurred on each new version

Please send it so I can test it

Are you kidding? How can I send you a whole project? Just create and example for yourself (on all platforms!). It is simple - just quill controlls separated by divider.

P.S. The simple solution is to revert to 8.6.4 or at least 9.0.0-dev where you make QuillProvider optional and try to implement new modification carefull with testing at least on 4 platforms: adnroid, ios, web, windows.

MacDeveloper1 avatar Dec 20 '23 10:12 MacDeveloper1

I don't know about your code sample, I test things in the example and it looks fine What are you talking about. Until version 8.6.4 I updated version and I never had problems with GUI, it was not changed. The problems occurred on each new version

Please send it so I can test it

Are you kidding? How can I send you a whole project? Just create and example for yourself (on all platforms!). It is simple - just quill controlls separated by divider.

P.S. The simple solution is to revert to 8.6.4 or at least 9.0.0-dev where you make QuillProvider optional and try to implement new modification carefull with testing at least on 4 platforms: adnroid, ios, web, windows.

I meant the code sample

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

I don't know about your code sample, I test things in the example and it looks fine What are you talking about. Until version 8.6.4 I updated version and I never had problems with GUI, it was not changed. The problems occurred on each new version

Please send it so I can test it

Are you kidding? How can I send you a whole project? Just create and example for yourself (on all platforms!). It is simple - just quill controlls separated by divider.

P.S. The simple solution is to revert to 8.6.4 or at least 9.0.0-dev where you make QuillProvider optional and try to implement new modification carefull with testing at least on 4 platforms: adnroid, ios, web, windows.

Reverting as not an option, give me second chance, I will fix the font size issue with the dropdown buttons then the styling using material 3 but I will need you to test thing on the pre release channel

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Why font family has rectangle highlighting (where rounding as before) and bold button has circle hightling (as it was rounding rectangle)?

It's new material 3 behavior

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Just for experiment I added those class and what I see?

image

Where is correct vertical alignment for all buttons? Also I see different icon looks. Look at aligment sharp icons and remain ones which looks bigger. Again breaking change without backward compability.

@singerdmx versions from 8.6.4 is buggy and not backward compatible.

image

Now it's fixed, the justify min width is back

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Now I'm fixing the toolbar when multiRowsDisplay is false

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

You removed the _showMenu which is similar to font family selection and where the selected item was highlighted by another color?!

Again, I used the material 3 dropdown instead of the current one

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Well.

This is a code from 8.6.4 in fil lib/src/widgets/toolbar/buttons/quill_icon_button.dart

  @override
  Widget build(BuildContext context) {
    return ConstrainedBox(
      constraints: BoxConstraints.tightFor(width: size, height: size),
      child: UtilityWidgets.maybeTooltip(
        message: tooltip,
        child: RawMaterialButton(
          visualDensity: VisualDensity.compact,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(borderRadius),
          ),
          fillColor: fillColor,
          elevation: 0,
          hoverElevation: hoverElevation,
          highlightElevation: hoverElevation,
          onPressed: () {
            onPressed?.call();
            afterPressed?.call();
          },
          child: icon,
        ),
      ),
    );
  }

As you may see it contains fillColor depending of isToggle, i.e. icon is colored when some style is selected.

Now let's see on latest code:

  Widget build(BuildContext context) {
    if (isFilled) {
      return IconButton.filled(
        padding: padding,
        onPressed: onPressed,
        icon: icon,
        style: iconStyle,
      );
    }
    return IconButton(
      padding: padding,
      onPressed: () {
        onPressed?.call();
        afterPressed?.call();
      },
      icon: icon,
      style: iconFilledStyle,
    );
  }

Do you understand that this is not equivalent modification? You removed constraints, you removed tooltip, you removed rounded rectangle, you removed afterPressed call. You break the visual representation completely.

How do you suggest me to restore rounded rectangle hovering, how do you suggest me to have the buttons size? Use the addiional ThemeData, wrap each icon in ConstarainedBox? Why do I need to do this if all was working fine before?

This issue has been fixed in the latest pre-release

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Again, I used the material 3 dropdown instead of the current one.

What do you mean material dropdown? Is it different than one which is avaiable for years? My QuillToolbarSelectHeaderStyleDropdownButton was created similar to font family and font size dropdowns. So why than you modified only one class but leave 2 others?

MacDeveloper1 avatar Dec 20 '23 10:12 MacDeveloper1

This issue has been fixed in the latest pre-release

I don't know which pre-release are you talking about. Now I have the problem - my GUI is away different after changes. How can I restore my GUI exactly?

For example, how can I make rounded rectangle highlighting over all toggle buttons? Using Theme with overriden property will not bring any effect. Suggestion?

MacDeveloper1 avatar Dec 20 '23 10:12 MacDeveloper1

Again, I used the material 3 dropdown instead of the current one.

What do you mean material dropdown? Is it different than one which is avaiable for years? My QuillToolbarSelectHeaderStyleDropdownButton was created similar to font family and font size dropdowns. So why than you modified only one class but leave 2 others?

I will change the others soon in the pre release

QuillToolbarSelectHeaderStyleDropdownButton

Let's make it clear, @singerdmx and I agreed that it should be dropdown button for the select header style as a default, I create it from scratch but I forgot that it didn't match with the font family and font size

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

This issue has been fixed in the latest pre-release

I don't know which pre-release are you talking about. Now I have the problem - my GUI is away different after changes. How can I restore my GUI exactly?

For example, how can I make rounded rectangle highlighting over all toggle buttons? Using Theme with overriden property will not bring any effect. Suggestion?

Please use IconButton.styleFrom() to style things, it exists in the QuillIconTheme

image

EchoEllet avatar Dec 20 '23 10:12 EchoEllet

Why do you think that I use QuillToolbar.simple? I use QuillToolbar and show only those buttons which I need. So I cannot specify any options you suggested.

Why size of icons and dropdowns in your example image is different? Why normal is away different?

MacDeveloper1 avatar Dec 20 '23 11:12 MacDeveloper1

Why do you think that I use QuillToolbar.simple? I use QuillToolbar and show only those buttons which I need.

You still have buttonOptions

EchoEllet avatar Dec 20 '23 11:12 EchoEllet

Why do you think that I use QuillToolbar.simple? I use QuillToolbar and show only those buttons which I need. So I cannot specify any options you suggested.

You can customize them and decide which button you want with which size, You can still pass quill icon theme to the options of any button you want to use.

EchoEllet avatar Dec 20 '23 11:12 EchoEllet

Why size of icons and dropdowns in your example image is different? Why normal is away different?

That's because when I migrated to material 3, both the buttons and dropdown buttons, it was not constant for some reasons, I copied the workaround from the old code and it worked (divide the iconSize by 1.15, but then we had a PR which add iconButtonFactor), now it looks exactly the same to me right now

image

What do you mean by the size is different?

EchoEllet avatar Dec 20 '23 11:12 EchoEllet

You can still pass quill icon theme to the options of any button you want to use.

Yes. I did it, I used such code from start of usig Quill package.

MacDeveloper1 avatar Dec 20 '23 11:12 MacDeveloper1

What do you mean by the size is different?

Look at dropdowns and toggle buttons.

image

MacDeveloper1 avatar Dec 20 '23 11:12 MacDeveloper1

So many time I lost to just say you create a realy buggy version. Yesteryda I fixed issues and your merged a PR then you roll it back. Why do you publish such raw version basically? I trusted the package until 8.6.4. Now I have problem with my web app. It looks ugly.

I want this image Not this image

How can I fix this?

MacDeveloper1 avatar Dec 20 '23 11:12 MacDeveloper1