refactor(legacy): migrate theming to Material 3 + SfColors extension
Replace the ThemePort/ThemeCode abstraction (GetIt-registered adapter) with a Riverpod-driven Material 3 ColorScheme, an SfColors ThemeExtension for brand tokens, and a user-facing appearance selector for light/dark/ system modes. Persisted via SharedPreferences, reacts to system brightness changes. Payments mode keeps the existing ThemePort API. Highlights - New legacy_theme package: LegacyAppTheme (light/dark), LegacyColorSchemes, SfColors ThemeExtension, LegacyThemePreferences, LegacyThemeNotifier, LegacyThemeSelector. Timeframe-based variants scaffolded but disabled. - New /legacy/dashboard/control_panel/settings/appearance route + screen. - MaterialApp.router picks the legacy theme only when isLegacyMode. - ~90 ThemeCode.* usages migrated to colorScheme.* / context.sfColors.*. - 25 widgets dropped the 'ThemePort theme' constructor param. - ~145 hardcoded colors migrated (exact hex 1:1, grey.shade tiers, destructive red -> colorScheme.error, background whites -> surface). Content-over-color whites, transparents, and brand semantic reds/ oranges/greens intentionally preserved. - sf_localizations updated with appearance / appearanceDescription keys in all six locales.
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:sca_treezor/sca_treezor.dart';
|
||||
import 'package:videocall_sdk/videocall_sdk.dart';
|
||||
import 'package:sf_app_platform/config/env/save_family_videocall_config.dart';
|
||||
@@ -18,12 +19,15 @@ import 'package:sf_app_platform/save_family_app.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
||||
import 'package:sf_tracking/sf_tracking.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
Future<void> initApp(EnvironmentEnum env) async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
await initializeDateFormatting();
|
||||
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
|
||||
navigationModule();
|
||||
scaTreezorModule();
|
||||
videocallSdkModule(SaveFamilyVideocallConfig());
|
||||
@@ -55,5 +59,12 @@ Future<void> initApp(EnvironmentEnum env) async {
|
||||
},
|
||||
);
|
||||
|
||||
runApp(const ProviderScope(child: SaveFamilyApp()));
|
||||
runApp(
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
sharedPreferencesProvider.overrideWithValue(sharedPreferences),
|
||||
],
|
||||
child: const SaveFamilyApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -250,6 +250,11 @@ void configureAppRouter() {
|
||||
name: 'settings',
|
||||
pageBuilder: SettingsBuilder().buildPage,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: 'appearance',
|
||||
name: 'appearance',
|
||||
pageBuilder: AppearanceBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: 'alarm',
|
||||
name: 'alarm',
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:sf_app_platform/core/app_version_check/app_update_gate.dart';
|
||||
import 'package:sf_app_platform/core/app_version_check/app_version_check.dart';
|
||||
import 'package:sf_app_platform/core/config/app_mode.dart';
|
||||
@@ -130,13 +131,32 @@ class SaveFamilyAppState extends ConsumerState<SaveFamilyApp>
|
||||
SizeUtils.init(context: context);
|
||||
ref.watch(pushTokenRefreshListenerProvider);
|
||||
|
||||
// Theme wiring:
|
||||
// - Legacy mode: new `legacy_theme` package (Material 3 + light/dark/system).
|
||||
// - Payment mode: unchanged behaviour (seed-based ColorScheme, light only).
|
||||
final ThemeData lightTheme;
|
||||
final ThemeData? darkTheme;
|
||||
final ThemeMode themeMode;
|
||||
if (isLegacyMode) {
|
||||
final legacyThemeState = ref.watch(legacyThemeNotifierProvider);
|
||||
lightTheme = LegacyAppTheme.light;
|
||||
darkTheme = LegacyAppTheme.dark;
|
||||
themeMode = legacyThemeState.themeMode;
|
||||
} else {
|
||||
lightTheme = ThemeData(
|
||||
fontFamily: AppFonts.stolzl,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF329E95)),
|
||||
);
|
||||
darkTheme = null;
|
||||
themeMode = ThemeMode.light;
|
||||
}
|
||||
|
||||
return AppUpdateGate(
|
||||
child: MaterialApp.router(
|
||||
title: 'SaveFamily',
|
||||
theme: ThemeData(
|
||||
fontFamily: AppFonts.stolzl,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF329E95)),
|
||||
),
|
||||
theme: lightTheme,
|
||||
darkTheme: darkTheme,
|
||||
themeMode: themeMode,
|
||||
routerConfig: appRouter,
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: [
|
||||
|
||||
@@ -68,6 +68,8 @@ dependencies:
|
||||
path: ../../modules/legacy/modules/legacy_auth
|
||||
settings:
|
||||
path: ../../modules/legacy/modules/settings
|
||||
legacy_theme:
|
||||
path: ../../modules/legacy/packages/legacy_theme
|
||||
#packages dependencies go here
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/account_settings/presentation/state/account_settings_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -20,8 +21,7 @@ class AccountSettingsScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final color = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final color = context.sfColors.legacyPrimary;
|
||||
final selectedDevice = ref.watch(selectedDeviceProvider).value;
|
||||
final isLoggingOut = ref.watch(
|
||||
accountSettingsViewModelProvider.select((s) => s.isLoggingOut),
|
||||
@@ -37,7 +37,6 @@ class AccountSettingsScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.accountSettings),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -130,7 +129,7 @@ class AccountSettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
child: PrimaryButton(
|
||||
text: context.translate(I18n.logOut),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
leading: isLoggingOut
|
||||
? const SizedBox(
|
||||
height: 18,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/app_users/presentation/state/app_users_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -18,10 +19,8 @@ class AppUsersScreen extends ConsumerWidget {
|
||||
final vm = ref.read(appUsersViewModelProvider.notifier);
|
||||
final state = ref.watch(appUsersViewModelProvider);
|
||||
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
showEdit: true,
|
||||
onEditChange: vm.toggleIsEditing,
|
||||
title: context.translate(I18n.appUsers),
|
||||
@@ -44,7 +43,7 @@ class AppUsersScreen extends ConsumerWidget {
|
||||
? PrimaryButton(
|
||||
onPressed: vm.toggleIsEditing,
|
||||
text: context.translate(I18n.save),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 44, big: 42),
|
||||
)
|
||||
: null,
|
||||
@@ -60,7 +59,6 @@ class AppUserCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -71,20 +69,20 @@ class AppUserCard extends ConsumerWidget {
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 18)),
|
||||
),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 4, big: 12)),
|
||||
child: Icon(
|
||||
SFIcons.account,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
),
|
||||
@@ -121,7 +119,7 @@ class AppUserCard extends ConsumerWidget {
|
||||
if (isEditing) ...[
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: IconButton(
|
||||
@@ -166,9 +164,7 @@ class AppUserCard extends ConsumerWidget {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(
|
||||
ThemeCode.legacyPrimary,
|
||||
),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(
|
||||
small: 38,
|
||||
big: 36,
|
||||
@@ -191,9 +187,7 @@ class AppUserCard extends ConsumerWidget {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.delete),
|
||||
color: theme.getColorFor(
|
||||
ThemeCode.legacyPrimary,
|
||||
),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(
|
||||
small: 38,
|
||||
big: 36,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/change_password/presentation/state/change_password_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -14,13 +15,11 @@ class ChangePasswordScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final password = ref.watch(
|
||||
changePasswordViewModelProvider.select((s) => s.newPassword),
|
||||
);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.changePassword),
|
||||
body: Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -151,7 +150,7 @@ class _CriteriaRow extends StatelessWidget {
|
||||
color = Colors.green;
|
||||
icon = Icons.check_circle;
|
||||
} else {
|
||||
color = Colors.red.shade400;
|
||||
color = Theme.of(context).colorScheme.error;
|
||||
icon = Icons.cancel;
|
||||
}
|
||||
|
||||
@@ -181,8 +180,8 @@ class _ErrorMessageSection extends ConsumerWidget {
|
||||
Text(
|
||||
errorMessage,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -201,7 +200,6 @@ class _SaveSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(changePasswordViewModelProvider.notifier);
|
||||
|
||||
@@ -232,7 +230,7 @@ class _SaveSection extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.save),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/delete_account/presentation/state/delete_account_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:account/src/features/delete_account/presentation/widgets/confirm_dialog.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -15,10 +16,8 @@ class DeleteAccountScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.deleteAccount),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
@@ -42,10 +41,9 @@ class _Header extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return Container(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
width: double.infinity,
|
||||
padding: SizeUtils.getByScreen(
|
||||
small: EdgeInsets.symmetric(vertical: 20),
|
||||
@@ -86,7 +84,6 @@ class _BodySection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
@@ -100,7 +97,7 @@ class _BodySection extends ConsumerWidget {
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -115,7 +112,6 @@ class _RequestCancelSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final isLoading = ref.watch(
|
||||
deleteAccountViewModelProvider.select((s) => s.isLoading),
|
||||
@@ -146,7 +142,7 @@ class _RequestCancelSection extends ConsumerWidget {
|
||||
);
|
||||
},
|
||||
text: context.translate(I18n.requestCancelButton),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:navigation/app_routes.dart';
|
||||
import 'package:navigation/navigation_contract.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class ConfirmDialog extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
@@ -14,21 +15,18 @@ class ConfirmDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final state = ref.watch(deleteAccountViewModelProvider);
|
||||
final viewModel = ref.read(deleteAccountViewModelProvider.notifier);
|
||||
|
||||
final steps = [
|
||||
_VerifyAccountStep(
|
||||
theme: theme,
|
||||
email: state.loggedUser!.email,
|
||||
passwordController: viewModel.passwordController,
|
||||
errorMessage: state.errorMessage,
|
||||
nextStep: viewModel.nextStep,
|
||||
),
|
||||
_ConfirmRequestStep(
|
||||
theme: theme,
|
||||
toggleDeleteDevice: viewModel.toggleDeleteDevice,
|
||||
deviceNames: state.deviceNames,
|
||||
onCancel: () {
|
||||
@@ -58,14 +56,12 @@ class _VerifyAccountStep extends StatelessWidget {
|
||||
final TextEditingController passwordController;
|
||||
final String errorMessage;
|
||||
final VoidCallback nextStep;
|
||||
final ThemePort theme;
|
||||
|
||||
const _VerifyAccountStep({
|
||||
required this.email,
|
||||
required this.passwordController,
|
||||
required this.errorMessage,
|
||||
required this.nextStep,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -125,7 +121,7 @@ class _VerifyAccountStep extends StatelessWidget {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: 40,
|
||||
radius: 20,
|
||||
),
|
||||
@@ -135,7 +131,7 @@ class _VerifyAccountStep extends StatelessWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: nextStep,
|
||||
text: context.translate(I18n.accept),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: 40,
|
||||
radius: 20,
|
||||
),
|
||||
@@ -149,14 +145,12 @@ class _VerifyAccountStep extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _ConfirmRequestStep extends StatelessWidget {
|
||||
final ThemePort theme;
|
||||
final Function toggleDeleteDevice;
|
||||
final List<String> deviceNames;
|
||||
final VoidCallback onCancel;
|
||||
final VoidCallback onSubmit;
|
||||
|
||||
const _ConfirmRequestStep({
|
||||
required this.theme,
|
||||
required this.toggleDeleteDevice,
|
||||
required this.deviceNames,
|
||||
required this.onCancel,
|
||||
@@ -221,7 +215,7 @@ class _ConfirmRequestStep extends StatelessWidget {
|
||||
child: SecondaryButton(
|
||||
onPressed: onCancel,
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: 50,
|
||||
radius: 25,
|
||||
),
|
||||
@@ -231,7 +225,7 @@ class _ConfirmRequestStep extends StatelessWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: onSubmit,
|
||||
text: context.translate(I18n.confirm),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: 50,
|
||||
radius: 25,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/linked_devices/presentation/state/linked_devices_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -12,7 +13,6 @@ class EditLinkedDeviceScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final vm = ref.read(linkedDevicesViewModelProvider.notifier);
|
||||
final device = ref.watch(
|
||||
@@ -20,7 +20,6 @@ class EditLinkedDeviceScreen extends ConsumerWidget {
|
||||
);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.editDeviceTitle),
|
||||
showEdit: true,
|
||||
onEditChange: vm.toggleIsEditing,
|
||||
@@ -104,7 +103,6 @@ class _SaveSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(linkedDevicesViewModelProvider.notifier);
|
||||
|
||||
@@ -128,7 +126,7 @@ class _SaveSection extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.save),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/linked_devices/presentation/edit_linked_device_screen.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:account/src/features/linked_devices/presentation/state/linked_devices_view_model.dart';
|
||||
import 'package:account/src/features/linked_devices/presentation/widgets/delete_device_dialog.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
@@ -20,10 +21,8 @@ class LinkedDevicesScreen extends ConsumerWidget {
|
||||
final vm = ref.read(linkedDevicesViewModelProvider.notifier);
|
||||
final state = ref.watch(linkedDevicesViewModelProvider);
|
||||
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.linkedDevices),
|
||||
showEdit: true,
|
||||
onEditChange: vm.toggleIsEditing,
|
||||
@@ -66,7 +65,6 @@ class _LinkedDeviceCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final vm = ref.read(linkedDevicesViewModelProvider.notifier);
|
||||
|
||||
@@ -79,20 +77,20 @@ class _LinkedDeviceCard extends ConsumerWidget {
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 18)),
|
||||
),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 8, big: 12)),
|
||||
child: Icon(
|
||||
SFIcons.watch,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
),
|
||||
@@ -120,7 +118,7 @@ class _LinkedDeviceCard extends ConsumerWidget {
|
||||
if (isEditing) ...[
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: IconButton(
|
||||
@@ -141,7 +139,7 @@ class _LinkedDeviceCard extends ConsumerWidget {
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: IconButton(
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:navigation/navigation.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class DeleteDeviceDialog extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
@@ -19,7 +20,6 @@ class DeleteDeviceDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(linkedDevicesViewModelProvider.notifier);
|
||||
|
||||
@@ -49,7 +49,7 @@ class DeleteDeviceDialog extends ConsumerWidget {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -82,7 +82,7 @@ class DeleteDeviceDialog extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.delete),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:account/src/features/personal_data/presentation/state/personal_data_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -12,7 +13,6 @@ class PersonalDataScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final isLoading = ref.watch(
|
||||
personalDataViewModelProvider.select((s) => s.isLoading),
|
||||
);
|
||||
@@ -39,13 +39,12 @@ class PersonalDataScreen extends ConsumerWidget {
|
||||
|
||||
if (isLoading) {
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.personalData),
|
||||
body: Padding(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -204,7 +203,6 @@ class _SaveButton extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(personalDataViewModelProvider.notifier);
|
||||
|
||||
return Padding(
|
||||
@@ -212,7 +210,7 @@ class _SaveButton extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: vm.updateUser,
|
||||
text: context.translate(I18n.submit),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ dependencies:
|
||||
legacy_auth:
|
||||
path: ../../modules/legacy_auth
|
||||
#packages dependencies go here
|
||||
legacy_theme:
|
||||
path: ../../packages/legacy_theme
|
||||
sf_tracking:
|
||||
path: ../../../../packages/sf_tracking
|
||||
design_system:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
@@ -15,8 +16,7 @@ class AlertsScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
final vm = ref.read(alertsViewModelProvider.notifier);
|
||||
final (isLoading, selectedType) = ref.watch(
|
||||
alertsViewModelProvider.select((s) => (s.isLoading, s.selectedType)),
|
||||
@@ -33,9 +33,9 @@ class AlertsScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
@@ -83,8 +83,7 @@ class _FilterChips extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
final filters = [
|
||||
(null, context.translate(I18n.alertsFilterAll)),
|
||||
@@ -163,7 +162,6 @@ class _AlertsListState extends ConsumerState<_AlertsList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final (alerts, isLoadingMore) = ref.watch(
|
||||
alertsViewModelProvider.select((s) => (s.alerts, s.isLoadingMore)),
|
||||
);
|
||||
@@ -175,7 +173,7 @@ class _AlertsListState extends ConsumerState<_AlertsList> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.notifications_none,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
size: SizeUtils.getByScreen(small: 80, big: 90),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 18)),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -13,8 +13,7 @@ class AlertCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -26,7 +25,7 @@ class AlertCard extends ConsumerWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
@@ -37,12 +36,12 @@ class AlertCard extends ConsumerWidget {
|
||||
width: SizeUtils.getByScreen(small: 40, big: 36),
|
||||
height: SizeUtils.getByScreen(small: 40, big: 36),
|
||||
decoration: BoxDecoration(
|
||||
color: _alertColor(alert.type).withValues(alpha: 0.15),
|
||||
color: _alertColor(context, alert.type).withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(
|
||||
_alertIcon(alert.type),
|
||||
color: _alertColor(alert.type),
|
||||
color: _alertColor(context, alert.type),
|
||||
size: SizeUtils.getByScreen(small: 22, big: 20),
|
||||
),
|
||||
),
|
||||
@@ -56,7 +55,7 @@ class AlertCard extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
@@ -66,8 +65,7 @@ class AlertCard extends ConsumerWidget {
|
||||
: alert.deviceIdentificator,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
@@ -88,8 +86,7 @@ class AlertCard extends ConsumerWidget {
|
||||
_timeAgo(context, alert.createdAt),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
@@ -116,16 +113,16 @@ class AlertCard extends ConsumerWidget {
|
||||
};
|
||||
}
|
||||
|
||||
Color _alertColor(String type) {
|
||||
Color _alertColor(BuildContext context, String type) {
|
||||
return switch (type) {
|
||||
'sos' => Colors.red,
|
||||
'falldown' => Colors.red.shade700,
|
||||
'sos' => Theme.of(context).colorScheme.error,
|
||||
'falldown' => Theme.of(context).colorScheme.error,
|
||||
'lowBattery' => Colors.orange,
|
||||
'disconnect' => Colors.grey,
|
||||
'reconnected' => Colors.green,
|
||||
'braceletRemoved' => Colors.deepOrange,
|
||||
'standstill' => Colors.amber,
|
||||
'abnormalHeartRate' => Colors.red.shade400,
|
||||
'abnormalHeartRate' => Theme.of(context).colorScheme.error,
|
||||
'geofenceIn' => Colors.blue,
|
||||
'geofenceOut' => Colors.indigo,
|
||||
'movement' => Colors.teal,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_device_state/legacy_device_state.dart';
|
||||
import 'package:control_panel/src/shared/widgets/device_map.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
@@ -18,7 +19,6 @@ class ControlPanelScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final asyncState = ref.watch(legacyDeviceViewModelProvider);
|
||||
|
||||
ref.listen(
|
||||
@@ -37,7 +37,7 @@ class ControlPanelScreen extends ConsumerWidget {
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: asyncState.when(
|
||||
skipLoadingOnReload: true,
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
@@ -61,7 +61,7 @@ class ControlPanelScreen extends ConsumerWidget {
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 14)),
|
||||
Expanded(
|
||||
child: RefreshIndicator(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
onRefresh: () async {
|
||||
ref.invalidate(legacyDevicesProvider);
|
||||
await ref.read(legacyDeviceViewModelProvider.future);
|
||||
@@ -231,14 +231,13 @@ class _SectionButton extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return SectionButton(
|
||||
onPressed: onPressed,
|
||||
icon: Icon(
|
||||
icon,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
iconPadding: SizeUtils.getByScreen(small: 14, big: 12),
|
||||
@@ -264,7 +263,6 @@ class _MapSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final vm = ref.read(legacyDeviceViewModelProvider.notifier);
|
||||
|
||||
return GestureDetector(
|
||||
@@ -280,7 +278,7 @@ class _MapSection extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 20, big: 19),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
@@ -298,7 +296,7 @@ class _MapSection extends ConsumerWidget {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.refresh,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -56,9 +56,7 @@ class _DeviceMapState extends ConsumerState<DeviceMap> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mapStyle = ref.watch(mapStyleProvider);
|
||||
final primaryColor = ref
|
||||
.read(themePortProvider)
|
||||
.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
final initialCenter = widget.selectedPosition != null
|
||||
? LatLng(
|
||||
widget.selectedPosition!.latitude,
|
||||
@@ -114,8 +112,7 @@ class LocationBanner extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
final batteryValue = device?.battery ?? 0;
|
||||
final batteryIcon = toBatteryIcon(batteryValue);
|
||||
final dateText = formatPositionDate(position.positionDate);
|
||||
@@ -146,7 +143,7 @@ class LocationBanner extends ConsumerWidget {
|
||||
vertical: isCompact ? 6 : 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(isCompact ? 10 : 16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -189,7 +186,7 @@ class LocationBanner extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontSize: isCompact ? 12 : 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey.shade800,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -202,7 +199,7 @@ class LocationBanner extends ConsumerWidget {
|
||||
addressText,
|
||||
style: TextStyle(
|
||||
fontSize: isCompact ? 9 : 11,
|
||||
color: Colors.grey.shade500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -242,7 +239,7 @@ class LocationBanner extends ConsumerWidget {
|
||||
dateText,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: Colors.grey.shade400,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -36,6 +36,8 @@ dependencies:
|
||||
legacy_dashboard_shell:
|
||||
path: ../../modules/legacy_dashboard_shell
|
||||
#packages dependencies go here
|
||||
legacy_theme:
|
||||
path: ../../packages/legacy_theme
|
||||
sf_tracking:
|
||||
path: ../../../../packages/sf_tracking
|
||||
design_system:
|
||||
|
||||
@@ -14,12 +14,10 @@ class ContactScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(contactViewModelProvider.notifier);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.contactTitle),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -175,8 +173,8 @@ class _ErrorMessageSection extends ConsumerWidget {
|
||||
Text(
|
||||
viewState.errorMessage,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -195,7 +193,6 @@ class _SendSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -205,7 +202,7 @@ class _SendSection extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: onSend,
|
||||
text: context.translate(I18n.sendEmail),
|
||||
color: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:customer_service/src/presentation/contact_screen.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -15,10 +16,8 @@ class CustomerServiceScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.customerService),
|
||||
body: Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -61,7 +60,7 @@ class CustomerServiceScreen extends ConsumerWidget {
|
||||
icon: Icon(
|
||||
SFIcons.handshake,
|
||||
size: SizeUtils.getByScreen(small: 44, big: 48),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
body: Text(
|
||||
@@ -87,7 +86,7 @@ class CustomerServiceScreen extends ConsumerWidget {
|
||||
icon: Icon(
|
||||
Icons.email_outlined,
|
||||
size: SizeUtils.getByScreen(small: 44, big: 48),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
body: Text(
|
||||
|
||||
@@ -28,6 +28,8 @@ dependencies:
|
||||
#modules dependencies go here
|
||||
|
||||
#packages dependencies go here
|
||||
legacy_theme:
|
||||
path: ../../packages/legacy_theme
|
||||
sf_tracking:
|
||||
path: ../../../../packages/sf_tracking
|
||||
design_system:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -9,14 +9,12 @@ class TimeRangeSelector extends StatelessWidget {
|
||||
final TimeRange selected;
|
||||
final ValueChanged<TimeRange> onSelected;
|
||||
final VoidCallback onCustomTap;
|
||||
final ThemePort theme;
|
||||
|
||||
const TimeRangeSelector({
|
||||
super.key,
|
||||
required this.selected,
|
||||
required this.onSelected,
|
||||
required this.onCustomTap,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -47,7 +45,6 @@ class TimeRangeSelector extends StatelessWidget {
|
||||
label: label,
|
||||
isSelected: selected == range,
|
||||
onTap: isCustom ? onCustomTap : () => onSelected(range),
|
||||
theme: theme,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
@@ -60,13 +57,11 @@ class _Chip extends StatelessWidget {
|
||||
final String label;
|
||||
final bool isSelected;
|
||||
final VoidCallback onTap;
|
||||
final ThemePort theme;
|
||||
|
||||
const _Chip({
|
||||
required this.label,
|
||||
required this.isSelected,
|
||||
required this.onTap,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -80,8 +75,8 @@ class _Chip extends StatelessWidget {
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? theme.getColorFor(ThemeCode.legacyPrimary)
|
||||
: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
? context.sfColors.legacyPrimary
|
||||
: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 20, big: 18)),
|
||||
),
|
||||
@@ -93,9 +88,9 @@ class _Chip extends StatelessWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.6),
|
||||
: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -23,7 +23,6 @@ class ActivityMeterScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final isLoading = ref.watch(
|
||||
activityMeterViewModelProvider.select((s) => s.isLoading),
|
||||
);
|
||||
@@ -46,7 +45,6 @@ class ActivityMeterScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.activityMeter),
|
||||
body: isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -77,7 +75,6 @@ class _ActivityMeterBody extends ConsumerWidget {
|
||||
selected: timeRange,
|
||||
onSelected: vm.selectTimeRange,
|
||||
onCustomTap: () => _pickCustomRange(context, vm),
|
||||
theme: ref.watch(themePortProvider),
|
||||
),
|
||||
const _ActivitySection(),
|
||||
if (timeRange != TimeRange.today) const _HistorySection(),
|
||||
@@ -108,7 +105,6 @@ class _TodaySection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final (todayTotal, dailyGoal) = ref.watch(
|
||||
activityMeterViewModelProvider.select(
|
||||
(s) => (s.todayTotal, s.dailyGoal),
|
||||
@@ -117,7 +113,7 @@ class _TodaySection extends ConsumerWidget {
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
StepsProgressRing(steps: todayTotal, goal: dailyGoal, theme: theme),
|
||||
StepsProgressRing(steps: todayTotal, goal: dailyGoal),
|
||||
if (todayTotal == 0)
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -129,8 +125,7 @@ class _TodaySection extends ConsumerWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -178,7 +173,6 @@ class _ActivitySection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final (timeRange, hourly, daily, stats, activeHours, hasData) = ref.watch(
|
||||
activityMeterViewModelProvider.select(
|
||||
(s) => (
|
||||
@@ -205,8 +199,7 @@ class _ActivitySection extends ConsumerWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -235,7 +228,6 @@ class _HistorySection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(activityMeterViewModelProvider.notifier);
|
||||
final (history, dailyGoal, hasMore, isLoadingMore) = ref.watch(
|
||||
activityMeterViewModelProvider.select(
|
||||
@@ -257,7 +249,6 @@ class _HistorySection extends ConsumerWidget {
|
||||
hasMore: hasMore,
|
||||
isLoadingMore: isLoadingMore,
|
||||
onLoadMore: vm.loadMoreHistory,
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -22,7 +21,6 @@ class ActivityBarChartBase extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final height = SizeUtils.getByScreen<double>(small: 180, big: 160);
|
||||
|
||||
if (isEmpty) {
|
||||
@@ -33,8 +31,7 @@ class ActivityBarChartBase extends ConsumerWidget {
|
||||
'—',
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
@@ -42,8 +39,7 @@ class ActivityBarChartBase extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
final labelColor = theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
final labelColor = Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4);
|
||||
|
||||
return Padding(
|
||||
@@ -61,8 +57,7 @@ class ActivityBarChartBase extends ConsumerWidget {
|
||||
drawVerticalLine: false,
|
||||
horizontalInterval: _computeInterval(maxY),
|
||||
getDrawingHorizontalLine: (_) => FlLine(
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.08),
|
||||
strokeWidth: 1,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -16,7 +15,6 @@ class TodayActivityFooter extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
@@ -28,8 +26,7 @@ class TodayActivityFooter extends ConsumerWidget {
|
||||
.replaceAll('{hours}', activeHours.toString()),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
@@ -44,7 +41,6 @@ class PeriodActivityFooter extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final best = stats.bestDay;
|
||||
|
||||
return Column(
|
||||
@@ -63,8 +59,7 @@ class PeriodActivityFooter extends ConsumerWidget {
|
||||
.replaceAll('{steps}', formatStepsNumber(best.totalSteps)),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -14,14 +14,12 @@ class HourlyBarChart extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final isEmpty = data.isEmpty || data.every((h) => h.totalSteps == 0);
|
||||
final maxY = isEmpty
|
||||
? 0.0
|
||||
: data.map((h) => h.totalSteps.toDouble()).reduce((a, b) => a > b ? a : b);
|
||||
|
||||
final labelColor = theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
final labelColor = Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4);
|
||||
|
||||
return ActivityBarChartBase(
|
||||
@@ -34,7 +32,7 @@ class HourlyBarChart extends ConsumerWidget {
|
||||
barRods: [
|
||||
ActivityBarChartBase.buildRod(
|
||||
toY: bucket.totalSteps.toDouble(),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
width: SizeUtils.getByScreen(small: 6, big: 5),
|
||||
),
|
||||
],
|
||||
@@ -62,13 +60,13 @@ class HourlyBarChart extends ConsumerWidget {
|
||||
),
|
||||
tooltip: BarTouchTooltipData(
|
||||
getTooltipColor: (_) =>
|
||||
theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
Theme.of(context).colorScheme.surfaceContainer,
|
||||
getTooltipItem: (group, _, rod, __) => BarTooltipItem(
|
||||
'${group.x.toString().padLeft(2, '0')}h\n${rod.toY.toInt()}',
|
||||
TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -13,7 +14,6 @@ class PedometerToggle extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final enabled = ref.watch(
|
||||
selectedDeviceProvider.select(
|
||||
(d) => d.value?.settings.pedometer ?? false,
|
||||
@@ -37,7 +37,7 @@ class PedometerToggle extends ConsumerWidget {
|
||||
),
|
||||
Switch.adaptive(
|
||||
value: enabled,
|
||||
activeTrackColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
activeTrackColor: context.sfColors.legacyPrimary,
|
||||
onChanged: (value) async {
|
||||
if (!await guardDeviceCommand(context, ref)) return;
|
||||
final success = await ref
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -68,7 +67,6 @@ class _StatCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -76,7 +74,7 @@ class _StatCard extends ConsumerWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
),
|
||||
@@ -90,8 +88,7 @@ class _StatCard extends ConsumerWidget {
|
||||
fontSize: SizeUtils.getByScreen(small: 10, big: 9),
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.5,
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -101,7 +98,7 @@ class _StatCard extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 18, big: 16),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 2, big: 1)),
|
||||
@@ -109,8 +106,7 @@ class _StatCard extends ConsumerWidget {
|
||||
unit,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 10, big: 9),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -11,7 +11,6 @@ class SectionHeader extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -29,7 +28,7 @@ class SectionHeader extends ConsumerWidget {
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 1.2,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ...[
|
||||
@@ -38,8 +37,7 @@ class SectionHeader extends ConsumerWidget {
|
||||
subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -15,15 +15,13 @@ class StepsBarChart extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final isEmpty = data.isEmpty;
|
||||
final maxY = isEmpty
|
||||
? 0.0
|
||||
: data.map((d) => d.totalSteps.toDouble()).reduce((a, b) => a > b ? a : b);
|
||||
|
||||
final locale = Localizations.localeOf(context).toString();
|
||||
final labelColor = theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
final labelColor = Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4);
|
||||
|
||||
return ActivityBarChartBase(
|
||||
@@ -35,7 +33,7 @@ class StepsBarChart extends ConsumerWidget {
|
||||
barRods: [
|
||||
ActivityBarChartBase.buildRod(
|
||||
toY: entry.value.totalSteps.toDouble(),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
width: _barWidth(data.length),
|
||||
),
|
||||
],
|
||||
@@ -61,13 +59,13 @@ class StepsBarChart extends ConsumerWidget {
|
||||
),
|
||||
tooltip: BarTouchTooltipData(
|
||||
getTooltipColor: (_) =>
|
||||
theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
Theme.of(context).colorScheme.surfaceContainer,
|
||||
getTooltipItem: (group, _, rod, __) => BarTooltipItem(
|
||||
'${DateFormat('d MMM y', locale).format(data[group.x].date)}\n${rod.toY.toInt()}',
|
||||
TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -13,7 +13,6 @@ class StepsHistorySection extends StatelessWidget {
|
||||
final bool hasMore;
|
||||
final bool isLoadingMore;
|
||||
final VoidCallback onLoadMore;
|
||||
final ThemePort theme;
|
||||
|
||||
const StepsHistorySection({
|
||||
super.key,
|
||||
@@ -22,7 +21,6 @@ class StepsHistorySection extends StatelessWidget {
|
||||
required this.hasMore,
|
||||
required this.isLoadingMore,
|
||||
required this.onLoadMore,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -39,16 +37,13 @@ class StepsHistorySection extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
...items.map(
|
||||
(day) => _StepsHistoryTile(
|
||||
dailySteps: day,
|
||||
dailyGoal: dailyGoal,
|
||||
theme: theme,
|
||||
),
|
||||
(day) =>
|
||||
_StepsHistoryTile(dailySteps: day, dailyGoal: dailyGoal),
|
||||
),
|
||||
if (hasMore)
|
||||
Padding(
|
||||
@@ -61,7 +56,7 @@ class StepsHistorySection extends StatelessWidget {
|
||||
child: Text(
|
||||
context.translate(I18n.loadMore),
|
||||
style: TextStyle(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@@ -76,13 +71,8 @@ class StepsHistorySection extends StatelessWidget {
|
||||
class _StepsHistoryTile extends StatelessWidget {
|
||||
final DailySteps dailySteps;
|
||||
final int dailyGoal;
|
||||
final ThemePort theme;
|
||||
|
||||
const _StepsHistoryTile({
|
||||
required this.dailySteps,
|
||||
required this.dailyGoal,
|
||||
required this.theme,
|
||||
});
|
||||
const _StepsHistoryTile({required this.dailySteps, required this.dailyGoal});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -100,7 +90,7 @@ class _StepsHistoryTile extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 14, big: 12)),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
),
|
||||
@@ -114,9 +104,9 @@ class _StepsHistoryTile extends StatelessWidget {
|
||||
formatDayHeader(context, dailySteps.date),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.6),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
@@ -126,7 +116,7 @@ class _StepsHistoryTile extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
if (goalReached) ...[
|
||||
@@ -152,11 +142,11 @@ class _StepsHistoryTile extends StatelessWidget {
|
||||
child: LinearProgressIndicator(
|
||||
value: progress,
|
||||
minHeight: SizeUtils.getByScreen(small: 6, big: 5),
|
||||
backgroundColor: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.1),
|
||||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.1),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -167,9 +157,9 @@ class _StepsHistoryTile extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.5),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
import '../format_steps.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class StepsProgressRing extends StatelessWidget {
|
||||
final int steps;
|
||||
final int goal;
|
||||
final ThemePort theme;
|
||||
|
||||
const StepsProgressRing({
|
||||
super.key,
|
||||
required this.steps,
|
||||
required this.goal,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -37,9 +35,8 @@ class StepsProgressRing extends StatelessWidget {
|
||||
child: CustomPaint(
|
||||
painter: _RingPainter(
|
||||
progress: progress,
|
||||
activeColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
trackColor: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
activeColor: context.sfColors.legacyPrimary,
|
||||
trackColor: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.1),
|
||||
),
|
||||
child: Center(
|
||||
@@ -49,22 +46,21 @@ class StepsProgressRing extends StatelessWidget {
|
||||
Icon(
|
||||
Icons.directions_walk_rounded,
|
||||
size: SizeUtils.getByScreen(small: 28, big: 24),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
Text(
|
||||
formatStepsNumber(steps),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 28, big: 24),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.unitSteps),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -78,8 +74,7 @@ class StepsProgressRing extends StatelessWidget {
|
||||
'${formatStepsNumber(goal)} ${context.translate(I18n.unitSteps)} · $percentage%',
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -15,7 +15,6 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(appsUseViewModelProvider);
|
||||
final vm = ref.read(appsUseViewModelProvider.notifier);
|
||||
|
||||
@@ -29,7 +28,6 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.appsUse),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -41,7 +39,6 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
selected: state.timeRange,
|
||||
onSelected: (range) => vm.selectTimeRange(range),
|
||||
onCustomTap: () => _pickCustomRange(context, vm),
|
||||
theme: theme,
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
if (state.dailyData.isEmpty)
|
||||
@@ -55,9 +52,9 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
context.translate(I18n.noAppUsageData),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.5),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -67,7 +64,6 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
TopAppsSection(
|
||||
apps: state.topApps,
|
||||
totalDuration: state.totalDuration,
|
||||
theme: theme,
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
DailyAppUsageSection(
|
||||
@@ -75,7 +71,6 @@ class AppsUseScreen extends ConsumerWidget {
|
||||
hasMore: state.hasMore,
|
||||
isLoadingMore: state.isLoadingMore,
|
||||
onLoadMore: () => vm.loadMore(),
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 24, big: 20)),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -12,7 +12,6 @@ class DailyAppUsageSection extends StatelessWidget {
|
||||
final bool hasMore;
|
||||
final bool isLoadingMore;
|
||||
final VoidCallback onLoadMore;
|
||||
final ThemePort theme;
|
||||
|
||||
const DailyAppUsageSection({
|
||||
super.key,
|
||||
@@ -20,7 +19,6 @@ class DailyAppUsageSection extends StatelessWidget {
|
||||
required this.hasMore,
|
||||
required this.isLoadingMore,
|
||||
required this.onLoadMore,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -37,11 +35,11 @@ class DailyAppUsageSection extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
...items.map((day) => _DailyAppUsageTile(day: day, theme: theme)),
|
||||
...items.map((day) => _DailyAppUsageTile(day: day)),
|
||||
if (hasMore)
|
||||
Padding(
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
@@ -53,7 +51,7 @@ class DailyAppUsageSection extends StatelessWidget {
|
||||
child: Text(
|
||||
context.translate(I18n.loadMore),
|
||||
style: TextStyle(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@@ -67,9 +65,8 @@ class DailyAppUsageSection extends StatelessWidget {
|
||||
|
||||
class _DailyAppUsageTile extends StatelessWidget {
|
||||
final DailyAppUsage day;
|
||||
final ThemePort theme;
|
||||
|
||||
const _DailyAppUsageTile({required this.day, required this.theme});
|
||||
const _DailyAppUsageTile({required this.day});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -81,7 +78,7 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 14, big: 12)),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
),
|
||||
@@ -96,9 +93,9 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
formatDayHeader(context, day.date),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.6),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -106,7 +103,7 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -130,9 +127,9 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
small: 12,
|
||||
big: 11,
|
||||
),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.7),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.7),
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -142,9 +139,9 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.5),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -160,9 +157,9 @@ class _DailyAppUsageTile extends StatelessWidget {
|
||||
'+${day.apps.length - 3}',
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.4),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -9,13 +9,11 @@ import '../state/apps_use_view_state.dart';
|
||||
class TopAppsSection extends StatelessWidget {
|
||||
final List<AppUsageSummary> apps;
|
||||
final int totalDuration;
|
||||
final ThemePort theme;
|
||||
|
||||
const TopAppsSection({
|
||||
super.key,
|
||||
required this.apps,
|
||||
required this.totalDuration,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -37,7 +35,7 @@ class TopAppsSection extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -45,18 +43,15 @@ class TopAppsSection extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
...apps.map(
|
||||
(app) => _AppUsageBar(
|
||||
app: app,
|
||||
maxDuration: apps.first.totalDuration,
|
||||
theme: theme,
|
||||
),
|
||||
(app) =>
|
||||
_AppUsageBar(app: app, maxDuration: apps.first.totalDuration),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -67,13 +62,8 @@ class TopAppsSection extends StatelessWidget {
|
||||
class _AppUsageBar extends StatelessWidget {
|
||||
final AppUsageSummary app;
|
||||
final int maxDuration;
|
||||
final ThemePort theme;
|
||||
|
||||
const _AppUsageBar({
|
||||
required this.app,
|
||||
required this.maxDuration,
|
||||
required this.theme,
|
||||
});
|
||||
const _AppUsageBar({required this.app, required this.maxDuration});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -96,7 +86,7 @@ class _AppUsageBar extends StatelessWidget {
|
||||
app.name,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -106,9 +96,9 @@ class _AppUsageBar extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.6),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -121,11 +111,11 @@ class _AppUsageBar extends StatelessWidget {
|
||||
child: LinearProgressIndicator(
|
||||
value: progress,
|
||||
minHeight: SizeUtils.getByScreen(small: 6, big: 5),
|
||||
backgroundColor: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.1),
|
||||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.1),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -16,8 +17,7 @@ class BackgroundImageScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
final state = ref.watch(backgroundImageViewModelProvider);
|
||||
final vm = ref.read(backgroundImageViewModelProvider.notifier);
|
||||
@@ -60,9 +60,9 @@ class BackgroundImageScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
@@ -155,7 +155,7 @@ class _EmptyState extends StatelessWidget {
|
||||
Icon(
|
||||
Icons.add_photo_alternate_outlined,
|
||||
size: 100,
|
||||
color: Colors.grey.shade400,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
@@ -221,7 +221,7 @@ class _PhotoGrid extends StatelessWidget {
|
||||
border: Border.all(
|
||||
color: isActive
|
||||
? primaryColor
|
||||
: Colors.grey.shade300,
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
width: isActive ? 3 : 1,
|
||||
),
|
||||
),
|
||||
@@ -232,7 +232,7 @@ class _PhotoGrid extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.image_outlined,
|
||||
size: 48,
|
||||
color: Colors.grey.shade400,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -7,19 +6,18 @@ import 'package:sf_localizations/sf_localizations.dart';
|
||||
import '../data/call_history_entity.dart';
|
||||
import 'state/call_history_view_model.dart';
|
||||
import 'state/call_history_view_state.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class CallHistoryScreen extends ConsumerWidget {
|
||||
const CallHistoryScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(callHistoryViewModelProvider);
|
||||
final vm = ref.read(callHistoryViewModelProvider.notifier);
|
||||
final filtered = state.filteredCalls;
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.callHistory),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -31,12 +29,12 @@ class CallHistoryScreen extends ConsumerWidget {
|
||||
Icon(
|
||||
Icons.error_outline,
|
||||
size: 64,
|
||||
color: Colors.grey.shade300,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
state.errorMessage,
|
||||
style: TextStyle(color: Colors.grey.shade500, fontSize: 14),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant, fontSize: 14),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
@@ -54,13 +52,13 @@ class CallHistoryScreen extends ConsumerWidget {
|
||||
Icon(
|
||||
Icons.phone_missed_outlined,
|
||||
size: 64,
|
||||
color: Colors.grey.shade300,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
context.translate(I18n.callHistoryEmpty),
|
||||
style: TextStyle(
|
||||
color: Colors.grey.shade500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
@@ -89,9 +87,7 @@ class CallHistoryScreen extends ConsumerWidget {
|
||||
_DateHeader(timestamp: call.occurredAt),
|
||||
_CallTile(
|
||||
call: call,
|
||||
primaryColor: theme.getColorFor(
|
||||
ThemeCode.legacyPrimary,
|
||||
),
|
||||
primaryColor: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -126,7 +122,7 @@ class _FilterBar extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(4),
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade200,
|
||||
color: Theme.of(context).colorScheme.outlineVariant,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
@@ -144,7 +140,7 @@ class _FilterBar extends StatelessWidget {
|
||||
width: tabWidth,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -180,7 +176,7 @@ class _FilterBar extends StatelessWidget {
|
||||
: FontWeight.w500,
|
||||
color: isSelected
|
||||
? Colors.black87
|
||||
: Colors.grey.shade600,
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -226,7 +222,7 @@ class _DateHeader extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey.shade500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -261,7 +257,7 @@ class _CallTile extends StatelessWidget {
|
||||
final Color iconColor;
|
||||
if (!isAccepted) {
|
||||
icon = isIncoming ? Icons.phone_missed : Icons.phone_disabled;
|
||||
iconColor = Colors.red;
|
||||
iconColor = Theme.of(context).colorScheme.error;
|
||||
} else {
|
||||
icon = isIncoming ? Icons.call_received : Icons.call_made;
|
||||
iconColor = primaryColor;
|
||||
@@ -285,7 +281,7 @@ class _CallTile extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isAccepted ? Colors.black87 : Colors.red.shade700,
|
||||
color: isAccepted ? Colors.black87 : Theme.of(context).colorScheme.error,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -301,20 +297,20 @@ class _CallTile extends StatelessWidget {
|
||||
if (subtitle != null) ...[
|
||||
Text(
|
||||
subtitle,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey.shade600),
|
||||
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
if (isAccepted)
|
||||
Text(
|
||||
durationStr,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey.shade500),
|
||||
style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: Text(
|
||||
timeStr,
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey.shade500),
|
||||
style: TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -19,7 +20,6 @@ class ContactsScreen extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final vm = ref.read(contactsViewModelProvider.notifier);
|
||||
final state = ref.watch(contactsViewModelProvider);
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
ref.listen(contactsViewModelProvider.select((s) => s.error), (prev, next) {
|
||||
if (next == null) return;
|
||||
@@ -32,14 +32,13 @@ class ContactsScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.contactsAgendaTitle),
|
||||
showEdit: true,
|
||||
onEditChange: vm.toggleIsEditing,
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: state.contacts.isEmpty
|
||||
? _EmptyState(theme: theme)
|
||||
? const _EmptyState()
|
||||
: ListView.separated(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 22, big: 21),
|
||||
@@ -54,7 +53,7 @@ class ContactsScreen extends ConsumerWidget {
|
||||
itemCount: state.contacts.length,
|
||||
),
|
||||
footer: Material(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
shape: const CircleBorder(),
|
||||
child: InkWell(
|
||||
customBorder: const CircleBorder(),
|
||||
@@ -93,9 +92,8 @@ class ContactsScreen extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _EmptyState extends StatelessWidget {
|
||||
final ThemePort theme;
|
||||
|
||||
const _EmptyState({required this.theme});
|
||||
const _EmptyState();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -106,8 +104,7 @@ class _EmptyState extends StatelessWidget {
|
||||
Icon(
|
||||
SFIcons.contactsCircle,
|
||||
size: SizeUtils.getByScreen(small: 64, big: 60),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.3),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
@@ -116,7 +113,7 @@ class _EmptyState extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 18, big: 17),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
@@ -124,8 +121,7 @@ class _EmptyState extends StatelessWidget {
|
||||
context.translate(I18n.contactsEmptyHint),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -16,7 +17,6 @@ class EditContactScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final provider = editContactViewModelProvider(contactId);
|
||||
final vm = ref.read(provider.notifier);
|
||||
final state = ref.watch(provider);
|
||||
@@ -35,13 +35,13 @@ class EditContactScreen extends ConsumerWidget {
|
||||
|
||||
if (contact == null) {
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Center(child: Text(context.translate(I18n.errorGeneric))),
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -139,7 +139,7 @@ class EditContactScreen extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.save),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:utils/utils.dart';
|
||||
|
||||
import '../../domain/entities/contact_entity.dart';
|
||||
import '../state/contacts_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class ConfirmDeleteDialog extends ConsumerWidget {
|
||||
final ContactEntity contact;
|
||||
@@ -14,7 +15,6 @@ class ConfirmDeleteDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -22,7 +22,7 @@ class ConfirmDeleteDialog extends ConsumerWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 30, big: 28),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
@@ -46,7 +46,7 @@ class ConfirmDeleteDialog extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -60,7 +60,7 @@ class ConfirmDeleteDialog extends ConsumerWidget {
|
||||
if (context.mounted) Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.delete),
|
||||
color: const Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
@@ -20,7 +21,6 @@ class ContactCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -31,20 +31,20 @@ class ContactCard extends ConsumerWidget {
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 18)),
|
||||
),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 10, big: 12)),
|
||||
child: Icon(
|
||||
SFIcons.account,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
),
|
||||
@@ -72,7 +72,7 @@ class ContactCard extends ConsumerWidget {
|
||||
if (isEditing) ...[
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: IconButton(
|
||||
@@ -87,7 +87,7 @@ class ContactCard extends ConsumerWidget {
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
child: IconButton(
|
||||
|
||||
@@ -7,13 +7,13 @@ import 'package:utils/utils.dart';
|
||||
|
||||
import '../../domain/entities/contact_error.dart';
|
||||
import '../state/new_contact_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class NewContactDialog extends ConsumerWidget {
|
||||
const NewContactDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(newContactViewModelProvider.notifier);
|
||||
final isoCode = ref.watch(
|
||||
newContactViewModelProvider.select((s) => s.isoCode),
|
||||
@@ -47,7 +47,7 @@ class NewContactDialog extends ConsumerWidget {
|
||||
height: SizeUtils.getByScreen(small: 430, big: 410),
|
||||
width: SizeUtils.getByScreen(small: 400, big: 390),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 6, big: 5)),
|
||||
),
|
||||
@@ -63,7 +63,7 @@ class NewContactDialog extends ConsumerWidget {
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -71,7 +71,7 @@ class NewContactDialog extends ConsumerWidget {
|
||||
child: Text(
|
||||
context.translate(I18n.newContact).toUpperCase(),
|
||||
style: TextStyle(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@@ -110,7 +110,7 @@ class NewContactDialog extends ConsumerWidget {
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
child: IconButton(
|
||||
onPressed: vm.pickContactFromDevice,
|
||||
@@ -137,7 +137,7 @@ class NewContactDialog extends ConsumerWidget {
|
||||
if (success && context.mounted) Navigator.pop(context);
|
||||
},
|
||||
text: context.translate(I18n.save),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:device_management/src/features/device_management/widgets/call_watch_dialog.dart';
|
||||
@@ -15,15 +16,13 @@ class DeviceManagementScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final capabilities = ref.watch(
|
||||
selectedDeviceProvider.select((device) => device.value?.capabilities),
|
||||
);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
final gap = SizedBox(height: SizeUtils.getByScreen(small: 16, big: 15));
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.deviceFunctionsTitle),
|
||||
showBack: false,
|
||||
body: SingleChildScrollView(
|
||||
|
||||
@@ -4,13 +4,13 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:device_management/src/features/device_management/state/call_watch_view_model.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class CallWatchDialog extends ConsumerWidget {
|
||||
const CallWatchDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(callWatchViewModelProvider.notifier);
|
||||
final viewState = ref.watch(callWatchViewModelProvider);
|
||||
@@ -43,7 +43,7 @@ class CallWatchDialog extends ConsumerWidget {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -99,7 +99,7 @@ class CallWatchDialog extends ConsumerWidget {
|
||||
PrimaryButton(
|
||||
onPressed: viewModel.call,
|
||||
text: context.translate(I18n.call),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -16,7 +17,6 @@ class DoNotDisturbScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(doNotDisturbViewModelProvider.notifier);
|
||||
final (periods, maxPeriods, isLoading, isSaving) = ref.watch(
|
||||
doNotDisturbViewModelProvider.select(
|
||||
@@ -55,10 +55,9 @@ class DoNotDisturbScreen extends ConsumerWidget {
|
||||
}
|
||||
});
|
||||
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.doNotDisturb),
|
||||
body: isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -74,8 +73,7 @@ class DoNotDisturbScreen extends ConsumerWidget {
|
||||
context.translate(I18n.doNotDisturbDescription),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
height: 1.4,
|
||||
),
|
||||
@@ -112,8 +110,7 @@ class DoNotDisturbScreen extends ConsumerWidget {
|
||||
small: 14,
|
||||
big: 13,
|
||||
),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -18,13 +18,12 @@ class DoNotDisturbPeriodCard extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 14, big: 12)),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
@@ -46,7 +45,7 @@ class DoNotDisturbPeriodCard extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 15),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -57,8 +58,7 @@ class _EditPeriodSheetState extends ConsumerState<EditPeriodSheet> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
final isEditing = widget.initial != null;
|
||||
final hasSelectedDays = _weekDays.any((d) => d);
|
||||
|
||||
@@ -82,7 +82,7 @@ class _EditPeriodSheetState extends ConsumerState<EditPeriodSheet> {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 18, big: 16),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)),
|
||||
@@ -125,7 +125,7 @@ class _EditPeriodSheetState extends ConsumerState<EditPeriodSheet> {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 10, big: 8)),
|
||||
@@ -183,7 +183,7 @@ class _TimePickerTile extends StatelessWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
border: Border.all(color: Theme.of(context).colorScheme.outline),
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
@@ -195,7 +195,7 @@ class _TimePickerTile extends StatelessWidget {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: Colors.grey.shade500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 4, big: 3)),
|
||||
|
||||
@@ -53,7 +53,7 @@ class WeekDayRow extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: active ? activeColor : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: active ? null : Border.all(color: Colors.grey.shade300),
|
||||
border: active ? null : Border.all(color: Theme.of(context).colorScheme.outline),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
@@ -63,7 +63,7 @@ class WeekDayRow extends StatelessWidget {
|
||||
? SizeUtils.getByScreen(small: 11, big: 10)
|
||||
: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: active ? Colors.white : Colors.grey.shade500,
|
||||
color: active ? Colors.white : Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
const _kGreen = Color(0xFF4CAF50);
|
||||
const _kOrange = Color(0xFFFF9800);
|
||||
const _kRed = Color(0xFFFF5D52);
|
||||
const _kRed = Color(0xFFEF1111);
|
||||
|
||||
Color heartRateColor(int bpm) {
|
||||
if (bpm < 50 || bpm > 120) return _kRed;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -55,7 +56,6 @@ class _HealthScreenState extends ConsumerState<HealthScreen>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(healthViewModelProvider);
|
||||
final vm = ref.read(healthViewModelProvider.notifier);
|
||||
final device = ref.watch(selectedDeviceProvider).value;
|
||||
@@ -80,14 +80,12 @@ class _HealthScreenState extends ConsumerState<HealthScreen>
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.healthTitle),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: state.isMeasuringCountdown
|
||||
? _MeasuringOverlay(
|
||||
remainingSeconds: state.measureRemainingSeconds,
|
||||
theme: theme,
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
@@ -95,20 +93,17 @@ class _HealthScreenState extends ConsumerState<HealthScreen>
|
||||
heartbeats: state.latestHeartbeats,
|
||||
oxygens: state.latestOxygens,
|
||||
tabController: _tabController,
|
||||
theme: theme,
|
||||
),
|
||||
TimeRangeSelector(
|
||||
selected: state.timeRange,
|
||||
onSelected: (range) => vm.selectTimeRange(range),
|
||||
onCustomTap: () => _pickCustomRange(vm),
|
||||
theme: theme,
|
||||
),
|
||||
if (device?.capabilities?.heartbeats != null &&
|
||||
device!.capabilities!.heartbeats!.options.isNotEmpty)
|
||||
_HeartRateFrequencySelector(
|
||||
currentFrequency: device.settings.frequencyHeartRate,
|
||||
options: device.capabilities!.heartbeats!.options,
|
||||
theme: theme,
|
||||
onChanged: (frequency) async {
|
||||
if (!await guardDeviceCommand(context, ref)) return;
|
||||
final success = await vm.updateHeartRateFrequency(
|
||||
@@ -129,11 +124,11 @@ class _HealthScreenState extends ConsumerState<HealthScreen>
|
||||
),
|
||||
TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
unselectedLabelColor: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.5),
|
||||
indicatorColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
labelColor: context.sfColors.legacyPrimary,
|
||||
unselectedLabelColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
indicatorColor: context.sfColors.legacyPrimary,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -183,7 +178,6 @@ class _SaveSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final vm = ref.read(healthViewModelProvider.notifier);
|
||||
final isMeasuring = ref.watch(
|
||||
healthViewModelProvider.select((s) => s.isMeasuring),
|
||||
@@ -204,7 +198,7 @@ class _SaveSection extends ConsumerWidget {
|
||||
vm.measure();
|
||||
},
|
||||
text: isMeasuring ? '...' : context.translate(I18n.measure),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -213,19 +207,17 @@ class _SaveSection extends ConsumerWidget {
|
||||
class _HeartRateFrequencySelector extends StatelessWidget {
|
||||
final int currentFrequency;
|
||||
final List<int> options;
|
||||
final ThemePort theme;
|
||||
final ValueChanged<int> onChanged;
|
||||
|
||||
const _HeartRateFrequencySelector({
|
||||
required this.currentFrequency,
|
||||
required this.options,
|
||||
required this.theme,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
@@ -264,16 +256,12 @@ class _HeartRateFrequencySelector extends StatelessWidget {
|
||||
|
||||
class _MeasuringOverlay extends StatelessWidget {
|
||||
final int remainingSeconds;
|
||||
final ThemePort theme;
|
||||
|
||||
const _MeasuringOverlay({
|
||||
required this.remainingSeconds,
|
||||
required this.theme,
|
||||
});
|
||||
const _MeasuringOverlay({required this.remainingSeconds});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return Center(
|
||||
child: Column(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -28,7 +27,6 @@ class BloodPressureTab extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(healthViewModelProvider.notifier);
|
||||
|
||||
final chartWithPressure = chartData
|
||||
@@ -39,7 +37,7 @@ class BloodPressureTab extends ConsumerWidget {
|
||||
.toList();
|
||||
|
||||
if (chartWithPressure.isEmpty && historyWithPressure.isEmpty) {
|
||||
return HealthEmptyState(theme: theme, icon: Icons.monitor_heart_outlined);
|
||||
return HealthEmptyState(icon: Icons.monitor_heart_outlined);
|
||||
}
|
||||
|
||||
return ListView(
|
||||
@@ -52,13 +50,12 @@ class BloodPressureTab extends ConsumerWidget {
|
||||
chartWithPressure,
|
||||
(h) => h.highBloodPressure!.toDouble(),
|
||||
),
|
||||
lineColor: const Color(0xFFFF5D52),
|
||||
lineColor: Theme.of(context).colorScheme.error,
|
||||
secondarySpots: toFlSpots(
|
||||
chartWithPressure,
|
||||
(h) => h.lowBloodPressure!.toDouble(),
|
||||
),
|
||||
secondaryLineColor: const Color(0xFFFF9800),
|
||||
theme: theme,
|
||||
),
|
||||
HealthHistorySection<HeartbeatEntity>(
|
||||
items: historyWithPressure,
|
||||
@@ -74,7 +71,6 @@ class BloodPressureTab extends ConsumerWidget {
|
||||
hasMore: hasMore,
|
||||
isLoadingMore: isLoadingMore,
|
||||
onLoadMore: () => vm.loadMoreHistory(),
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
@@ -6,9 +5,8 @@ import '../../../../core/presentation/format_date.dart';
|
||||
|
||||
class DayHeader extends StatelessWidget {
|
||||
final DateTime date;
|
||||
final ThemePort theme;
|
||||
|
||||
const DayHeader({super.key, required this.date, required this.theme});
|
||||
const DayHeader({super.key, required this.date});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -22,8 +20,7 @@ class DayHeader extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
class HealthEmptyState extends StatelessWidget {
|
||||
final ThemePort theme;
|
||||
final IconData icon;
|
||||
|
||||
const HealthEmptyState({super.key, required this.theme, required this.icon});
|
||||
const HealthEmptyState({super.key, required this.icon});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -18,8 +16,7 @@ class HealthEmptyState extends StatelessWidget {
|
||||
Icon(
|
||||
icon,
|
||||
size: SizeUtils.getByScreen(small: 64, big: 60),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.3),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
@@ -28,7 +25,7 @@ class HealthEmptyState extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 18, big: 17),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
@@ -37,8 +34,7 @@ class HealthEmptyState extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 13),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -16,7 +16,6 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
final bool hasMore;
|
||||
final bool isLoadingMore;
|
||||
final VoidCallback onLoadMore;
|
||||
final ThemePort theme;
|
||||
|
||||
const HealthHistorySection({
|
||||
super.key,
|
||||
@@ -26,7 +25,6 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
required this.hasMore,
|
||||
required this.isLoadingMore,
|
||||
required this.onLoadMore,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -45,7 +43,7 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -56,7 +54,7 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 22, big: 21),
|
||||
),
|
||||
child: DayHeader(date: day, theme: theme),
|
||||
child: DayHeader(date: day),
|
||||
),
|
||||
...dayItems.map((item) {
|
||||
final record = buildRecord(context, item);
|
||||
@@ -69,7 +67,6 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
unit: record.unit,
|
||||
date: formatTime(getTimestamp(item)),
|
||||
valueColor: record.valueColor,
|
||||
theme: theme,
|
||||
),
|
||||
);
|
||||
}),
|
||||
@@ -86,7 +83,7 @@ class HealthHistorySection<T> extends StatelessWidget {
|
||||
child: Text(
|
||||
context.translate(I18n.loadMore),
|
||||
style: TextStyle(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -6,7 +5,6 @@ import 'package:utils/utils.dart';
|
||||
class HealthLineChart extends StatelessWidget {
|
||||
final List<FlSpot> spots;
|
||||
final Color lineColor;
|
||||
final ThemePort theme;
|
||||
|
||||
final List<FlSpot>? secondarySpots;
|
||||
final Color? secondaryLineColor;
|
||||
@@ -15,7 +13,6 @@ class HealthLineChart extends StatelessWidget {
|
||||
super.key,
|
||||
required this.spots,
|
||||
required this.lineColor,
|
||||
required this.theme,
|
||||
this.secondarySpots,
|
||||
this.secondaryLineColor,
|
||||
});
|
||||
@@ -30,8 +27,7 @@ class HealthLineChart extends StatelessWidget {
|
||||
'--',
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
@@ -59,8 +55,7 @@ class HealthLineChart extends StatelessWidget {
|
||||
drawVerticalLine: false,
|
||||
horizontalInterval: _computeInterval(spots),
|
||||
getDrawingHorizontalLine: (value) => FlLine(
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.08),
|
||||
strokeWidth: 1,
|
||||
),
|
||||
@@ -74,8 +69,7 @@ class HealthLineChart extends StatelessWidget {
|
||||
value.toInt().toString(),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 10, big: 9),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
@@ -95,7 +89,7 @@ class HealthLineChart extends StatelessWidget {
|
||||
lineTouchData: LineTouchData(
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipColor: (_) =>
|
||||
theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
Theme.of(context).colorScheme.surfaceContainer,
|
||||
getTooltipItems: (spots) => spots
|
||||
.map(
|
||||
(spot) => LineTooltipItem(
|
||||
@@ -103,7 +97,7 @@ class HealthLineChart extends StatelessWidget {
|
||||
TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
@@ -7,7 +6,6 @@ class HealthRecordTile extends StatelessWidget {
|
||||
final String unit;
|
||||
final String date;
|
||||
final Color valueColor;
|
||||
final ThemePort theme;
|
||||
|
||||
const HealthRecordTile({
|
||||
super.key,
|
||||
@@ -15,7 +13,6 @@ class HealthRecordTile extends StatelessWidget {
|
||||
required this.unit,
|
||||
required this.date,
|
||||
required this.valueColor,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -26,7 +23,7 @@ class HealthRecordTile extends StatelessWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
),
|
||||
@@ -51,8 +48,7 @@ class HealthRecordTile extends StatelessWidget {
|
||||
unit,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -63,8 +59,7 @@ class HealthRecordTile extends StatelessWidget {
|
||||
date,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -8,13 +7,11 @@ import '../state/health_view_state.dart';
|
||||
class HealthStatsRow extends StatelessWidget {
|
||||
final HealthStats stats;
|
||||
final String unit;
|
||||
final ThemePort theme;
|
||||
|
||||
const HealthStatsRow({
|
||||
super.key,
|
||||
required this.stats,
|
||||
required this.unit,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -33,7 +30,6 @@ class HealthStatsRow extends StatelessWidget {
|
||||
label: context.translate(I18n.average),
|
||||
value: hasData ? '${stats.avg}' : '--',
|
||||
unit: unit,
|
||||
theme: theme,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -41,7 +37,6 @@ class HealthStatsRow extends StatelessWidget {
|
||||
label: context.translate(I18n.minimum),
|
||||
value: hasData ? '${stats.min}' : '--',
|
||||
unit: unit,
|
||||
theme: theme,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -49,7 +44,6 @@ class HealthStatsRow extends StatelessWidget {
|
||||
label: context.translate(I18n.maximum),
|
||||
value: hasData ? '${stats.max}' : '--',
|
||||
unit: unit,
|
||||
theme: theme,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -62,13 +56,11 @@ class _StatItem extends StatelessWidget {
|
||||
final String label;
|
||||
final String value;
|
||||
final String unit;
|
||||
final ThemePort theme;
|
||||
|
||||
const _StatItem({
|
||||
required this.label,
|
||||
required this.value,
|
||||
required this.unit,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -79,8 +71,7 @@ class _StatItem extends StatelessWidget {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -93,15 +84,14 @@ class _StatItem extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 20, big: 18),
|
||||
fontWeight: FontWeight.w700,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' $unit',
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -12,14 +11,12 @@ class HealthSummaryCards extends StatelessWidget {
|
||||
final List<HeartbeatEntity> heartbeats;
|
||||
final List<OxygenEntity> oxygens;
|
||||
final TabController tabController;
|
||||
final ThemePort theme;
|
||||
|
||||
const HealthSummaryCards({
|
||||
super.key,
|
||||
required this.heartbeats,
|
||||
required this.oxygens,
|
||||
required this.tabController,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -30,6 +27,10 @@ class HealthSummaryCards extends StatelessWidget {
|
||||
.firstOrNull;
|
||||
final lastOxygen = oxygens.isNotEmpty ? oxygens.first : null;
|
||||
|
||||
final mutedColor = Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.3);
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
@@ -50,10 +51,7 @@ class HealthSummaryCards extends StatelessWidget {
|
||||
: '',
|
||||
valueColor: lastHeartbeat != null
|
||||
? heartRateColor(lastHeartbeat.heartbeats)
|
||||
: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.3),
|
||||
theme: theme,
|
||||
: mutedColor,
|
||||
),
|
||||
),
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
@@ -73,10 +71,7 @@ class HealthSummaryCards extends StatelessWidget {
|
||||
lastWithPressure.highBloodPressure!,
|
||||
lastWithPressure.lowBloodPressure!,
|
||||
)
|
||||
: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.3),
|
||||
theme: theme,
|
||||
: mutedColor,
|
||||
),
|
||||
),
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
@@ -91,10 +86,7 @@ class HealthSummaryCards extends StatelessWidget {
|
||||
: '',
|
||||
valueColor: lastOxygen != null
|
||||
? oxygenColor(lastOxygen.oxygen)
|
||||
: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.3),
|
||||
theme: theme,
|
||||
: mutedColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -110,7 +102,6 @@ class _SummaryCard extends StatelessWidget {
|
||||
final String unit;
|
||||
final String timeAgo;
|
||||
final Color valueColor;
|
||||
final ThemePort theme;
|
||||
|
||||
const _SummaryCard({
|
||||
required this.onTap,
|
||||
@@ -119,7 +110,6 @@ class _SummaryCard extends StatelessWidget {
|
||||
required this.unit,
|
||||
required this.timeAgo,
|
||||
required this.valueColor,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -132,7 +122,7 @@ class _SummaryCard extends StatelessWidget {
|
||||
vertical: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
),
|
||||
@@ -157,9 +147,9 @@ class _SummaryCard extends StatelessWidget {
|
||||
unit,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 11, big: 10),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.5),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
if (timeAgo.isNotEmpty) ...[
|
||||
@@ -168,9 +158,9 @@ class _SummaryCard extends StatelessWidget {
|
||||
timeAgo,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 10, big: 9),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
.withValues(alpha: 0.4),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -32,11 +31,10 @@ class HeartRateTab extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(healthViewModelProvider.notifier);
|
||||
|
||||
if (chartData.isEmpty && historyData.isEmpty) {
|
||||
return HealthEmptyState(theme: theme, icon: Icons.favorite_rounded);
|
||||
return HealthEmptyState(icon: Icons.favorite_rounded);
|
||||
}
|
||||
|
||||
return ListView(
|
||||
@@ -46,13 +44,11 @@ class HeartRateTab extends ConsumerWidget {
|
||||
children: [
|
||||
HealthLineChart(
|
||||
spots: toFlSpots(chartData, (h) => h.heartbeats.toDouble()),
|
||||
lineColor: const Color(0xFFFF5D52),
|
||||
theme: theme,
|
||||
lineColor: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
HealthStatsRow(
|
||||
stats: stats,
|
||||
unit: context.translate(I18n.unitBpm),
|
||||
theme: theme,
|
||||
),
|
||||
HealthHistorySection<HeartbeatEntity>(
|
||||
items: historyData,
|
||||
@@ -65,7 +61,6 @@ class HeartRateTab extends ConsumerWidget {
|
||||
hasMore: hasMore,
|
||||
isLoadingMore: isLoadingMore,
|
||||
onLoadMore: () => vm.loadMoreHistory(),
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -32,11 +31,10 @@ class OxygenTab extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(healthViewModelProvider.notifier);
|
||||
|
||||
if (chartData.isEmpty && historyData.isEmpty) {
|
||||
return HealthEmptyState(theme: theme, icon: Icons.air_rounded);
|
||||
return HealthEmptyState(icon: Icons.air_rounded);
|
||||
}
|
||||
|
||||
return ListView(
|
||||
@@ -47,12 +45,10 @@ class OxygenTab extends ConsumerWidget {
|
||||
HealthLineChart(
|
||||
spots: toFlSpots(chartData, (o) => o.oxygen.toDouble()),
|
||||
lineColor: const Color(0xFF4CAF50),
|
||||
theme: theme,
|
||||
),
|
||||
HealthStatsRow(
|
||||
stats: stats,
|
||||
unit: context.translate(I18n.unitSpO2),
|
||||
theme: theme,
|
||||
),
|
||||
HealthHistorySection<OxygenEntity>(
|
||||
items: historyData,
|
||||
@@ -65,7 +61,6 @@ class OxygenTab extends ConsumerWidget {
|
||||
hasMore: hasMore,
|
||||
isLoadingMore: isLoadingMore,
|
||||
onLoadMore: () => vm.loadMoreHistory(),
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -13,7 +14,6 @@ class LocateDeviceScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
ref.listen(locateDeviceViewModelProvider.select((s) => s.errorMessage), (
|
||||
previous,
|
||||
@@ -38,7 +38,6 @@ class LocateDeviceScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.locateDevicePlaySoundButton),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -77,7 +76,7 @@ class LocateDeviceScreen extends ConsumerWidget {
|
||||
);
|
||||
},
|
||||
text: context.translate(I18n.locateDeviceTitle),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 36, big: 35),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,13 +7,13 @@ import 'package:utils/utils.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
|
||||
import '../state/locate_device_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class LocateDeviceDialog extends ConsumerWidget {
|
||||
const LocateDeviceDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(locateDeviceViewModelProvider);
|
||||
final vm = ref.read(locateDeviceViewModelProvider.notifier);
|
||||
|
||||
@@ -41,16 +41,14 @@ class LocateDeviceDialog extends ConsumerWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (state.isLoading)
|
||||
_DialogMessage(text: context.translate(I18n.sending), theme: theme),
|
||||
_DialogMessage(text: context.translate(I18n.sending)),
|
||||
if (!state.isLoading && state.isComplete)
|
||||
_DialogMessage(
|
||||
text: context.translate(I18n.sentSuccessfully),
|
||||
theme: theme,
|
||||
),
|
||||
if (state.errorMessage.isNotEmpty) ...[
|
||||
_DialogMessage(
|
||||
text: context.translate(I18n.deviceNotConnected),
|
||||
theme: theme,
|
||||
fontSize: SizeUtils.getByScreen(small: 20, big: 19),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 24, big: 23)),
|
||||
@@ -60,7 +58,7 @@ class LocateDeviceDialog extends ConsumerWidget {
|
||||
vm.reset();
|
||||
},
|
||||
text: context.translate(I18n.ok),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -82,7 +80,7 @@ class LocateDeviceDialog extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -95,7 +93,7 @@ class LocateDeviceDialog extends ConsumerWidget {
|
||||
vm.locateDevice();
|
||||
},
|
||||
text: context.translate(I18n.accept),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -111,12 +109,10 @@ class LocateDeviceDialog extends ConsumerWidget {
|
||||
|
||||
class _DialogMessage extends StatelessWidget {
|
||||
final String text;
|
||||
final ThemePort theme;
|
||||
final double? fontSize;
|
||||
|
||||
const _DialogMessage({
|
||||
required this.text,
|
||||
required this.theme,
|
||||
this.fontSize,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
@@ -53,8 +54,6 @@ class RemoteCameraScreen extends ConsumerWidget {
|
||||
},
|
||||
);
|
||||
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final isLoading = ref.watch(
|
||||
remoteConnectionViewModelProvider.select((s) => s.isLoadingPictures),
|
||||
);
|
||||
@@ -72,13 +71,12 @@ class RemoteCameraScreen extends ConsumerWidget {
|
||||
if (isLoading || isTaking) {
|
||||
body = const Center(child: CircularProgressIndicator());
|
||||
} else if (isWaiting) {
|
||||
body = _WaitingForPhotoOverlay(remainingSeconds: countdown, theme: theme);
|
||||
body = _WaitingForPhotoOverlay(remainingSeconds: countdown);
|
||||
} else {
|
||||
body = const _GallerySection();
|
||||
}
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.remoteCamera),
|
||||
body: body,
|
||||
footer: isWaiting ? const SizedBox.shrink() : const _TakePictureSection(),
|
||||
@@ -91,8 +89,6 @@ class _GallerySection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(remoteConnectionViewModelProvider.notifier);
|
||||
|
||||
final pictures = ref.watch(
|
||||
@@ -124,7 +120,7 @@ class _GallerySection extends ConsumerWidget {
|
||||
width: SizeUtils.getByScreen(small: 60, big: 58),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.fromBorderSide(
|
||||
BorderSide(color: theme.getColorFor(ThemeCode.textTertiary)),
|
||||
BorderSide(color: Theme.of(context).colorScheme.outline),
|
||||
),
|
||||
),
|
||||
child: pictures[index].fileBytes != null
|
||||
@@ -142,8 +138,6 @@ class _TakePictureSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(remoteConnectionViewModelProvider.notifier);
|
||||
|
||||
return Padding(
|
||||
@@ -157,7 +151,7 @@ class _TakePictureSection extends ConsumerWidget {
|
||||
vm.takePicture();
|
||||
},
|
||||
text: context.translate(I18n.takePicture),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 36, big: 35),
|
||||
),
|
||||
);
|
||||
@@ -169,16 +163,12 @@ class _WaitingForPhotoOverlay extends StatelessWidget {
|
||||
'assets/shared/animations/shooting_photo.json';
|
||||
|
||||
final int remainingSeconds;
|
||||
final ThemePort theme;
|
||||
|
||||
const _WaitingForPhotoOverlay({
|
||||
required this.remainingSeconds,
|
||||
required this.theme,
|
||||
});
|
||||
const _WaitingForPhotoOverlay({required this.remainingSeconds});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return Center(
|
||||
child: Column(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:device_management/src/features/remote_connection/presentation/remote_camera_screen.dart';
|
||||
@@ -16,12 +17,10 @@ class RemoteConnectionScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final device = ref.watch(selectedDeviceProvider).value;
|
||||
final cameraEnabled = device?.capabilities?.camera?.enabled ?? false;
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.remoteConnection),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -83,14 +82,13 @@ class _SectionButton extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return SectionButton(
|
||||
onPressed: onPressed,
|
||||
icon: Icon(
|
||||
icon,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
weight: 30,
|
||||
),
|
||||
body: Text(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -11,7 +10,6 @@ class ShowPictureDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final viewModel = ref.read(remoteConnectionViewModelProvider.notifier);
|
||||
final pictures = ref.watch(
|
||||
remoteConnectionViewModelProvider.select((s) => s.pictures),
|
||||
@@ -23,7 +21,7 @@ class ShowPictureDialog extends ConsumerWidget {
|
||||
if (pictures.isEmpty) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
height: SizeUtils.getByScreen(small: 200, big: 190),
|
||||
@@ -40,7 +38,7 @@ class ShowPictureDialog extends ConsumerWidget {
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
height: SizeUtils.getByScreen(small: 350, big: 340),
|
||||
@@ -92,7 +90,7 @@ class _MetadataSection extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text(
|
||||
dateStr,
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey.shade600),
|
||||
style: TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:device_management/src/features/remote_connection/presentation/state/remote_connection_view_model.dart';
|
||||
import 'package:device_management/src/features/remote_connection/presentation/state/remote_connection_view_state.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
@@ -12,7 +13,6 @@ class SpyCallDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(remoteConnectionViewModelProvider.notifier);
|
||||
|
||||
ref.listen(remoteConnectionViewModelProvider.select((s) => s.errorEvent), (
|
||||
@@ -60,13 +60,13 @@ class SpyCallDialog extends ConsumerWidget {
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
),
|
||||
width: SizeUtils.getByScreen(small: 390, big: 380),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_Header(theme: theme),
|
||||
const _Header(),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
|
||||
Text(
|
||||
context.translate(I18n.spyCallSubtitle),
|
||||
@@ -93,9 +93,7 @@ class SpyCallDialog extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _Header extends StatelessWidget {
|
||||
final ThemePort theme;
|
||||
|
||||
const _Header({required this.theme});
|
||||
const _Header();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -114,10 +112,7 @@ class _Header extends StatelessWidget {
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
),
|
||||
icon: Icon(Icons.close, color: context.sfColors.legacyPrimary),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -170,7 +165,6 @@ class _CallSection extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final isCalling = ref.watch(
|
||||
remoteConnectionViewModelProvider.select((s) => s.isCalling),
|
||||
);
|
||||
@@ -180,7 +174,7 @@ class _CallSection extends ConsumerWidget {
|
||||
: PrimaryButton(
|
||||
onPressed: onPressed,
|
||||
text: context.translate(I18n.call),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -12,7 +13,6 @@ class RewardsScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(rewardsViewModelProvider);
|
||||
final vm = ref.read(rewardsViewModelProvider.notifier);
|
||||
|
||||
@@ -39,7 +39,6 @@ class RewardsScreen extends ConsumerWidget {
|
||||
});
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.rewards),
|
||||
body: Column(
|
||||
children: [
|
||||
@@ -47,7 +46,7 @@ class RewardsScreen extends ConsumerWidget {
|
||||
child: Icon(
|
||||
SFIcons.rewardsCircle,
|
||||
size: SizeUtils.getByScreen(small: 180, big: 160),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 32, big: 28)),
|
||||
@@ -56,7 +55,7 @@ class RewardsScreen extends ConsumerWidget {
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
_CounterSection(theme: theme),
|
||||
const _CounterSection(),
|
||||
],
|
||||
),
|
||||
footer: Padding(
|
||||
@@ -67,7 +66,7 @@ class RewardsScreen extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: state.isLoading ? null : vm.submit,
|
||||
text: context.translate(I18n.sendRewards),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -75,9 +74,8 @@ class RewardsScreen extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _CounterSection extends ConsumerWidget {
|
||||
final ThemePort theme;
|
||||
|
||||
const _CounterSection({required this.theme});
|
||||
const _CounterSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -89,7 +87,7 @@ class _CounterSection extends ConsumerWidget {
|
||||
IconButton(
|
||||
onPressed: vm.decreaseAmount,
|
||||
icon: Icon(Icons.remove),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeUtils.getByScreen(small: 240, big: 220),
|
||||
@@ -98,14 +96,14 @@ class _CounterSection extends ConsumerWidget {
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(SizeUtils.getByScreen(small: 32, big: 28)),
|
||||
),
|
||||
),
|
||||
),
|
||||
style: TextStyle(color: theme.getColorFor(ThemeCode.legacyPrimary)),
|
||||
style: TextStyle(color: context.sfColors.legacyPrimary),
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
@@ -113,7 +111,7 @@ class _CounterSection extends ConsumerWidget {
|
||||
IconButton(
|
||||
onPressed: vm.increaseAmount,
|
||||
icon: Icon(Icons.add),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -44,7 +45,6 @@ class _ScheduledActivitiesScreenState
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(scheduledActivitiesViewModelProvider);
|
||||
|
||||
ref.listen(
|
||||
@@ -57,7 +57,6 @@ class _ScheduledActivitiesScreenState
|
||||
);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.activityScheduleTitle),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -65,11 +64,10 @@ class _ScheduledActivitiesScreenState
|
||||
children: [
|
||||
TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
unselectedLabelColor: theme.getColorFor(
|
||||
ThemeCode.textPrimary,
|
||||
),
|
||||
indicatorColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
labelColor: context.sfColors.legacyPrimary,
|
||||
unselectedLabelColor:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
indicatorColor: context.sfColors.legacyPrimary,
|
||||
indicatorWeight: 3,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
@@ -100,7 +98,7 @@ class _ScheduledActivitiesScreenState
|
||||
],
|
||||
),
|
||||
footer: Material(
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
shape: const CircleBorder(),
|
||||
child: InkWell(
|
||||
customBorder: const CircleBorder(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -122,14 +122,13 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final bottomInset = MediaQuery.of(context).viewInsets.bottom;
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: bottomInset),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(SizeUtils.getByScreen(small: 20, big: 18)),
|
||||
),
|
||||
@@ -163,7 +162,7 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 20, big: 19),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)),
|
||||
@@ -180,7 +179,6 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
? widget.activity!.weekDay
|
||||
: _selectedWeekDay,
|
||||
enabled: !_isEditing,
|
||||
theme: theme,
|
||||
onChanged: (value) =>
|
||||
setState(() => _selectedWeekDay = value),
|
||||
),
|
||||
@@ -195,7 +193,6 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
time: _startTime,
|
||||
isExpanded: _showStartPicker,
|
||||
onTap: () => _togglePicker(isStart: true),
|
||||
theme: theme,
|
||||
),
|
||||
),
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
@@ -205,7 +202,6 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
time: _endTime,
|
||||
isExpanded: _showEndPicker,
|
||||
onTap: () => _togglePicker(isStart: false),
|
||||
theme: theme,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -226,9 +222,7 @@ class _ActivityFormSheetState extends ConsumerState<ActivityFormSheet> {
|
||||
child: ElevatedButton(
|
||||
onPressed: _isFormValid ? _submit : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: theme.getColorFor(
|
||||
ThemeCode.legacyPrimary,
|
||||
),
|
||||
backgroundColor: context.sfColors.legacyPrimary,
|
||||
disabledBackgroundColor: Colors.grey[300],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
@@ -260,14 +254,12 @@ class _TimeSelector extends StatelessWidget {
|
||||
final TimeOfDay time;
|
||||
final bool isExpanded;
|
||||
final VoidCallback onTap;
|
||||
final ThemePort theme;
|
||||
|
||||
const _TimeSelector({
|
||||
required this.label,
|
||||
required this.time,
|
||||
required this.isExpanded,
|
||||
required this.onTap,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -282,7 +274,7 @@ class _TimeSelector extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: isExpanded
|
||||
? theme.getColorFor(ThemeCode.legacyPrimary)
|
||||
? context.sfColors.legacyPrimary
|
||||
: Colors.grey,
|
||||
width: isExpanded ? 2 : 1,
|
||||
),
|
||||
@@ -295,8 +287,7 @@ class _TimeSelector extends StatelessWidget {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -315,8 +306,7 @@ class _TimeSelector extends StatelessWidget {
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
size: SizeUtils.getByScreen(small: 20, big: 18),
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:utils/utils.dart';
|
||||
|
||||
import '../../domain/entities/scheduled_activity_entity.dart';
|
||||
import '../state/scheduled_activities_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
|
||||
class ConfirmDeleteActivityDialog extends ConsumerWidget {
|
||||
final ScheduledActivityEntity activity;
|
||||
@@ -14,7 +15,6 @@ class ConfirmDeleteActivityDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
@@ -23,7 +23,7 @@ class ConfirmDeleteActivityDialog extends ConsumerWidget {
|
||||
),
|
||||
width: SizeUtils.getByScreen(small: 360, big: 350),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 16, big: 14),
|
||||
),
|
||||
@@ -48,7 +48,7 @@ class ConfirmDeleteActivityDialog extends ConsumerWidget {
|
||||
child: PrimaryButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
text: context.translate(I18n.cancel),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
@@ -63,7 +63,7 @@ class ConfirmDeleteActivityDialog extends ConsumerWidget {
|
||||
.deleteActivity(activity.id);
|
||||
},
|
||||
text: context.translate(I18n.delete),
|
||||
color: const Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
height: SizeUtils.getByScreen(small: 38, big: 36),
|
||||
radius: SizeUtils.getByScreen(small: 32, big: 34),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -16,7 +17,6 @@ class DayTimeline extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
if (activities.isEmpty) {
|
||||
return Center(
|
||||
@@ -26,14 +26,14 @@ class DayTimeline extends ConsumerWidget {
|
||||
Icon(
|
||||
SFIcons.calendarCircle,
|
||||
size: SizeUtils.getByScreen(small: 48, big: 44),
|
||||
color: theme.getColorFor(ThemeCode.textSecondary),
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
Text(
|
||||
context.translate(I18n.scheduledActivityEmpty),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 15, big: 14),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 6, big: 4)),
|
||||
@@ -41,7 +41,7 @@ class DayTimeline extends ConsumerWidget {
|
||||
context.translate(I18n.scheduledActivityEmptyHint),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 12),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -58,7 +58,7 @@ class DayTimeline extends ConsumerWidget {
|
||||
itemBuilder: (context, index) {
|
||||
final activity = activities[index];
|
||||
final isLast = index == activities.length - 1;
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return IntrinsicHeight(
|
||||
child: Row(
|
||||
@@ -67,12 +67,11 @@ class DayTimeline extends ConsumerWidget {
|
||||
_TimeLabels(
|
||||
startTime: activity.startTime,
|
||||
endTime: activity.endTime,
|
||||
theme: theme,
|
||||
),
|
||||
_TimelineDotAndLine(isLast: isLast, color: primaryColor),
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 10, big: 8)),
|
||||
Expanded(
|
||||
child: _ActivityTimelineCard(activity: activity, theme: theme),
|
||||
child: _ActivityTimelineCard(activity: activity),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -85,12 +84,10 @@ class DayTimeline extends ConsumerWidget {
|
||||
class _TimeLabels extends StatelessWidget {
|
||||
final String startTime;
|
||||
final String endTime;
|
||||
final ThemePort theme;
|
||||
|
||||
const _TimeLabels({
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -98,7 +95,7 @@ class _TimeLabels extends StatelessWidget {
|
||||
final style = TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 12, big: 11),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
);
|
||||
|
||||
return SizedBox(
|
||||
@@ -108,7 +105,7 @@ class _TimeLabels extends StatelessWidget {
|
||||
children: [
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 10, big: 8)),
|
||||
Text(startTime, style: style),
|
||||
const Spacer(),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: SizeUtils.getByScreen(small: 14, big: 12),
|
||||
@@ -116,8 +113,7 @@ class _TimeLabels extends StatelessWidget {
|
||||
child: Text(
|
||||
endTime,
|
||||
style: style.copyWith(
|
||||
color: theme
|
||||
.getColorFor(ThemeCode.textPrimary)
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
@@ -158,9 +154,8 @@ class _TimelineDotAndLine extends StatelessWidget {
|
||||
|
||||
class _ActivityTimelineCard extends ConsumerWidget {
|
||||
final ScheduledActivityEntity activity;
|
||||
final ThemePort theme;
|
||||
|
||||
const _ActivityTimelineCard({required this.activity, required this.theme});
|
||||
const _ActivityTimelineCard({required this.activity});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -174,7 +169,7 @@ class _ActivityTimelineCard extends ConsumerWidget {
|
||||
borderRadius: BorderRadius.circular(
|
||||
SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -195,10 +190,10 @@ class _ActivityTimelineCard extends ConsumerWidget {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.edit_outlined,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
size: SizeUtils.getByScreen(small: 20, big: 18),
|
||||
),
|
||||
constraints: const BoxConstraints(),
|
||||
constraints: BoxConstraints(),
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 8, big: 6)),
|
||||
),
|
||||
IconButton(
|
||||
@@ -215,7 +210,7 @@ class _ActivityTimelineCard extends ConsumerWidget {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.delete_outlined,
|
||||
color: const Color(0xFFFF5D52),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
size: SizeUtils.getByScreen(small: 20, big: 18),
|
||||
),
|
||||
constraints: const BoxConstraints(),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
@@ -12,7 +13,6 @@ class VolumeControlScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(volumeControlViewModelProvider.notifier);
|
||||
final state = ref.watch(volumeControlViewModelProvider);
|
||||
|
||||
@@ -32,10 +32,9 @@ class VolumeControlScreen extends ConsumerWidget {
|
||||
if (done) Navigator.pop(context);
|
||||
});
|
||||
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.volumeControl),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -69,7 +68,7 @@ class VolumeControlScreen extends ConsumerWidget {
|
||||
context.translate(I18n.volumeHint),
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey.shade500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
@@ -113,7 +112,7 @@ class _VolumeCard extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 14, 16, 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -133,14 +132,14 @@ class _VolumeCard extends StatelessWidget {
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.volume_up, color: Colors.grey.shade400, size: 22),
|
||||
Icon(Icons.volume_up, color: Theme.of(context).colorScheme.outline, size: 22),
|
||||
Expanded(
|
||||
child: SliderTheme(
|
||||
data: SliderThemeData(
|
||||
activeTrackColor: color,
|
||||
thumbColor: Colors.white,
|
||||
thumbShape: VolumeThumbShape(color: color),
|
||||
inactiveTrackColor: Colors.grey.shade200,
|
||||
inactiveTrackColor: Theme.of(context).colorScheme.outlineVariant,
|
||||
overlayColor: color.withValues(alpha: 0.1),
|
||||
trackHeight: 6,
|
||||
),
|
||||
@@ -161,7 +160,7 @@ class _VolumeCard extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey.shade600,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,6 +28,8 @@ dependencies:
|
||||
#modules dependencies go here
|
||||
|
||||
#packages dependencies go here
|
||||
legacy_theme:
|
||||
path: ../../packages/legacy_theme
|
||||
sf_tracking:
|
||||
path: ../../../../packages/sf_tracking
|
||||
design_system:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/state/device_setup_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/state/device_setup_view_state.dart';
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/enums/add_kid_step.dart';
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/step_body.dart';
|
||||
@@ -33,7 +34,6 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final state = ref.watch(legacyDeviceSetupViewModelProvider);
|
||||
final vm = ref.read(legacyDeviceSetupViewModelProvider.notifier);
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final isIntro = state.step == LegacyAddKidStep.intro;
|
||||
|
||||
@@ -61,7 +61,7 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
vm.back();
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -76,20 +76,20 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
if (isIntro && isFirstDevice)
|
||||
IconButton(
|
||||
onPressed: () => _confirmLogout(context, ref),
|
||||
icon: const Icon(Icons.logout),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
icon: Icon(Icons.logout),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
)
|
||||
else if (isIntro)
|
||||
IconButton(
|
||||
onPressed: () => Navigator.maybePop(context),
|
||||
icon: Icon(Icons.adaptive.arrow_back),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
onPressed: vm.back,
|
||||
icon: Icon(Icons.adaptive.arrow_back),
|
||||
color: theme.getColorFor(ThemeCode.textPrimary),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
tooltip: MaterialLocalizations.of(
|
||||
context,
|
||||
).backButtonTooltip,
|
||||
@@ -100,7 +100,7 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
: StepIndicator(
|
||||
total: LegacyAddKidStep.mainStepCount,
|
||||
current: state.step.mainStepIndex + 1,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 48),
|
||||
@@ -145,7 +145,6 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
}
|
||||
await vm.next();
|
||||
},
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -155,8 +154,7 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
}
|
||||
|
||||
void _confirmLogout(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final primaryColor = context.sfColors.legacyPrimary;
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -186,7 +184,7 @@ class LegacyDeviceSetupScreen extends ConsumerWidget {
|
||||
},
|
||||
child: Text(
|
||||
context.translate(I18n.logOut),
|
||||
style: const TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/widgets/numbered_steps.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -10,7 +10,6 @@ class LegacyIntroStepScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -36,7 +35,7 @@ class LegacyIntroStepScreen extends ConsumerWidget {
|
||||
context.translate(I18n.deviceSetupIntroStep1),
|
||||
context.translate(I18n.deviceSetupIntroStep2),
|
||||
],
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -54,7 +54,7 @@ class LegacyScanWatchStepScreen extends ConsumerWidget {
|
||||
width: 170,
|
||||
height: 170,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade500, width: 1),
|
||||
border: Border.all(color: Theme.of(context).colorScheme.onSurfaceVariant, width: 1),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Center(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/state/device_setup_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/device_setup/presentation/widgets/flow_footer.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
@@ -15,10 +15,9 @@ class LegacySuccessScreen extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final vm = ref.read(legacyDeviceSetupViewModelProvider.notifier);
|
||||
final state = ref.watch(legacyDeviceSetupViewModelProvider);
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -30,7 +29,7 @@ class LegacySuccessScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -68,7 +67,6 @@ class LegacySuccessScreen extends ConsumerWidget {
|
||||
vm.resetForNewKid();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
theme: theme,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -30,7 +30,7 @@ class _ActivationCodeDialog extends StatelessWidget {
|
||||
Icon(
|
||||
Icons.email_outlined,
|
||||
size: SizeUtils.getByScreen(small: 48, big: 44),
|
||||
color: const Color(0xFF329E95),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 14)),
|
||||
Text(
|
||||
@@ -47,7 +47,7 @@ class _ActivationCodeDialog extends StatelessWidget {
|
||||
child: TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color(0xFF329E95),
|
||||
foregroundColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
child: Text(
|
||||
context.translate(I18n.ok),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LegacyFlowFooter extends StatelessWidget {
|
||||
@@ -6,14 +7,12 @@ class LegacyFlowFooter extends StatelessWidget {
|
||||
super.key,
|
||||
required this.primaryText,
|
||||
required this.onPrimary,
|
||||
required this.theme,
|
||||
this.secondaryText,
|
||||
this.onSecondary,
|
||||
});
|
||||
|
||||
final String primaryText;
|
||||
final VoidCallback onPrimary;
|
||||
final ThemePort theme;
|
||||
|
||||
final String? secondaryText;
|
||||
final VoidCallback? onSecondary;
|
||||
@@ -22,8 +21,8 @@ class LegacyFlowFooter extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
border: Border(top: BorderSide(color: Colors.grey.shade300, width: 1)),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline, width: 1)),
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -34,7 +33,7 @@ class LegacyFlowFooter extends StatelessWidget {
|
||||
PrimaryButton(
|
||||
text: primaryText,
|
||||
onPressed: onPrimary,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
if (secondaryText != null && onSecondary != null) ...[
|
||||
const SizedBox(height: 10),
|
||||
|
||||
@@ -20,7 +20,7 @@ class LegacyNumberedSteps extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final Color resolvedColor =
|
||||
color ?? Theme.of(context).colorScheme.secondaryContainer;
|
||||
final Color resolvedTextColor = textColor ?? Colors.grey.shade800;
|
||||
final Color resolvedTextColor = textColor ?? Theme.of(context).colorScheme.onSurface;
|
||||
final TextStyle resolvedTextStyle =
|
||||
textStyle ??
|
||||
TextStyle(
|
||||
@@ -65,7 +65,7 @@ class LegacyNumberedSteps extends StatelessWidget {
|
||||
width: 4,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade400,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/link_phone/presentation/state/link_phone_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -15,13 +16,12 @@ class LegacyRequestLinkPhoneScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(legacyLinkPhoneViewModelProvider.notifier);
|
||||
final viewState = ref.watch(legacyLinkPhoneViewModelProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Column(
|
||||
@@ -84,8 +84,8 @@ class LegacyRequestLinkPhoneScreen extends ConsumerWidget {
|
||||
Text(
|
||||
context.translate(viewState.errorMessage),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -102,7 +102,7 @@ class LegacyRequestLinkPhoneScreen extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.next),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/link_phone/presentation/state/link_phone_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/link_phone/presentation/widgets/link_phone_code_input.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -16,13 +17,12 @@ class LegacyVerifyLinkPhoneCodeScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(legacyLinkPhoneViewModelProvider.notifier);
|
||||
final viewState = ref.watch(legacyLinkPhoneViewModelProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Center(
|
||||
@@ -69,8 +69,8 @@ class LegacyVerifyLinkPhoneCodeScreen extends ConsumerWidget {
|
||||
Text(
|
||||
context.translate(viewState.errorMessage),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -91,7 +91,7 @@ class LegacyVerifyLinkPhoneCodeScreen extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.enter),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/login/domain/entities/legacy_auth_error_event.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/login/presentation/state/login_view_model.dart';
|
||||
import 'package:legacy_auth/src/features/login/presentation/widgets/field_error_text.dart';
|
||||
import 'package:legacy_auth/src/features/login/presentation/widgets/two_factor_sheet_launcher.dart';
|
||||
@@ -30,7 +31,6 @@ class LegacyLoginScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final bool isLoading = ref.watch(
|
||||
legacyLoginViewModelProvider.select((s) => s.isLoading),
|
||||
);
|
||||
@@ -73,7 +73,7 @@ class LegacyLoginScreen extends ConsumerWidget {
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: AbsorbPointer(
|
||||
absorbing: isLoading,
|
||||
@@ -82,7 +82,7 @@ class LegacyLoginScreen extends ConsumerWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_Header(theme: theme),
|
||||
const _Header(),
|
||||
SizedBox(height: 48),
|
||||
_EmailSection(),
|
||||
SizedBox(height: 24),
|
||||
@@ -96,7 +96,6 @@ class LegacyLoginScreen extends ConsumerWidget {
|
||||
// _ForgotPassword(navigationContract: navigationContract),
|
||||
// SizedBox(height: 30),
|
||||
_SignInSection(
|
||||
theme: theme,
|
||||
onSignIn: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
ref.read(legacyLoginViewModelProvider.notifier).login();
|
||||
@@ -114,8 +113,7 @@ class LegacyLoginScreen extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _Header extends StatelessWidget {
|
||||
const _Header({required this.theme});
|
||||
final ThemePort theme;
|
||||
const _Header();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -123,7 +121,7 @@ class _Header extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
size: 54,
|
||||
),
|
||||
Text(
|
||||
@@ -217,10 +215,9 @@ class _ForgotPassword extends ConsumerWidget {
|
||||
}
|
||||
|
||||
class _SignInSection extends ConsumerWidget {
|
||||
const _SignInSection({required this.onSignIn, required this.theme});
|
||||
const _SignInSection({required this.onSignIn});
|
||||
|
||||
final VoidCallback onSignIn;
|
||||
final ThemePort theme;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -234,7 +231,7 @@ class _SignInSection extends ConsumerWidget {
|
||||
PrimaryButton(
|
||||
onPressed: isLoading ? () {} : onSignIn,
|
||||
text: context.translate(I18n.signIn),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
leading: isLoading
|
||||
? const SizedBox(
|
||||
height: 18,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:legacy_auth/src/features/login/presentation/widgets/otp_code_fields.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
@@ -8,7 +9,6 @@ import 'package:utils/utils.dart';
|
||||
class LegacyTwoFactorBottomSheetView extends StatelessWidget {
|
||||
const LegacyTwoFactorBottomSheetView({
|
||||
super.key,
|
||||
required this.theme,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.verifyText,
|
||||
@@ -24,8 +24,6 @@ class LegacyTwoFactorBottomSheetView extends StatelessWidget {
|
||||
required this.onClose,
|
||||
});
|
||||
|
||||
final ThemePort theme;
|
||||
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String verifyText;
|
||||
@@ -50,7 +48,7 @@ class LegacyTwoFactorBottomSheetView extends StatelessWidget {
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(12, 12, 12, 24 + bottomInset),
|
||||
@@ -98,7 +96,7 @@ class LegacyTwoFactorBottomSheetView extends StatelessWidget {
|
||||
? () {}
|
||||
: () => unawaited(onVerify()),
|
||||
text: verifyText,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
leading: isOtpLoading
|
||||
? const SizedBox(
|
||||
height: 18,
|
||||
|
||||
@@ -28,7 +28,6 @@ void showTwoFactorSheet(BuildContext context) {
|
||||
builder: (sheetContext) {
|
||||
return Consumer(
|
||||
builder: (sheetContext, ref, _) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(legacyLoginViewModelProvider.notifier);
|
||||
|
||||
final otpErrorKey = ref.watch(
|
||||
@@ -73,7 +72,6 @@ void showTwoFactorSheet(BuildContext context) {
|
||||
final canResend = !isLoading && resendCooldown == 0;
|
||||
|
||||
return LegacyTwoFactorBottomSheetView(
|
||||
theme: theme,
|
||||
title: sheetContext.translate(I18n.twoFactorTitle),
|
||||
subtitle: sheetContext.translate(I18n.twoFactorSubtitle),
|
||||
verifyText: sheetContext.translate(I18n.twoFactorVerify),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/onboarding/domain/onboarding_page.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/onboarding/presentation/onboarding_view_model.dart';
|
||||
import 'package:legacy_auth/src/features/onboarding/presentation/widgets/onboarding_content.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
@@ -23,11 +24,10 @@ class LegacyOnboardingScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final state = ref.watch(legacyOnBoardingViewModelProvider);
|
||||
final viewModel = ref.read(legacyOnBoardingViewModelProvider.notifier);
|
||||
final pageController = ref.watch(legacyOnboardingPageControllerProvider);
|
||||
final legacyColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
final legacyColor = context.sfColors.legacyPrimary;
|
||||
|
||||
final isLast = state.cardIndex >= onboardingPages.length - 1;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/recover_password/presentation/state/recover_password_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:legacy_auth/src/features/recover_password/presentation/state/recover_password_view_state.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -16,13 +17,12 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final NavigationContract navigationContract = GetIt.I<NavigationContract>();
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(legacyRecoverPasswordViewModelProvider.notifier);
|
||||
final viewState = ref.watch(legacyRecoverPasswordViewModelProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Center(
|
||||
@@ -56,23 +56,23 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
hint: '********',
|
||||
controller: viewModel.repeatedPasswordController,
|
||||
// onVisibilityChanged: viewModel.togglePasswordVisible,
|
||||
// color: viewState.equalPasswords ? const Color(0xFF4B4B4B) : const Color.fromRGBO(239, 17, 17, 1),
|
||||
// color: viewState.equalPasswords ? Theme.of(context).colorScheme.onSurface : Theme.of(context).colorScheme.error,
|
||||
),
|
||||
if (!viewState.equalPasswords) ...[
|
||||
SizedBox(height: 4),
|
||||
Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.info_outline_rounded,
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
size: 16,
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.errorMessageUnequalPasswords),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
@@ -86,11 +86,9 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(
|
||||
viewState.securityChecks['min']!
|
||||
? ThemeCode.legacyPrimary
|
||||
: ThemeCode.buttonSecondary,
|
||||
),
|
||||
color: viewState.securityChecks['min']!
|
||||
? context.sfColors.legacyPrimary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.passwordLength),
|
||||
@@ -110,11 +108,9 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(
|
||||
viewState.securityChecks['capital']!
|
||||
? ThemeCode.legacyPrimary
|
||||
: ThemeCode.buttonSecondary,
|
||||
),
|
||||
color: viewState.securityChecks['capital']!
|
||||
? context.sfColors.legacyPrimary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.passwordCapital),
|
||||
@@ -134,11 +130,9 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(
|
||||
viewState.securityChecks['number']!
|
||||
? ThemeCode.legacyPrimary
|
||||
: ThemeCode.buttonSecondary,
|
||||
),
|
||||
color: viewState.securityChecks['number']!
|
||||
? context.sfColors.legacyPrimary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.passwordNumber),
|
||||
@@ -158,11 +152,9 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(
|
||||
viewState.securityChecks['special']!
|
||||
? ThemeCode.legacyPrimary
|
||||
: ThemeCode.buttonSecondary,
|
||||
),
|
||||
color: viewState.securityChecks['special']!
|
||||
? context.sfColors.legacyPrimary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
context.translate(I18n.passwordSpecial),
|
||||
@@ -181,8 +173,8 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
Text(
|
||||
context.translate(viewState.displayErrorKey!),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -199,7 +191,7 @@ class LegacyNewPasswordScreen extends ConsumerWidget {
|
||||
}
|
||||
},
|
||||
text: context.translate(I18n.accept),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -19,13 +19,12 @@ class LegacyRequestRecoveryScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(legacyRecoverPasswordViewModelProvider.notifier);
|
||||
final viewState = ref.watch(legacyRecoverPasswordViewModelProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Container(
|
||||
margin: EdgeInsets.all(
|
||||
SizeUtils.getByScreen(small: 30, big: 30, xl: 20),
|
||||
@@ -63,8 +62,8 @@ class LegacyRequestRecoveryScreen extends ConsumerWidget {
|
||||
Text(
|
||||
context.translate(viewState.displayErrorKey!),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(239, 17, 17, 1),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
@@ -103,7 +102,7 @@ class LegacyRequestRecoveryScreen extends ConsumerWidget {
|
||||
},
|
||||
text: context.translate(I18n.send),
|
||||
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
|
||||
color: theme.getColorFor(ThemeCode.buttonSecondary),
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/recover_password/presentation/new_password/new_password_screen.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -15,12 +16,11 @@ class LegacySentScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewModel = ref.read(legacyRecoverPasswordViewModelProvider.notifier);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Container(
|
||||
margin: EdgeInsets.all(24),
|
||||
child: Center(
|
||||
@@ -44,7 +44,7 @@ class LegacySentScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeUtils.getByScreen(small: 10, big: 10, xl: 6),
|
||||
@@ -106,7 +106,7 @@ class LegacySentScreen extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
text: context.translate(I18n.continueKey),
|
||||
color: theme.getColorFor(ThemeCode.buttonSecondary),
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
size: SizeUtils.getByScreen(small: 16, big: 16, xl: 14),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:legacy_auth/src/features/sign_up/presentation/state/sign_up_view_model.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -15,7 +16,6 @@ class LegacyAccountCreatedScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final state = ref.watch(legacySignUpViewModelProvider);
|
||||
|
||||
@@ -23,7 +23,7 @@ class LegacyAccountCreatedScreen extends ConsumerWidget {
|
||||
final String fullName = '${state.firstName} ${state.lastName}'.trim();
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: Container(
|
||||
margin: const EdgeInsets.all(30),
|
||||
child: Center(
|
||||
@@ -32,7 +32,7 @@ class LegacyAccountCreatedScreen extends ConsumerWidget {
|
||||
const Spacer(flex: 10),
|
||||
Icon(
|
||||
Icons.check,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -83,7 +83,7 @@ class LegacyAccountCreatedScreen extends ConsumerWidget {
|
||||
PrimaryButton(
|
||||
onPressed: () => navigationContract.goTo(AppRoutes.legacyLogin),
|
||||
text: context.translate(I18n.accountCreatedContinue),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
const Spacer(flex: 8),
|
||||
],
|
||||
|
||||
@@ -105,7 +105,7 @@ class _CriteriaRow extends StatelessWidget {
|
||||
color = Colors.green;
|
||||
icon = Icons.check_circle;
|
||||
} else {
|
||||
color = Colors.red.shade400;
|
||||
color = Theme.of(context).colorScheme.error;
|
||||
icon = Icons.cancel;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -26,7 +27,6 @@ class LegacySignupPersonalScreen extends StatelessWidget {
|
||||
final bool acceptTerms;
|
||||
final ValueChanged<bool?>? onAcceptTermsPressed;
|
||||
final String termsText;
|
||||
final ThemePort theme;
|
||||
|
||||
const LegacySignupPersonalScreen({
|
||||
super.key,
|
||||
@@ -47,7 +47,6 @@ class LegacySignupPersonalScreen extends StatelessWidget {
|
||||
required this.acceptTerms,
|
||||
required this.onAcceptTermsPressed,
|
||||
required this.termsText,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -105,7 +104,7 @@ class LegacySignupPersonalScreen extends StatelessWidget {
|
||||
),
|
||||
checkboxScaleFactor: 1.5,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
activeColor: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
activeColor: context.sfColors.legacyPrimary,
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -46,7 +46,6 @@ class LegacySignupScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(legacySignUpViewModelProvider.notifier);
|
||||
final state = ref.watch(legacySignUpViewModelProvider);
|
||||
|
||||
@@ -86,7 +85,6 @@ class LegacySignupScreen extends ConsumerWidget {
|
||||
return LegacyAccountCreatedScreen(navigationContract: navigationContract);
|
||||
}
|
||||
return LegacySignUpLayout(
|
||||
theme: theme,
|
||||
supertitle: step.supertitle,
|
||||
title: step.title,
|
||||
subtitle: step.subtitle ?? '',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:legacy_auth/src/features/sign_up/models/sign_up_step_config.dart';
|
||||
import 'package:legacy_auth/src/features/sign_up/presentation/screens/sign_up_password_screen.dart';
|
||||
@@ -13,7 +12,6 @@ List<LegacySignUpStepConfig> signUpSteps(BuildContext context) => [
|
||||
title: context.translate(I18n.stepUserContactTitle),
|
||||
subtitle: context.translate(I18n.stepUserContactSubtitle),
|
||||
bodyBuilder: (context, ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final vm = ref.read(legacySignUpViewModelProvider.notifier);
|
||||
final state = ref.watch(legacySignUpViewModelProvider);
|
||||
|
||||
@@ -26,7 +24,6 @@ List<LegacySignUpStepConfig> signUpSteps(BuildContext context) => [
|
||||
acceptTerms: state.acceptTerms,
|
||||
onAcceptTermsPressed: (v) => vm.setAcceptTerms(v ?? false),
|
||||
termsText: context.translate(I18n.termsText),
|
||||
theme: theme,
|
||||
|
||||
firstNameLabel: context.translate(I18n.firstNameLabel),
|
||||
firstNameHint: context.translate(I18n.firstNameHint),
|
||||
|
||||
@@ -21,7 +21,7 @@ class LegacyFormErrorBanner extends StatelessWidget {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(Icons.error_outline, size: 18, color: Colors.red),
|
||||
Icon(Icons.error_outline, size: 18, color: Theme.of(context).colorScheme.error),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
@@ -32,11 +33,11 @@ class LegacyFormStepLayout extends ConsumerWidget {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -47,7 +48,7 @@ class LegacyFormStepLayout extends ConsumerWidget {
|
||||
child: StepIndicator(
|
||||
total: numSteps,
|
||||
current: currentStep,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
@@ -107,7 +108,7 @@ class LegacyFormStepLayout extends ConsumerWidget {
|
||||
return PrimaryButton(
|
||||
onPressed: nextStep,
|
||||
text: context.translate(I18n.continueKey),
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
);
|
||||
} else {
|
||||
return Row(
|
||||
@@ -125,7 +126,7 @@ class LegacyFormStepLayout extends ConsumerWidget {
|
||||
onPressed: nextStep,
|
||||
text: context.translate(I18n.next),
|
||||
size: 16,
|
||||
color: theme.getColorFor(ThemeCode.buttonSecondary),
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:legacy_theme/legacy_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
|
||||
class LegacySignUpLayout extends StatelessWidget {
|
||||
final ThemePort theme;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String supertitle;
|
||||
@@ -18,7 +18,6 @@ class LegacySignUpLayout extends StatelessWidget {
|
||||
|
||||
const LegacySignUpLayout({
|
||||
super.key,
|
||||
required this.theme,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.supertitle,
|
||||
@@ -46,10 +45,10 @@ class LegacySignUpLayout extends StatelessWidget {
|
||||
|
||||
Widget _buildScaffold(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
padding: const EdgeInsets.only(left: 24, right: 24),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -58,7 +57,7 @@ class LegacySignUpLayout extends StatelessWidget {
|
||||
child: StepIndicator(
|
||||
total: numSteps,
|
||||
current: currentStep,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -106,7 +105,7 @@ class LegacySignUpLayout extends StatelessWidget {
|
||||
onPressed: onNextPressed,
|
||||
text: context.translate(I18n.next),
|
||||
size: 16,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
color: context.sfColors.legacyPrimary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -13,6 +13,8 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
#packages dependencies go here
|
||||
legacy_theme:
|
||||
path: ../../packages/legacy_theme
|
||||
design_system:
|
||||
path: ../../../../packages/design_system
|
||||
navigation:
|
||||
|
||||
@@ -17,12 +17,11 @@ class LegacyDashboardScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
body: navigationShell,
|
||||
bottomNavigationBar: NavigationBar(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
selectedIndex: navigationShell.currentIndex,
|
||||
onDestinationSelected: (index) {
|
||||
navigationShell.goBranch(index);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user