Skip to content

[TDPopupBottomDisplayPanel] 文字有下划线 #501

Closed
@qicaiy

Description

@qicaiy

tdesign-flutter 版本

^0.1.0

重现链接

No response

重现步骤/代码

`class _buildIntroTab extends State {
int _selectIndex = 0;
final TextS = TextStyle(
decoration: TextDecoration.none, fontSize: 20, color: Colors.black);
@OverRide
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 视频标题
Padding(
padding: EdgeInsets.only(left: 10, top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"牧神记",
style: TextStyle(fontSize: 23),
),
SizedBox(width: 20),
Text("5.0"),
],
),
Text(
"2025/国漫",
style: TextStyle(color: Colors.grey[600]),
),
],
),
),

    // 视频操作按钮
    Padding(
      padding: EdgeInsets.symmetric(vertical: 20),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          ElevatedButton.icon(
              icon: Icon(Icons.announcement),
              onPressed: () => {print("点击了搜索")},
              label: Text("反馈")),
          ElevatedButton.icon(
              icon: Icon(Icons.download),
              onPressed: () => {print("点击了搜索")},
              label: Text("下载")),
          ElevatedButton.icon(
              icon: Icon(Icons.favorite),
              onPressed: () => {print("点击了搜索")},
              label: Text("收藏")),
          ElevatedButton.icon(
              icon: Icon(Icons.share),
              onPressed: () => {print("点击了搜索")},
              label: Text("分享")),
        ],
      ),
    ),

    // 选集标题
    Padding(
      padding: EdgeInsets.symmetric(horizontal: 20),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          GestureDetector(
              child: Text("视频详情 >"),
              onTap: () => Navigator.of(context).push(TDSlidePopupRoute(
                  modalBarrierColor: TDTheme.of(context).fontGyColor2,
                  slideTransitionFrom: SlideTransitionFrom.bottom,
                  builder: (context) {
                    return TDPopupBottomDisplayPanel(
                      title: '视频详情',
                      closeClick: () {
                        Navigator.maybePop(context);
                      },
                      child: Container(
                        height: 400,
                        child: Padding(
                          padding: const EdgeInsets.only(left: 20),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                "牧神记",
                                style: TextS,
                              ),
                              Text("10.0",
                                  style: TextStyle(
                                      fontSize: 15,
                                      color: Colors.red,
                                      decoration: TextDecoration.none)),
                              Text("导演:姚青", style: TextS),
                              Text("主演:秦牧", style: TextS),
                              Text("上映年份:2021", style: TextS),
                              Text(
                                  "简介:残老村中住着来历莫测的九位老人和他们抚养长大的少年秦牧。一日,秦牧负责放牧的母牛竟然口吐人言,自此秦牧更加认识到大墟这片神弃之地的危险绮丽:魔神随黑暗降临、神骨于遗迹起舞、守护幼子的龙骨、拖行太阳的巨船……无论面对何种险境,秦牧都无所畏惧,将九老所传本领融会贯通,誓以举世无双的霸体闯出一片天地。",
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 4,
                                  style: TextS),
                            ],
                          ),
                        ),
                      ),
                    );
                  }))),
          GestureDetector(
              onTap: () => Navigator.of(context).push(TDSlidePopupRoute(
                  modalBarrierColor: TDTheme.of(context).fontGyColor2,
                  slideTransitionFrom: SlideTransitionFrom.bottom,
                  builder: (context) {
                    return TDPopupBottomDisplayPanel(
                      title: '剧集',
                      closeClick: () {
                        Navigator.maybePop(context);
                      },
                      child: Container(
                          height: 400,
                          padding: const EdgeInsets.all(16),
                          child: GridView.count(
                            crossAxisCount: 4, // 每行显示4个
                            mainAxisSpacing: 12, // 垂直间距
                            crossAxisSpacing: 12, // 水平间距
                            childAspectRatio: 1.2, // 宽高比
                            children: List.generate(
                                30,
                                (index) => GestureDetector(
                                      onTap: () {
                                        if (mounted) {
                                          setState(() {
                                            _selectIndex = index;
                                            Navigator.maybePop(context);
                                            final newUrl =
                                                "https://xxx/mp4/mv.mp4"; 
                                            widget
                                                .updateFn(newUrl); 
                                          });
                                        }
                                      },
                                      child: Container(
                                        decoration: BoxDecoration(
                                          color: _selectIndex == index
                                              ? Colors.orange
                                              : Colors.white,
                                          borderRadius:
                                              BorderRadius.circular(15),
                                          border: Border.all(
                                              color: Colors.grey),
                                        ),
                                        child: Center(
                                          child: Text(
                                            "${index + 1}",
                                            style: TextStyle(
                                                fontSize: 20,
                                                color: _selectIndex == index
                                                    ? Colors.white
                                                    : Colors.black,
                                                decoration:
                                                    TextDecoration.none),
                                          ),
                                        ),
                                      ),
                                    )),
                          )),
                    );
                  })),
              child: Text("剧集 >"))
        ],
      ),
    ),

    // 横向剧集选择器
    Container(
      height: 50,
      margin: const EdgeInsets.only(top: 15),
      child: ListView.separated(
        padding: const EdgeInsets.symmetric(horizontal: 20),
        scrollDirection: Axis.horizontal,
        shrinkWrap: true,
        physics: const BouncingScrollPhysics(),
        itemCount: 30,
        separatorBuilder: (_, __) => const SizedBox(width: 10),
        itemBuilder: (context, index) => GestureDetector(
          onTap: () {
            if (mounted) {
              setState(() {
                print("index信息:${index} _selectIndex:{$_selectIndex}");
                _selectIndex = index;
                final newUrl =
                    "https://images.qicaiy.cn/mp4/mv.mp4"; // 根据索引生成新URL
                widget.updateFn(newUrl); // 调用父级回调
              });
            }
          },
          child: Container(
            width: 50,
            decoration: BoxDecoration(
              color: _selectIndex == index ? Colors.orange : Colors.white,
              borderRadius: BorderRadius.circular(15),
              border: Border.all(color: Colors.grey),
            ),
            child: Center(
                child: Text(
              "${index + 1}",
              style: TextStyle(
                  color:
                      _selectIndex == index ? Colors.white : Colors.black),
            )),
          ),
        ),
      ),
    ),
  ],
);

}`

期望结果

No response

实际结果

No response

Flutter版本

3.27.4

设备与机型信息

No response

系统版本

No response

补充说明

No response

IssueShoot

  • 预估时长:3
  • 期望完成时间:2025-4-30
  • 开发难度:中
  • 参与人数:1
  • 需求对接人:zflyluo
  • 验收标准:这个应该是外部没有套Materail或Scafold导致的,尝试兼容这种用法,默认不出现下划线,提 MR并通过 验收无误
  • 备注:最终激励以实际提交 pr 并合并为准。TDesignFlutter贡献指南:https://tdesign.tencent.com/flutter/develop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions