dart 如何增加横幅的整体厚度?

lymnna71  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(34)

我正在做一个flutter应用程序,其中有一个卡片的网格视图,显示列表中不同项目的详细信息。在卡片的右上角,我使用横幅小部件添加了一个横幅,显示项目的当前状态。

这就是横幅的样子。但是我想把横幅移到角落里,让它更宽一些。

Card(
  elevation: 1.0,
  child: ClipRect(
    child: Banner(
      textStyle: TextStyle(color: Colors.white),
      message: 'OPEN'
      location: BannerLocation.topEnd,
      color: const Color(0xFF0db3ae),
      child: InkWell(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Text('......')
        ),
        onTap: () {},
      ),
    ),
  ),
);

字符串
这是我用来制作卡片的代码的基本结构,以确保横幅围绕卡片。但是我找不到一种方法来增加它的宽度或将其移动到角落。

ulmd4ohb

ulmd4ohb1#

请改用Ribbon。

//
import 'package:ribbon/ribbon.dart';

Ribbon(
nearLength: nearLength,
farLength: farLength,
title: 'New!',
titleStyle: TextStyle(
color: Colors.greenAccent,
fontSize: 18,
fontWeight: FontWeight.bold),
color: Colors.redAccent,
location: location,
child: )

字符串
友情链接:https://pub.dev/packages/ribbon_widget

相关问题