浏览代码

Removed SizedBoxs from listOfWidgets passed to addSeparators() inorder to avoid adding unwanted separators

ashilkn 2 年之前
父节点
当前提交
9fe6519efa
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/utils/separators_util.dart

+ 1 - 0
lib/utils/separators_util.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 //This method returns a newly declared list with separators. It will not
 //modify the original list
 List<Widget> addSeparators(List<Widget> listOfWidgets, Widget separator) {
+  listOfWidgets.removeWhere((element) => (element is SizedBox));
   final int initialLength = listOfWidgets.length;
   final listOfWidgetsWithSeparators = <Widget>[];
   listOfWidgetsWithSeparators.addAll(listOfWidgets);