@@ -123,7 +123,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
123123
124124 if (isFirstMeasure && mounted) {
125125 WidgetsBinding .instance.addPostFrameCallback ((_) {
126- final screenHeight = MediaQuery . of ( context).size .height;
126+ final screenHeight = context.dimension .height;
127127 final targetSize = (height / screenHeight).clamp (0.25 , 0.6 );
128128 _sheetController.animateTo (
129129 targetSize,
@@ -394,7 +394,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
394394 imagePath: wallpaperPath,
395395 );
396396
397- final screenHeight = MediaQuery . of ( context).size .height;
397+ final screenHeight = context.dimension .height;
398398 final baseSnapSize = (_firstCardHeight / screenHeight).clamp (0.25 , 0.6 );
399399 final handleHeight = 28.0 / screenHeight;
400400 final minSize = handleHeight.clamp (0.03 , 0.05 );
@@ -543,7 +543,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
543543 }
544544
545545 Widget _buildDraggableSheet (List <HomeDisplaySection > homeSections) {
546- final screenHeight = MediaQuery . of ( context).size .height;
546+ final screenHeight = context.dimension .height;
547547 final baseSnapSize = (_firstCardHeight / screenHeight).clamp (0.25 , 0.6 );
548548 final handleHeight = 28.0 / screenHeight;
549549 final minSize = handleHeight.clamp (0.03 , 0.05 );
@@ -601,7 +601,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
601601
602602 Widget _buildHeroSection () {
603603 final code = GlobalProviders .location.code;
604- final screenHeight = MediaQuery . of ( context).size .height;
604+ final screenHeight = context.dimension .height;
605605
606606 if (code == null ) {
607607 return SizedBox (
@@ -700,7 +700,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
700700 return Column (
701701 children: [
702702 ...allCards,
703- SizedBox (height: MediaQuery . of ( context) .padding.bottom + 16 ),
703+ SizedBox (height: context.padding.bottom + 16 ),
704704 ],
705705 );
706706 }
@@ -714,9 +714,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
714714 ),
715715 (
716716 icon: SimpleIcons .threads,
717- color: Theme .of (context).brightness == Brightness .dark
718- ? Colors .white
719- : Colors .black,
717+ color: context.theme.brightness == .dark ? Colors .white : Colors .black,
720718 url: 'https://www.threads.net/@dpip.tw' ,
721719 ),
722720 (
@@ -726,7 +724,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
726724 ),
727725 (
728726 icon: Symbols .favorite_rounded,
729- color: Theme . of ( context).colorScheme .primary,
727+ color: context.colors .primary,
730728 url: SettingsDonatePage .route,
731729 ),
732730 ];
@@ -800,7 +798,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
800798 color: color.withValues (alpha: 0.15 ),
801799 borderRadius: BorderRadius .circular (8 ),
802800 border: Border .all (
803- color: Theme . of ( context). brightness == Brightness .dark
801+ color: context.theme. brightness == .dark
804802 ? Colors .white.withValues (alpha: 0.25 )
805803 : const Color .fromARGB (
806804 255 ,
@@ -817,7 +815,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
817815 Text (
818816 label,
819817 style: context.texts.labelSmall? .copyWith (
820- color: Theme . of ( context) .brightness == Brightness .dark
818+ color: context.theme .brightness == Brightness .dark
821819 ? Colors .white
822820 : const Color .fromARGB (255 , 90 , 90 , 90 ),
823821 fontWeight: FontWeight .w700,
@@ -827,7 +825,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
827825 Text (
828826 value,
829827 style: context.texts.bodySmall? .copyWith (
830- color: Theme . of ( context) .brightness == Brightness .dark
828+ color: context.theme .brightness == Brightness .dark
831829 ? Colors .white
832830 : const Color .fromARGB (255 , 60 , 60 , 60 ),
833831 fontWeight: FontWeight .w600,
0 commit comments