Skip to content

Issue #28 - Method not found: 'ButtonTheme.bar'#29

Closed
RajaParikshit wants to merge 1 commit into
cdharris:masterfrom
RajaParikshit:issue_#28_button_theme_bar
Closed

Issue #28 - Method not found: 'ButtonTheme.bar'#29
RajaParikshit wants to merge 1 commit into
cdharris:masterfrom
RajaParikshit:issue_#28_button_theme_bar

Conversation

@RajaParikshit

@RajaParikshit RajaParikshit commented Feb 17, 2021

Copy link
Copy Markdown

Solution for issue #28

Error Stacktrace :

../../../../../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_duration_picker-1.0.4/lib/flutter_duration_picker.dart:506:44: Error: Method not found: 'ButtonTheme.bar'.
    final Widget actions = new ButtonTheme.bar(
                                                         ^^^

As per SO post : https://stackoverflow.com/questions/66027441/error-method-not-found-buttontheme-bar

ButtonTheme.bar is Deprecated. We need to use ButtonBarTheme instead which offers more flexibility to configure ButtonBar widgets. This feature was deprecated after v1.9.1.

So need to change

final Widget actions = new ButtonTheme.bar(

to

final Widget actions = new ButtonBarTheme(
data: ButtonBarTheme.of(context),

on line 579 of flutter_duration_picker.dart

…ethod-not-found-buttontheme-bar

ButtonTheme.bar is Deprecated. We need to use ButtonBarTheme instead which offers more flexibility to configure ButtonBar widgets. This feature was deprecated after v1.9.1.

So need to change

final Widget actions = new ButtonTheme.bar(

to

final Widget actions = new ButtonBarTheme(
  data: ButtonBarTheme.of(context),

on line 579 of flutter_duration_picker.dart
@bartektartanus

Copy link
Copy Markdown

Looks like maintainer @cdharris is not responding, so I have prepared a workaround.
If you just want working version for flutter beta/dev channel then add this to your pubspec.yaml

  flutter_duration_picker:
    git: 
      url: https://github.com/RajaParikshit/flutter_duration_picker
      ref: issue_#28_button_theme_bar

If someone (like me) used version from another PR #26 (which added decoration) and want both PR - use repo forked by me.

  flutter_duration_picker:
    git: https://github.com/bartektartanus/flutter_duration_picker

@yelkamel

yelkamel commented Mar 3, 2021

Copy link
Copy Markdown

thanks @bartektartanus

@juliansteenbakker

Copy link
Copy Markdown

I also forked this repo and fixed this issue. Beside that i added null-safety support. You can find it at https://github.com/juliansteenbakker/duration_picker and https://pub.dev/packages/duration_picker.

This pull request was closed.
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

Successfully merging this pull request may close these issues.

4 participants