-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
detail_bottom_portrait_layout.dart
39 lines (35 loc) · 1.2 KB
/
detail_bottom_portrait_layout.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
import 'package:flutter/material.dart';
import 'package:genshindb/presentation/character/widgets/character_detail.dart';
import 'package:genshindb/presentation/shared/styles.dart';
import 'package:responsive_builder/responsive_builder.dart';
import 'constants.dart';
class DetailBottomPortraitLayout extends StatelessWidget {
final List<Widget> children;
final bool isAnSmallImage;
const DetailBottomPortraitLayout({
Key? key,
required this.children,
this.isAnSmallImage = true,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final maxTopHeight = getTopMarginForPortrait(context, charDescriptionHeight, isAnSmallImage);
final device = getDeviceType(size);
final width = size.width * (device == DeviceScreenType.mobile ? 0.9 : 0.8);
return SizedBox(
width: width,
child: Card(
margin: EdgeInsets.only(top: maxTopHeight),
shape: Styles.cardItemDetailShape,
child: Padding(
padding: Styles.edgeInsetAll10,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: children,
),
),
),
);
}
}