fix sepWidget extension when list empty

null_safety
小赖 4 years ago
parent 8ebf741d06
commit 871f34fca3

@ -3,6 +3,8 @@ import 'package:ansu_ui/extension/num_extension.dart';
extension SeparateExt on List<Widget> {
List<Widget> sepWidget({Widget separate}) {
if (this == null) return null;
if (this.isEmpty) return [];
return List.generate(this.length * 2 - 1, (index) {
if (index.isEven)
return this[index ~/ 2];

Loading…
Cancel
Save