Skip to content

Commit b6c7119

Browse files
committed
fix: Flat plate width
1 parent a40084f commit b6c7119

1 file changed

Lines changed: 113 additions & 111 deletions

File tree

lib/app/home/page.dart

Lines changed: 113 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -716,121 +716,123 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
716716
);
717717
}
718718

719-
return Padding(
720-
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
721-
child: Container(
722-
padding: const EdgeInsets.all(10),
723-
decoration: BoxDecoration(
724-
color: context.colors.surfaceContainer,
725-
borderRadius: BorderRadius.circular(12),
726-
),
727-
child: Column(
728-
crossAxisAlignment: CrossAxisAlignment.start,
729-
children: [
730-
Row(
731-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
732-
children: [
733-
Row(
734-
mainAxisSize: MainAxisSize.min,
735-
children: [
736-
Icon(
737-
Symbols.pin_drop_rounded,
738-
size: 14,
739-
color: context.colors.primary,
740-
),
741-
const SizedBox(width: 4),
742-
Text(
743-
'觀測點'.i18n,
744-
style: context.texts.labelMedium?.copyWith(
745-
color: context.colors.onSurfaceVariant,
719+
return ResponsiveContainer(
720+
child: Padding(
721+
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
722+
child: Container(
723+
padding: const EdgeInsets.all(10),
724+
decoration: BoxDecoration(
725+
color: context.colors.surfaceContainer,
726+
borderRadius: BorderRadius.circular(12),
727+
),
728+
child: Column(
729+
crossAxisAlignment: CrossAxisAlignment.start,
730+
children: [
731+
Row(
732+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
733+
children: [
734+
Row(
735+
mainAxisSize: MainAxisSize.min,
736+
children: [
737+
Icon(
738+
Symbols.pin_drop_rounded,
739+
size: 14,
740+
color: context.colors.primary,
746741
),
747-
),
748-
const SizedBox(width: 6),
749-
Text(
750-
hasData ? weather.station.name : '--',
751-
style: context.texts.labelMedium?.copyWith(
752-
color: context.colors.onSurface,
753-
fontWeight: FontWeight.w600,
742+
const SizedBox(width: 4),
743+
Text(
744+
'觀測點'.i18n,
745+
style: context.texts.labelMedium?.copyWith(
746+
color: context.colors.onSurfaceVariant,
747+
),
754748
),
755-
),
756-
],
757-
),
758-
Row(
759-
mainAxisSize: MainAxisSize.min,
760-
children: [
761-
Icon(
762-
Symbols.schedule_rounded,
763-
size: 12,
764-
color: context.colors.onSurfaceVariant,
765-
),
766-
const SizedBox(width: 4),
767-
Text(
768-
timeStr,
769-
style: context.texts.labelSmall?.copyWith(
749+
const SizedBox(width: 6),
750+
Text(
751+
hasData ? weather.station.name : '--',
752+
style: context.texts.labelMedium?.copyWith(
753+
color: context.colors.onSurface,
754+
fontWeight: FontWeight.w600,
755+
),
756+
),
757+
],
758+
),
759+
Row(
760+
mainAxisSize: MainAxisSize.min,
761+
children: [
762+
Icon(
763+
Symbols.schedule_rounded,
764+
size: 12,
770765
color: context.colors.onSurfaceVariant,
771766
),
772-
),
773-
],
774-
),
775-
],
776-
),
777-
const SizedBox(height: 8),
778-
Wrap(
779-
spacing: 6,
780-
runSpacing: 6,
781-
children: [
782-
buildChip(
783-
'濕度'.i18n,
784-
hasData && weather.data.humidity >= 0
785-
? '${weather.data.humidity.round()}%'
786-
: '--',
787-
Symbols.water_drop_rounded,
788-
),
789-
buildChip(
790-
'氣壓'.i18n,
791-
hasData && weather.data.pressure >= 0
792-
? '${weather.data.pressure.round()}hPa'
793-
: '--',
794-
Symbols.compress_rounded,
795-
),
796-
buildChip(
797-
'降雨'.i18n,
798-
hasData && weather.data.rain >= 0
799-
? '${weather.data.rain}mm'
800-
: '--',
801-
Symbols.rainy_rounded,
802-
),
803-
buildChip(
804-
'能見度'.i18n,
805-
hasData && weather.data.visibility >= 0
806-
? '${weather.data.visibility.round()}km'
807-
: '--',
808-
Symbols.visibility_rounded,
809-
),
810-
],
811-
),
812-
const SizedBox(height: 6),
813-
Wrap(
814-
spacing: 6,
815-
runSpacing: 6,
816-
children: [
817-
buildChip(
818-
'風速'.i18n,
819-
hasData && weather.data.wind.speed >= 0
820-
? '${weather.data.wind.direction.isNotEmpty ? '${weather.data.wind.direction} ' : ''}${weather.data.wind.speed}m/s'
821-
: '--',
822-
Symbols.air_rounded,
823-
),
824-
buildChip(
825-
'陣風'.i18n,
826-
hasData && weather.data.gust.speed > 0
827-
? '${weather.data.gust.speed}m/s'
828-
: '--',
829-
Symbols.storm_rounded,
830-
),
831-
],
832-
),
833-
],
767+
const SizedBox(width: 4),
768+
Text(
769+
timeStr,
770+
style: context.texts.labelSmall?.copyWith(
771+
color: context.colors.onSurfaceVariant,
772+
),
773+
),
774+
],
775+
),
776+
],
777+
),
778+
const SizedBox(height: 8),
779+
Wrap(
780+
spacing: 6,
781+
runSpacing: 6,
782+
children: [
783+
buildChip(
784+
'濕度'.i18n,
785+
hasData && weather.data.humidity >= 0
786+
? '${weather.data.humidity.round()}%'
787+
: '--',
788+
Symbols.water_drop_rounded,
789+
),
790+
buildChip(
791+
'氣壓'.i18n,
792+
hasData && weather.data.pressure >= 0
793+
? '${weather.data.pressure.round()}hPa'
794+
: '--',
795+
Symbols.compress_rounded,
796+
),
797+
buildChip(
798+
'降雨'.i18n,
799+
hasData && weather.data.rain >= 0
800+
? '${weather.data.rain}mm'
801+
: '--',
802+
Symbols.rainy_rounded,
803+
),
804+
buildChip(
805+
'能見度'.i18n,
806+
hasData && weather.data.visibility >= 0
807+
? '${weather.data.visibility.round()}km'
808+
: '--',
809+
Symbols.visibility_rounded,
810+
),
811+
],
812+
),
813+
const SizedBox(height: 6),
814+
Wrap(
815+
spacing: 6,
816+
runSpacing: 6,
817+
children: [
818+
buildChip(
819+
'風速'.i18n,
820+
hasData && weather.data.wind.speed >= 0
821+
? '${weather.data.wind.direction.isNotEmpty ? '${weather.data.wind.direction} ' : ''}${weather.data.wind.speed}m/s'
822+
: '--',
823+
Symbols.air_rounded,
824+
),
825+
buildChip(
826+
'陣風'.i18n,
827+
hasData && weather.data.gust.speed > 0
828+
? '${weather.data.gust.speed}m/s'
829+
: '--',
830+
Symbols.storm_rounded,
831+
),
832+
],
833+
),
834+
],
835+
),
834836
),
835837
),
836838
);

0 commit comments

Comments
 (0)