joostlek / GradientAppBar

Gradient app bar for Flutter
https://pub.dartlang.org/packages/gradient_app_bar
BSD 3-Clause "New" or "Revised" License
134 stars 68 forks source link

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

Open yavuztarhan opened 3 years ago

yavuztarhan commented 3 years ago
../../../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 commented 3 years ago

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 commented 3 years ago

Yeah, looks like the author abandon project

joostlek commented 3 years ago

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 commented 3 years ago

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

Wisdom9596 commented 3 years ago

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 commented 3 years ago

@yavuztarhan have you resolved the issue?

srvstvnhl commented 3 years ago

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?