【问题标题】:Flutter Duration Picker Package颤振持续时间选择器包
【发布时间】:2021-09-05 23:48:18
【问题描述】:

我在使用 Flutter Duration Picker 包时遇到了问题。

基本上我只想通过 showDurationPicker 函数显示他们的 Duration Picker。没有像示例中那样使用 Duration Picker 作为孩子。 可能的或其他解决方案?我想让用户为倒数计时器选择时间。

包装: https://pub.dev/packages/duration_picker

代码如下:

                       IconButton(
                          icon: Icon(Icons.history_rounded,
                              color: AppTheme.blue,
                              size:
                                  3.23 * SizeConfig.heightMultiplier //30.0,
                              ),
                          onPressed: ()  {
                            Duration _durationResult =
                                await 
                                showDurationPicker(
                                    snapToMins: 5.0,
                                    context: context,
                                    initialTime: Duration(
                                        hours: 2,
                                        minutes: 0,
                                        seconds: 0,
                                        milliseconds: 0));

                                        
                            
                          }),

终端:

Xcode 的输出:

↳ ../../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_duration_picker-1.0.4/lib/flutte r_duration_picker.dart:506:44:错误:找不到方法:'ButtonTheme.bar'。 最终小部件操作 = new ButtonTheme.bar( ^^^

Command PhaseScriptExecution failed with a nonzero exit code 
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete

无法为模拟器构建应用程序。 在 Xs 上启动应用程序时出错。

【问题讨论】:

    标签: flutter flutter-dependencies flutter-widget


    【解决方案1】:

    您应该切换到新维护的版本 - https://github.com/juliansteenbakker/duration_picker

    【讨论】:

    • “勉强维护”的版本,即
    猜你喜欢
    • 2019-01-28
    • 2022-12-12
    • 2021-01-17
    • 2020-01-28
    • 2020-06-28
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多