Skip to content

Method not found: 'ButtonTheme.bar' #28

Description

@RajaParikshit

Version Info

flutter_duration_picker:
    dependency: "direct main"
    description:
      name: flutter_duration_picker
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.4"

My flutter Version :

Flutter 1.27.0-2.0.pre.98 • channel master • https://github.com/flutter/flutter.git
Framework • revision 696e4f70d1 (3 days ago) • 2021-02-13 18:31:02 -0500
Engine • revision 1d537824d6
Tools • Dart 2.13.0 (build 2.13.0-30.0.dev)

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(

on line 506 of flutter_duration_picker.dart

I am happy to submit PR for the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions