GradientAppBar icon indicating copy to clipboard operation
GradientAppBar copied to clipboard

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

Open yavuztarhan opened this issue 5 years ago • 7 comments

../../../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 avatar Jan 10 '21 10:01 yavuztarhan

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

yavuztarhan avatar Jan 10 '21 10:01 yavuztarhan

Yeah, looks like the author abandon project

Alex-A4 avatar Jan 14 '21 07:01 Alex-A4

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 avatar Jan 14 '21 13:01 joostlek

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

Moujarkash avatar Mar 04 '21 17:03 Moujarkash

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], ... ] ) ) ),

Wisdom9596 avatar Mar 09 '21 17:03 Wisdom9596

@yavuztarhan have you resolved the issue?

srvstvnhl avatar May 03 '21 07:05 srvstvnhl

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?

srvstvnhl avatar May 03 '21 07:05 srvstvnhl