Skip to content

Commit

Permalink
fix: deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckUVeryX committed May 15, 2024
1 parent 2390189 commit 93e93dc
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 34 deletions.
4 changes: 2 additions & 2 deletions lib/app/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class AppTheme {
final listTileTheme = ListTileThemeData(
titleTextStyle: textTheme.bodyLarge,
subtitleTextStyle: textTheme.labelLarge,
textColor: colorScheme.onBackground,
textColor: colorScheme.onSurface,
);

final inputDecorationTheme = InputDecorationTheme(
filled: true,
fillColor: colorScheme.surfaceVariant,
fillColor: colorScheme.surfaceContainerHighest,
errorStyle: textTheme.bodyMedium?.copyWith(
color: colorScheme.errorContainer,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/app/views/widgets/evolve_logo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EvolveLogo extends StatelessWidget {
dimension: dimension ?? 24,
child: CustomPaint(
painter: _EvolveLogoPainter(
color: color ?? context.colorScheme.onBackground,
color: color ?? context.colorScheme.onSurface,
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/attendance/views/widgets/attendance_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AttendanceCard extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
const height = 160.0;
const margin = EdgeInsets.symmetric(vertical: 8);
final backgroundColor = context.colorScheme.background;
final backgroundColor = context.colorScheme.surface;
final value = ref.watch(AttendanceDayProvider(filter: filter));

return value.when(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AttendanceDateHeader extends StatelessWidget {
child: Text(
DateFormat.yMMMEd().format(date),
style: context.textTheme.headlineSmall?.copyWith(
color: context.colorScheme.onBackground,
color: context.colorScheme.onSurface,
fontWeight: FontWeight.bold,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/booking/views/late_booking_confirm_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LateBookingConfirmDialog extends StatelessWidget {
Widget build(BuildContext context) {
return Dialog(
child: NeuContainer(
color: context.colorScheme.surfaceVariant,
color: context.colorScheme.surfaceContainerHighest,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/facility/views/facility_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FacilityDialog extends ConsumerWidget {

return Dialog(
child: NeuContainer(
color: context.colorScheme.surfaceVariant,
color: context.colorScheme.surfaceContainerHighest,
child: Material(
color: Colors.transparent,
child: Column(
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/qr/views/qr_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class QRCode extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final id = ref.watch(userProvider).id;
return QrImageView(
backgroundColor: context.colorScheme.background,
backgroundColor: context.colorScheme.surface,
data: id,
eyeStyle: QrEyeStyle(
eyeShape: QrEyeShape.square,
color: context.colorScheme.onBackground,
color: context.colorScheme.onSurface,
),
dataModuleStyle: QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.square,
color: context.colorScheme.onBackground,
color: context.colorScheme.onSurface,
),
embeddedImage: const CachedNetworkImageProvider(
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQs_VVgajqAz15gS4Pt8drb59szsee8MZTjtcpQU9Woh9gRpMf7',
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/qr/views/qr_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ ${(qrSetting.shakeCountReset.inMilliseconds / 1000).toStringAsFixed(2)}s''',
Expanded(
child: NeuTextButton(
label: context.l10n.settingsQRCancel,
backgroundColor: context.colorScheme.background,
foregroundColor: context.colorScheme.onBackground,
backgroundColor: context.colorScheme.surface,
foregroundColor: context.colorScheme.onSurface,
onPressed: context.pop,
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/schedule/views/widgets/schedule_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ScheduleAppBar extends ConsumerWidget {
bottom: const ScheduleTabBar(),
leading: const _LocationIconButton(),
actions: const [_SettingsIconButton()],
backgroundColor: context.colorScheme.background,
foregroundColor: context.colorScheme.onBackground,
backgroundColor: context.colorScheme.surface,
foregroundColor: context.colorScheme.onSurface,
actionsIconTheme: context.theme.iconTheme,
);
}
Expand Down Expand Up @@ -53,8 +53,8 @@ class _LocationIconButton extends ConsumerWidget {

return Center(
child: NeuIconButton(
foregroundColor: context.colorScheme.onBackground,
backgroundColor: context.colorScheme.background,
foregroundColor: context.colorScheme.onSurface,
backgroundColor: context.colorScheme.surface,
onPressed: () async {
final newFacility = await FacilityDialog.show(context);
if (newFacility == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ScheduleDateHeader extends StatelessWidget {
child: Text(
DateFormat.MMMEd().format(dt),
style: context.textTheme.headlineLarge?.copyWith(
color: context.colorScheme.onBackground,
color: context.colorScheme.onSurface,
fontWeight: FontWeight.bold,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/schedule/views/widgets/schedule_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ScheduleTabBar extends ConsumerWidget implements PreferredSizeWidget {
final areas = facility.areas;

return NeuContainer(
color: context.colorScheme.background,
color: context.colorScheme.surface,
padding: const EdgeInsets.all(2),
margin: const EdgeInsets.all(4).copyWith(right: 8),
child: TabBar(
Expand All @@ -33,7 +33,7 @@ class ScheduleTabBar extends ConsumerWidget implements PreferredSizeWidget {
borderRadius: BorderRadius.circular(2),
),
labelColor: context.colorScheme.onPrimary,
unselectedLabelColor: context.colorScheme.onBackground,
unselectedLabelColor: context.colorScheme.onSurface,
),
);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/modules/settings/views/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class _SettingsItem extends StatelessWidget {
padding: const EdgeInsets.all(8),
child: NeuButton(
onPressed: onTap,
backgroundColor: backgroundColor ?? context.colorScheme.surfaceVariant,
backgroundColor:
backgroundColor ?? context.colorScheme.surfaceContainerHighest,
child: ListTile(
leading: Icon(leadingIcon),
title: Text(label),
Expand Down
28 changes: 14 additions & 14 deletions lib/modules/user/views/account_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class AccountSettingsPage extends ConsumerWidget {
return Scaffold(
body: CheckboxTheme(
data: CheckboxThemeData(
fillColor: MaterialStateColor.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
fillColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return context.colorScheme.primary;
}
return context.colorScheme.onBackground;
return context.colorScheme.onSurface;
}),
),
child: CustomScrollView(
Expand Down Expand Up @@ -85,47 +85,47 @@ class AccountSettingsPage extends ConsumerWidget {
title: Text(
context.l10n.settingsAccountAutoBook,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
_AccountCheckboxListTile(
value: user.addBuddy,
title: Text(
context.l10n.settingsAccountAddBuddy,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
_AccountCheckboxListTile(
value: user.isEmployee,
title: Text(
context.l10n.settingsAccountIsEmployee,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
_AccountCheckboxListTile(
value: user.accessToRegularClasses,
title: Text(
context.l10n.settingsAccountAccessToRegularClasses,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
_AccountCheckboxListTile(
value: user.hasActiveTEAP,
title: Text(
context.l10n.settingsAccountHasActiveTEAP,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
_AccountCheckboxListTile(
value: user.isActiveGeneralMembership,
title: Text(
context.l10n.settingsAccountIsActveGeneralMembership,
style: context.textTheme.bodyLarge
?.copyWith(color: context.colorScheme.onBackground),
?.copyWith(color: context.colorScheme.onSurface),
),
),
],
Expand All @@ -149,12 +149,12 @@ class _AccountCheckboxListTile extends StatelessWidget {
return SliverToBoxAdapter(
child: NeuContainer(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
color: context.colorScheme.surfaceVariant,
color: context.colorScheme.surfaceContainerHighest,
child: CheckboxListTile(
fillColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled) &&
!states.contains(MaterialState.selected)) {
return context.colorScheme.surfaceVariant;
fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled) &&
!states.contains(WidgetState.selected)) {
return context.colorScheme.surfaceContainerHighest;
}
return null;
}),
Expand Down

0 comments on commit 93e93dc

Please sign in to comment.