-
Notifications
You must be signed in to change notification settings - Fork 18
/
upload_media_attachment_list_all_widget.dart
53 lines (47 loc) · 1.48 KB
/
upload_media_attachment_list_all_widget.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import 'package:fedi/app/media/attachment/upload/list/media/upload_media_attachment_list_media_widget.dart';
import 'package:fedi/app/media/attachment/upload/list/non_media/upload_media_attachment_list_non_media_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
class UploadMediaAttachmentListAllWidget extends StatelessWidget {
final bool scrollable;
final double? heightOnKeyboardOpen;
const UploadMediaAttachmentListAllWidget({
required this.scrollable,
required this.heightOnKeyboardOpen,
});
@override
Widget build(BuildContext context) {
var column = Column(
children: [
const UploadMediaAttachmentListMediaWidget(),
const UploadMediaAttachmentListNonMediaWidget(),
],
);
Widget child;
if (scrollable) {
child = SingleChildScrollView(
child: column,
);
} else {
child = column;
}
if (heightOnKeyboardOpen != null) {
return KeyboardVisibilityBuilder(
builder: (context, isKeyboardVisible) {
if (isKeyboardVisible) {
return ConstrainedBox(
// height: heightOnKeyboardOpen,
constraints: BoxConstraints(maxHeight: heightOnKeyboardOpen!),
child: child,
);
} else {
return child;
}
},
);
} else {
return child;
}
}
}