diff --git a/lib/presentation/artifact/artifact_page.dart b/lib/presentation/artifact/artifact_page.dart index 50d464f3d..73769c73c 100644 --- a/lib/presentation/artifact/artifact_page.dart +++ b/lib/presentation/artifact/artifact_page.dart @@ -50,6 +50,8 @@ class _PortraitLayout extends StatelessWidget { color: rarityColor, fullImage: state.image, charDescriptionHeight: 120, + widthOnPortrait: 240, + heightOnPortrait: 240, appBar: const DetailAppBar(), isAnSmallImage: true, generalCard: DetailGeneralCard( diff --git a/lib/presentation/material/widgets/material_detail_top.dart b/lib/presentation/material/widgets/material_detail_top.dart index d918bfd1b..324f335fd 100644 --- a/lib/presentation/material/widgets/material_detail_top.dart +++ b/lib/presentation/material/widgets/material_detail_top.dart @@ -26,9 +26,12 @@ class MaterialDetailTop extends StatelessWidget { @override Widget build(BuildContext context) { + final isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; return DetailTopLayout( fullImage: image, charDescriptionHeight: 160, + heightOnPortrait: isPortrait ? 250 : null, + widthOnPortrait: isPortrait ? 250 : null, isAnSmallImage: MediaQuery.of(context).orientation == Orientation.portrait, heightOnLandscape: MediaQuery.of(context).size.height * 0.7, decoration: BoxDecoration(gradient: rarity.getRarityGradient()), diff --git a/lib/presentation/shared/details/detail_top_layout.dart b/lib/presentation/shared/details/detail_top_layout.dart index aa7dcbade..cd70f4479 100644 --- a/lib/presentation/shared/details/detail_top_layout.dart +++ b/lib/presentation/shared/details/detail_top_layout.dart @@ -11,14 +11,18 @@ double? _getWidthToUse( }) { final mediaQuery = MediaQuery.of(context); final isPortrait = mediaQuery.orientation == Orientation.portrait; - final size = getDeviceType(mediaQuery.size); + // final size = getDeviceType(mediaQuery.size); if (isPortrait) { final value = widthOnPortrait ?? _imageWidthOnPortrait; - return size == DeviceScreenType.mobile - ? !isAnSmallImage - ? value - : (value / 2) - : value; + // final newValue = size == DeviceScreenType.mobile + // ? !isAnSmallImage + // ? value + // : (value / 2) + // : value; + // if (isAnSmallImage && newValue > 250) { + // return 250; + // } + return value; } final value = widthOnLandscape ?? _imageWidthOnPortrait; @@ -33,15 +37,20 @@ double? _getHeightToUse( }) { final mediaQuery = MediaQuery.of(context); final isPortrait = mediaQuery.orientation == Orientation.portrait; - final size = getDeviceType(mediaQuery.size); + // final size = getDeviceType(mediaQuery.size); final imgHeight = mediaQuery.size.height; if (isPortrait) { final value = heightOnPortrait ?? imgHeight; - return size == DeviceScreenType.mobile - ? !isAnSmallImage - ? value - : (value / 2) - : value; + // final newValue = size == DeviceScreenType.mobile + // ? !isAnSmallImage + // ? value + // : (value / 2) + // : value; + + // if (isAnSmallImage && newValue > 250) { + // return 250; + // } + return value; } final value = heightOnLandscape ?? imgHeight; @@ -110,6 +119,8 @@ class DetailTopLayout extends StatelessWidget { widthOnLandscape: widthOnLandscape, heightOnLandscape: heightOnLandscape, isAnSmallImage: isAnSmallImage, + heightOnPortrait: heightOnPortrait, + widthOnPortrait: widthOnPortrait, ), Align( alignment: imgAlignment, diff --git a/lib/presentation/weapon/widgets/weapon_detail_top.dart b/lib/presentation/weapon/widgets/weapon_detail_top.dart index 719925f3b..ab1ad045d 100644 --- a/lib/presentation/weapon/widgets/weapon_detail_top.dart +++ b/lib/presentation/weapon/widgets/weapon_detail_top.dart @@ -44,6 +44,9 @@ class WeaponDetailTop extends StatelessWidget { heightOnLandscape: mediaQuery.size.height * 0.8, showShadowImage: isPortrait, charDescriptionHeight: 200, + widthOnPortrait: isPortrait ? 250 : null, + heightOnPortrait: isPortrait ? 350 : null, + isAnSmallImage: isPortrait, generalCard: WeaponDetailGeneralCard( type: type, atk: atk,