Files
wehub-resource-sync bb087aad19
CI / format (push) Failing after 2s
CI / packaging (push) Failing after 0s
CI / test (push) Failing after 3s
chore: import upstream snapshot with attribution
2026-07-13 11:58:56 +08:00

35 lines
942 B
Dart

import 'package:flutter/material.dart';
/// Behaves like a [Column] if there is enough space, otherwise like a [ListView].
class ColumnListView extends StatelessWidget {
final CrossAxisAlignment crossAxisAlignment;
final List<Widget> children;
const ColumnListView({
required this.children,
this.crossAxisAlignment = CrossAxisAlignment.center,
});
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
),
child: IntrinsicHeight(
child: Column(
crossAxisAlignment: crossAxisAlignment,
mainAxisSize: MainAxisSize.min,
children: children,
),
),
),
);
},
);
}
}