Browse Source

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

ashilkn 2 năm trước cách đây
mục cha
commit
9fe6519efa
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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);