Skip to content

[Slider]Popup内报错 #548

Closed
Closed
@zengganglai

Description

@zengganglai

tdesign-flutter 版本

0.1.9

重现链接

No response

重现步骤/代码

我在TDSlidePopupRoute内使用TDSlider,打开这个弹窗时报错,测试发现在Popup加Scaffold也可以正常使用.

Image

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Slider(value: 40.0, secondaryTrackValue: null, min: 0.0, max: 100.0, divisions: null, label: null, activeColor: null, inactiveColor: null, secondaryActiveColor: null, dirty, state: _SliderState#9c7a4(tickers: tracking 4 tickers)):
No Material widget found.
Slider widgets require a Material widget ancestor within the closest LookupBoundary.
In Material Design, most widgets are conceptually "printed" on a sheet of material. In Flutter's material library, that material is represented by the Material widget. It is the Material widget that renders ink splashes, for instance. Because of this, many material library widgets require that there be a Material widget in the tree above them.
To introduce a Material widget, you can either directly include one, or use a widget that contains Material itself, such as a Card, Dialog, Drawer, or Scaffold.
The specific widget that could not find a Material ancestor was: Slider

期望结果

No response

实际结果

No response

Flutter版本

No response

设备与机型信息

No response

系统版本

No response

补充说明

TDSlider(
sliderThemeData: TDSliderThemeData.capsule(
context: context,
showThumbValue: true,
divisions: 5,
min: 0,
max: 100,
scaleFormatter: (value) => value.toInt().toString(),
),
value: 40,
// divisions: 5,
onChanged: (value) {},
),
运行显示有些异常,不带刻度的可以拉到边

Image

Image

Image

IssueShoot

  • 预估时长:3
  • 期望完成时间:2025-5-6
  • 开发难度:中
  • 参与人数:1
  • 需求对接人:jackjflin
  • 验收标准:实现期望改造效果,提 MR并通过 验收无误
  • 备注:最终激励以实际提交 pr 并合并为准。TDesignFlutter贡献指南:https://tdesign.tencent.com/flutter/develop

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions