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

Annotate extension methods with @widgetFactory #64

Open
blaugold opened this issue Feb 18, 2023 · 2 comments
Open

Annotate extension methods with @widgetFactory #64

blaugold opened this issue Feb 18, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@blaugold
Copy link

Flutter has recently introduced the @widgetFactory annotation to improve the dev UX for widgets created in extension methods. It's currently only available in the master channel, so implementing this will have to wait until the next stable feature release and a point at which this package is fine with requiring that version of Flutter.

Take this example:

import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';

void main() {
  runApp(const SizedBox().animate());
}

Currently, the Animate widget, created in animate, is not included in the summary widget tree in the widget inspector:

Screenshot 2023-02-18 at 12 54 02

After annotating the animate method with @widgetFactory the Animate widget is included in the summary widget tree like if Animate was used directly and not through the extension method.

Screenshot 2023-02-18 at 12 54 30

@gskinner gskinner added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 20, 2023
@gskinner
Copy link
Owner

Cool. I'll keep this open to implement in the future. Feel free to remind me. :)

@gskinner
Copy link
Owner

Note to self: @widgetFactory released in 3.10.0 on 2023/5/10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants