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

Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'. #21

Open
yavuztarhan opened this issue Jan 10, 2021 · 7 comments

Comments

@yavuztarhan
Copy link

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/gradient_app_bar-0.1.3/lib/gradient_app_bar.dart:610:20: Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorRenderObjectOfType'.
    return context.ancestorRenderObjectOfType(const TypeMatcher<RenderSliverFloatingPersistentHeader>());
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
Command PhaseScriptExecution failed with a nonzero exit code
@yavuztarhan
Copy link
Author

yavuztarhan commented Jan 10, 2021

https://api.flutter.dev/flutter/widgets/BuildContext/ancestorRenderObjectOfType.html

@deprecated

('Use findAncestorRenderObjectOfType instead. ' 'This feature was deprecated after v1.12.1.')

RenderObject ancestorRenderObjectOfType (
TypeMatcher matcher
)
@deprecated('Use findAncestorRenderObjectOfType instead. ' 'This feature was deprecated after v1.12.1.')
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget that matches the given TypeMatcher.

This method is deprecated. Please use findAncestorRenderObjectOfType instead.

need to update package

@Alex-A4
Copy link

Alex-A4 commented Jan 14, 2021

Yeah, looks like the author abandon project

@joostlek
Copy link
Owner

Well to be honest, I did this project a long time ago. After that I once reinstalled my laptop and I didnt have the SDK installed anymore. But now I do, so I'll probably look into it some time soon I guess

@Moujarkash
Copy link

@joostlek I made a pull request to fix the issue, please review it

@Wisdom9596
Copy link

You don't need Package for GradientAppBar.
Just use this:
AppBar(
...
//backgroundColor: Colors.blue,
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.amber[700],
Colors.grey[800],
...
]
)
)
),

@srvstvnhl
Copy link

@yavuztarhan have you resolved the issue?

@srvstvnhl
Copy link

Well to be honest, I did this project a long time ago. After that I once reinstalled my laptop and I didnt have the SDK installed anymore. But now I do, so I'll probably look into it some time soon I guess

@joostlek Could you please update the package?

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

6 participants