diff --git a/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart b/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart index e12f4b649..991577027 100644 --- a/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart +++ b/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart @@ -92,94 +92,89 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { registerNavigateToHome: (func) => navigateToHomeFunction.value = func, ), + + if (maxIntensity != null) + IgnorePointer( + child: SafeArea( + child: Align( + alignment: Alignment.topRight, + child: Padding( + padding: const EdgeInsets.all(8), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 250), + child: BorderedContainer( + key: ValueKey( + (config, maxIntensity, maxLgIntensity), + ), + margin: const EdgeInsets.all(4), + padding: const EdgeInsets.all(4), + borderRadius: BorderRadius.circular((25 / 5) + 5), + child: Wrap( + spacing: 8, + runSpacing: 8, + children: [ + if (config.showingLpgmIntensity && + maxLgIntensity != null) + for (final intensity in [ + ...JmaLgIntensity.values, + ].where( + (e) => + e != JmaLgIntensity.zero && + e <= maxLgIntensity, + )) + JmaLgIntensityIcon( + type: IntensityIconType.filled, + intensity: intensity, + size: 25, + ) + else + for (final intensity in [ + ...JmaIntensity.values, + ].where( + (e) => e <= maxIntensity, + )) + JmaIntensityIcon( + type: IntensityIconType.filled, + intensity: intensity, + size: 25, + ), + ], + ), + ), + ), + ), + ), + ), + ), SheetFloatingActionButtons( hasAppBar: false, controller: sheetController, fab: [ - Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Column( children: [ - if (maxIntensity != null) - Expanded( - child: Container( - alignment: Alignment.centerLeft, - child: IgnorePointer( - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 250), - child: BorderedContainer( - key: ValueKey( - (config, maxIntensity, maxLgIntensity), - ), - margin: const EdgeInsets.all(4), - padding: const EdgeInsets.all(4), - borderRadius: BorderRadius.circular((25 / 5) + 5), - child: Wrap( - spacing: 8, - runSpacing: 8, - children: [ - if (config.showingLpgmIntensity && - maxLgIntensity != null) - for (final intensity in [ - ...JmaLgIntensity.values, - ].where( - (e) => - e != JmaLgIntensity.zero && - e <= maxLgIntensity, - )) - JmaLgIntensityIcon( - type: IntensityIconType.filled, - intensity: intensity, - size: 25, - ) - else - for (final intensity in [ - ...JmaIntensity.values, - ].where( - (e) => e <= maxIntensity, - )) - JmaIntensityIcon( - type: IntensityIconType.filled, - intensity: intensity, - size: 25, - ), - ], - ), - ), - ), - ), - ), - ) - else - const Spacer(), - Column( - children: [ - // layer controller - if (details.maxIntensity != null) - FloatingActionButton.small( - heroTag: 'earthquake_history_details_layer_fab', - tooltip: '地図の表示レイヤーを切り替える', - onPressed: () => - showEarthquakeHistoryDetailConfigDialog( - context, - showCitySelector: details.intensityCities != null, - hasLpgmIntensity: details.maxLpgmIntensity != null, - ), - elevation: 4, - child: const Icon(Icons.layers), - ), - FloatingActionButton.small( - heroTag: 'earthquake_history_details_fab', - tooltip: '表示領域を地図に合わせる', - onPressed: () { - if (navigateToHomeFunction.value != null) { - navigateToHomeFunction.value!.call(); - } - }, - elevation: 4, - child: const Icon(Icons.home), + // layer controller + if (details.maxIntensity != null) + FloatingActionButton.small( + heroTag: 'earthquake_history_details_layer_fab', + tooltip: '地図の表示レイヤーを切り替える', + onPressed: () => showEarthquakeHistoryDetailConfigDialog( + context, + showCitySelector: details.intensityCities != null, + hasLpgmIntensity: details.maxLpgmIntensity != null, ), - ], + elevation: 4, + child: const Icon(Icons.layers), + ), + FloatingActionButton.small( + heroTag: 'earthquake_history_details_fab', + tooltip: '表示領域を地図に合わせる', + onPressed: () { + if (navigateToHomeFunction.value != null) { + navigateToHomeFunction.value!.call(); + } + }, + elevation: 4, + child: const Icon(Icons.home), ), ], ), @@ -192,25 +187,21 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { ), if (Navigator.canPop(context)) // 戻るボタン - Positioned( - top: 0, - left: 0, - child: SafeArea( - child: IconButton.filledTonal( - style: ButtonStyle( - shape: MaterialStatePropertyAll( - RoundedRectangleBorder( - side: BorderSide( - color: colorScheme.primary.withOpacity(0.2), - ), - borderRadius: BorderRadius.circular(128), + SafeArea( + child: IconButton.filledTonal( + style: ButtonStyle( + shape: MaterialStatePropertyAll( + RoundedRectangleBorder( + side: BorderSide( + color: colorScheme.primary.withOpacity(0.2), ), + borderRadius: BorderRadius.circular(128), ), ), - icon: const Icon(Icons.arrow_back), - onPressed: () => context.pop(), - color: colorScheme.primary, ), + icon: const Icon(Icons.arrow_back), + onPressed: () => context.pop(), + color: colorScheme.primary, ), ), ], diff --git a/app/lib/feature/home/component/sheet/status_widget.dart b/app/lib/feature/home/component/sheet/status_widget.dart index 977fd6d19..882be2fd4 100644 --- a/app/lib/feature/home/component/sheet/status_widget.dart +++ b/app/lib/feature/home/component/sheet/status_widget.dart @@ -69,86 +69,89 @@ class SheetStatusWidget extends ConsumerWidget { // kmoni if (useKmoni) Expanded( - child: InkWell( - borderRadius: BorderRadius.circular(8), - onTap: adjustKmoniDelay, - child: Padding( - padding: const EdgeInsets.all(2), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - // 現在時刻 - ...switch (status) { - KmoniStatus.stopped => [ - const Icon( - Icons.access_time_rounded, - size: 16, - ), - const SizedBox(width: 4), - Flexible( - child: Text( - '強震モニタ 停止中', - style: theme.textTheme.bodyMedium, + child: Tooltip( + message: '強震モニタ遅延調整', + child: InkWell( + borderRadius: BorderRadius.circular(8), + onTap: adjustKmoniDelay, + child: Padding( + padding: const EdgeInsets.all(2), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + // 現在時刻 + ...switch (status) { + KmoniStatus.stopped => [ + const Icon( + Icons.access_time_rounded, + size: 16, ), - ), - ], - _ when isDelayAdjusting && latestTime != null => [ - Flexible( - child: Text( - DateFormat('yyyy/MM/dd HH:mm:ss') - .format(latestTime), - style: theme.textTheme.bodyMedium!.copyWith( - fontFamily: monoFont, - letterSpacing: -0.2, + const SizedBox(width: 4), + Flexible( + child: Text( + '強震モニタ 停止中', + style: theme.textTheme.bodyMedium, ), ), - ), - const SizedBox(width: 8), - const SizedBox( - height: 20, - width: 20, - child: CircularProgressIndicator.adaptive(), - ), - ], - _ - when isInitialized && - latestTime != null && - status == KmoniStatus.delay => - [ - Flexible( - child: Text( - DateFormat('yyyy/MM/dd HH:mm:ss') - .format(latestTime), - style: theme.textTheme.bodyMedium!.copyWith( - fontFamily: monoFont, - color: Colors.redAccent, - letterSpacing: -0.2, + ], + _ when isDelayAdjusting && latestTime != null => [ + Flexible( + child: Text( + DateFormat('yyyy/MM/dd HH:mm:ss') + .format(latestTime), + style: theme.textTheme.bodyMedium!.copyWith( + fontFamily: monoFont, + letterSpacing: -0.2, + ), ), ), - ), - ], - _ when isInitialized && latestTime != null => [ - Flexible( - child: Text( - DateFormat('yyyy/MM/dd HH:mm:ss').format( - latestTime, + const SizedBox(width: 8), + const SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator.adaptive(), + ), + ], + _ + when isInitialized && + latestTime != null && + status == KmoniStatus.delay => + [ + Flexible( + child: Text( + DateFormat('yyyy/MM/dd HH:mm:ss') + .format(latestTime), + style: theme.textTheme.bodyMedium!.copyWith( + fontFamily: monoFont, + color: Colors.redAccent, + letterSpacing: -0.2, + ), ), - style: theme.textTheme.bodyMedium!.copyWith( - fontFamily: monoFont, - letterSpacing: -0.2, + ), + ], + _ when isInitialized && latestTime != null => [ + Flexible( + child: Text( + DateFormat('yyyy/MM/dd HH:mm:ss').format( + latestTime, + ), + style: theme.textTheme.bodyMedium!.copyWith( + fontFamily: monoFont, + letterSpacing: -0.2, + ), ), ), - ), - ], - _ => [ - const SizedBox( - height: 20, - width: 20, - child: CircularProgressIndicator.adaptive(), - ), - ], - }, - ], + ], + _ => [ + const SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator.adaptive(), + ), + ], + }, + ], + ), ), ), ), diff --git a/app/lib/feature/home/view/home_view.dart b/app/lib/feature/home/view/home_view.dart index 275118f90..c8ebda422 100644 --- a/app/lib/feature/home/view/home_view.dart +++ b/app/lib/feature/home/view/home_view.dart @@ -261,12 +261,6 @@ class _HomeBodyWidget extends HookConsumerWidget { bottom: false, child: Stack( children: [ - SheetFloatingActionButtons( - controller: sheetController, - fab: const [ - _Fabs(), - ], - ), // Sheet const Align( alignment: Alignment.topRight, @@ -285,6 +279,13 @@ class _HomeBodyWidget extends HookConsumerWidget { ], ), ), + SheetFloatingActionButtons( + hasAppBar: false, + controller: sheetController, + fab: const [ + _Fabs(), + ], + ), ], ); return child;