chore: migrate deprecation code && code cleanup (#708)

Fixes all issues in `flutter analyze`.
<Reviewed>

Commits:
* chore: migrate deprecated text style

* chore: migrate `toggleableActiveColor` to individual theme

* chore: don't use 'BuildContext's across async gaps
This commit is contained in:
EvadeMaster
2023-02-19 10:16:49 +07:00
parent dc665f227e
commit 3ae4d69110
16 changed files with 189 additions and 51 deletions

View File

@ -27,7 +27,7 @@ class AppInfoView extends StatelessWidget {
child: Text(
'',
style: GoogleFonts.inter(
color: Theme.of(context).textTheme.headline6!.color,
color: Theme.of(context).textTheme.titleLarge!.color,
),
),
),
@ -51,13 +51,13 @@ class AppInfoView extends StatelessWidget {
Text(
app.name,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 4),
Text(
app.version,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 20),
Padding(

View File

@ -28,7 +28,7 @@ class AvailableUpdatesCard extends StatelessWidget {
child: Text(
'',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
@ -53,7 +53,7 @@ class AvailableUpdatesCard extends StatelessWidget {
// child: Text(
// '',
// textAlign: TextAlign.center,
// style: Theme.of(context).textTheme.subtitle1!.copyWith(
// style: Theme.of(context).textTheme.titleMedium!.copyWith(
// color: Theme.of(context).colorScheme.secondary,
// ),
// ),

View File

@ -30,7 +30,7 @@ class InstalledAppsCard extends StatelessWidget {
child: Text(
'',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),

View File

@ -61,7 +61,7 @@ class OptionsFilePicker extends StatelessWidget {
child: Text(
'Select File',
style: TextStyle(
color: Theme.of(context).textTheme.bodyText1?.color,
color: Theme.of(context).textTheme.bodyLarge?.color,
),
),
),

View File

@ -17,7 +17,7 @@ class CustomChip extends StatelessWidget {
showCheckmark: false,
label: label,
selected: isSelected,
labelStyle: Theme.of(context).textTheme.subtitle2!.copyWith(
labelStyle: Theme.of(context).textTheme.titleSmall!.copyWith(
color: isSelected
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,

View File

@ -33,7 +33,7 @@ class CustomSliverAppBar extends StatelessWidget {
: IconButton(
icon: Icon(
Icons.arrow_back,
color: Theme.of(context).textTheme.headline6!.color,
color: Theme.of(context).textTheme.titleLarge!.color,
),
onPressed:
onBackButtonPressed ?? () => Navigator.of(context).pop(),