簡體   English   中英

如何擺脫這個自定義小部件周圍的額外填充? (飛鏢)

[英]How do I get rid of the extra padding around this custom widget? (flutter-dart)

我創建了一個自定義小部件,它只是一排按鈕。 但是,它在我想刪除的按鈕周圍添加了填充,事情是我不知道如何。

這是它的樣子。

在此處輸入圖像描述

這是單個按鈕的代碼。

@override
Widget build(BuildContext context) {
  return MaterialButton(
    padding: EdgeInsets.zero,
    materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
    onPressed: onPressed ?? null,
    color: color,
    textColor: iconColor,
    child: SvgPicture.asset(iconLocation,
        width: height / 2, height: height / 2, color: iconColor),
    shape: CircleBorder(),
    height: height,
  );
}
 contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),

使它成為 0.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM