mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
refactor: migrate MediaQuery properties to InheritedModel (#1115)
Co-authored-by: Ushie <ushiekane@gmail.com>
This commit is contained in:
parent
f5e45ead26
commit
97e37f304b
@ -94,7 +94,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0)
|
padding: const EdgeInsets.symmetric(horizontal: 12.0)
|
||||||
.copyWith(
|
.copyWith(
|
||||||
bottom:
|
bottom:
|
||||||
MediaQuery.of(context).viewPadding.bottom + 8.0,
|
MediaQuery.viewPaddingOf(context).bottom + 8.0,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
@ -57,7 +57,7 @@ class ContributorsView extends StatelessWidget {
|
|||||||
title: 'contributorsView.managerContributors',
|
title: 'contributorsView.managerContributors',
|
||||||
contributors: model.managerContributors,
|
contributors: model.managerContributors,
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).viewPadding.bottom),
|
SizedBox(height: MediaQuery.viewPaddingOf(context).bottom),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -33,7 +33,7 @@ class NavigationViewModel extends IndexTrackingViewModel {
|
|||||||
|
|
||||||
if (prefs.getBool('useDarkTheme') == null) {
|
if (prefs.getBool('useDarkTheme') == null) {
|
||||||
final bool isDark =
|
final bool isDark =
|
||||||
MediaQuery.of(context).platformBrightness != Brightness.light;
|
MediaQuery.platformBrightnessOf(context) != Brightness.light;
|
||||||
await prefs.setBool('useDarkTheme', isDark);
|
await prefs.setBool('useDarkTheme', isDark);
|
||||||
await DynamicTheme.of(context)!.setTheme(isDark ? 1 : 0);
|
await DynamicTheme.of(context)!.setTheme(isDark ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
: Padding(
|
: Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 12.0).copyWith(
|
const EdgeInsets.symmetric(horizontal: 12.0).copyWith(
|
||||||
bottom: MediaQuery.of(context).viewPadding.bottom + 8.0,
|
bottom: MediaQuery.viewPaddingOf(context).bottom + 8.0,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
@ -7,7 +7,7 @@ class AppSkeletonLoader extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
final screenWidth = MediaQuery.sizeOf(context).width;
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: 7,
|
itemCount: 7,
|
||||||
|
@ -25,7 +25,7 @@ class _GradientProgressIndicatorState extends State<GradientProgressIndicator> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
height: 5,
|
height: 5,
|
||||||
width: MediaQuery.of(context).size.width * widget.progress!,
|
width: MediaQuery.sizeOf(context).width * widget.progress!,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,9 @@ class OptionsTextField extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final sHeight = MediaQuery.of(context).size.height;
|
final size = MediaQuery.sizeOf(context);
|
||||||
final sWidth = MediaQuery.of(context).size.width;
|
final sHeight = size.height;
|
||||||
|
final sWidth = size.width;
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(top: 12, bottom: 6),
|
margin: const EdgeInsets.only(top: 12, bottom: 6),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
Loading…
Reference in New Issue
Block a user