diff --git a/.vscode/settings.json b/.vscode/settings.json index 67e6e8c..e460be0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,6 @@ "Linkding", "linkdy", "Linkdy" - ] + ], + "cSpell.language": "en,es,tr", } \ No newline at end of file diff --git a/lib/screens/onboarding/ui/connect.dart b/lib/screens/onboarding/ui/connect.dart index 9f4975e..b4a833c 100644 --- a/lib/screens/onboarding/ui/connect.dart +++ b/lib/screens/onboarding/ui/connect.dart @@ -208,14 +208,14 @@ class _ConnectForm extends ConsumerWidget { onPressed: provider.testConnection == null ? () => ref.read(connectProvider.notifier).testConnection() : null, style: ButtonStyle( foregroundColor: provider.testConnection == LoadStatus.loaded - ? const MaterialStatePropertyAll(Colors.green) + ? const WidgetStatePropertyAll(Colors.green) : provider.testConnection == LoadStatus.error - ? const MaterialStatePropertyAll(Colors.red) + ? const WidgetStatePropertyAll(Colors.red) : null, backgroundColor: provider.testConnection == LoadStatus.loaded - ? MaterialStatePropertyAll(Colors.green.withOpacity(0.15)) + ? WidgetStatePropertyAll(Colors.green.withOpacity(0.15)) : provider.testConnection == LoadStatus.error - ? MaterialStatePropertyAll(Colors.red.withOpacity(0.15)) + ? WidgetStatePropertyAll(Colors.red.withOpacity(0.15)) : null, ), child: Row( diff --git a/lib/screens/settings/ui/customization/color_item.dart b/lib/screens/settings/ui/customization/color_item.dart index d753bf5..9f36d94 100644 --- a/lib/screens/settings/ui/customization/color_item.dart +++ b/lib/screens/settings/ui/customization/color_item.dart @@ -15,29 +15,29 @@ class ColorItem extends StatelessWidget { required this.color, required this.numericValue, required this.selectedValue, - required this.onChanged + required this.onChanged, }); @override Widget build(BuildContext context) { return Padding( padding: index == 0 - ? const EdgeInsets.only(top: 10, right: 10, bottom: 10) - : index == total-1 - ? const EdgeInsets.only(top: 10, bottom: 10, left: 10) - : const EdgeInsets.all(10), + ? const EdgeInsets.only(top: 10, right: 10, bottom: 10) + : index == total - 1 + ? const EdgeInsets.only(top: 10, bottom: 10, left: 10) + : const EdgeInsets.all(10), child: Material( borderRadius: BorderRadius.circular(50), child: InkWell( onTap: () => onChanged(numericValue), borderRadius: BorderRadius.circular(50), - overlayColor: const MaterialStatePropertyAll(Colors.grey), + overlayColor: const WidgetStatePropertyAll(Colors.grey), child: Container( width: 50, height: 50, decoration: BoxDecoration( color: color, - borderRadius: BorderRadius.circular(50) + borderRadius: BorderRadius.circular(50), ), child: AnimatedOpacity( opacity: numericValue == selectedValue ? 1 : 0, @@ -54,4 +54,4 @@ class ColorItem extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/settings/ui/customization/theme_mode_button.dart b/lib/screens/settings/ui/customization/theme_mode_button.dart index df3f8d1..eb40bce 100644 --- a/lib/screens/settings/ui/customization/theme_mode_button.dart +++ b/lib/screens/settings/ui/customization/theme_mode_button.dart @@ -9,44 +9,42 @@ class ThemeModeButton extends StatelessWidget { final bool? disabled; const ThemeModeButton({ - Key? key, + super.key, required this.icon, required this.value, required this.selected, required this.label, required this.onChanged, - this.disabled - }) : super(key: key); + this.disabled, + }); @override Widget build(BuildContext context) { final Color greyBackgroundColor = Theme.of(context).brightness == Brightness.light - ?const Color.fromRGBO(200, 200, 200, 1) - :const Color.fromRGBO(50, 50, 50, 1); + ? const Color.fromRGBO(200, 200, 200, 1) + : const Color.fromRGBO(50, 50, 50, 1); final Color greyIconColor = Theme.of(context).brightness == Brightness.light - ? const Color.fromRGBO(130, 130, 130, 1) - : const Color.fromRGBO(100, 100, 100, 1); + ? const Color.fromRGBO(130, 130, 130, 1) + : const Color.fromRGBO(100, 100, 100, 1); return ElevatedButton( - onPressed: disabled == null || disabled == false - ? () => onChanged(value) - : null, + onPressed: disabled == null || disabled == false ? () => onChanged(value) : null, style: ButtonStyle( - elevation: MaterialStateProperty.all(0), - shape: MaterialStateProperty.all( + elevation: WidgetStateProperty.all(0), + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(30), - ) + ), ), - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( value == selected - ? disabled == null || disabled == false - ? Theme.of(context).colorScheme.primary - : greyBackgroundColor - : disabled == null || disabled == false - ? Theme.of(context).colorScheme.surfaceVariant - : greyBackgroundColor, - ) + ? disabled == null || disabled == false + ? Theme.of(context).colorScheme.primary + : greyBackgroundColor + : disabled == null || disabled == false + ? Theme.of(context).colorScheme.surfaceContainerHighest + : greyBackgroundColor, + ), ), child: AnimatedContainer( width: 118, @@ -59,30 +57,34 @@ class ThemeModeButton extends StatelessWidget { Icon( icon, color: value == selected - ? disabled == null || disabled == false - ? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 ? Colors.black : Colors.white - : greyIconColor - : disabled == null || disabled == false - ? Theme.of(context).colorScheme.primary - : greyIconColor, + ? disabled == null || disabled == false + ? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 + ? Colors.black + : Colors.white + : greyIconColor + : disabled == null || disabled == false + ? Theme.of(context).colorScheme.primary + : greyIconColor, size: 30, ), Text( label, style: TextStyle( color: value == selected - ? disabled == null || disabled == false - ? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 ? Colors.black : Colors.white - : greyIconColor + ? disabled == null || disabled == false + ? Theme.of(context).colorScheme.primary.computeLuminance() > 0.5 + ? Colors.black + : Colors.white + : greyIconColor : disabled == null || disabled == false - ? Theme.of(context).colorScheme.primary - : greyIconColor, - fontSize: 18 + ? Theme.of(context).colorScheme.primary + : greyIconColor, + fontSize: 18, ), - ) + ), ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/settings/ui/general_settings/disconnect_modal.dart b/lib/screens/settings/ui/general_settings/disconnect_modal.dart index 956d164..690ee95 100644 --- a/lib/screens/settings/ui/general_settings/disconnect_modal.dart +++ b/lib/screens/settings/ui/general_settings/disconnect_modal.dart @@ -5,7 +5,7 @@ import 'package:linkdy/i18n/strings.g.dart'; import 'package:linkdy/providers/api_client.provider.dart'; class DisconnectModal extends ConsumerWidget { - const DisconnectModal({Key? key}) : super(key: key); + const DisconnectModal({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/lib/screens/settings/ui/general_settings/general_settings.dart b/lib/screens/settings/ui/general_settings/general_settings.dart index d464531..861dddf 100644 --- a/lib/screens/settings/ui/general_settings/general_settings.dart +++ b/lib/screens/settings/ui/general_settings/general_settings.dart @@ -101,8 +101,8 @@ class GeneralSettings extends ConsumerWidget { t.settings.generalSettings.disconnectFromServer, ), style: const ButtonStyle( - foregroundColor: MaterialStatePropertyAll(Colors.white), - backgroundColor: MaterialStatePropertyAll(Colors.red), + foregroundColor: WidgetStatePropertyAll(Colors.white), + backgroundColor: WidgetStatePropertyAll(Colors.red), ), ), ], diff --git a/lib/screens/tags/ui/add_tag_error_modal.dart b/lib/screens/tags/ui/add_tag_error_modal.dart index 68fd721..72aa7ca 100644 --- a/lib/screens/tags/ui/add_tag_error_modal.dart +++ b/lib/screens/tags/ui/add_tag_error_modal.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:linkdy/i18n/strings.g.dart'; class AddTagErrorModal extends StatelessWidget { - const AddTagErrorModal({Key? key}) : super(key: key); + const AddTagErrorModal({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/custom_list_tile.dart b/lib/widgets/custom_list_tile.dart index 30c9653..d92e2e3 100644 --- a/lib/widgets/custom_list_tile.dart +++ b/lib/widgets/custom_list_tile.dart @@ -14,7 +14,7 @@ class CustomListTile extends StatelessWidget { final Color? color; const CustomListTile({ - Key? key, + super.key, required this.title, this.subtitle, this.subtitleWidget, @@ -26,7 +26,7 @@ class CustomListTile extends StatelessWidget { this.disabled, this.onHover, this.color, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -76,20 +76,21 @@ class CustomListTile extends StatelessWidget { Text( subtitle!, style: TextStyle( - color: disabled == true - ? Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.38) - : Theme.of(context).colorScheme.onSurfaceVariant, - fontSize: 14, - fontWeight: FontWeight.w400), + color: disabled == true + ? Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.38) + : Theme.of(context).colorScheme.onSurfaceVariant, + fontSize: 14, + fontWeight: FontWeight.w400, + ), ), - ] + ], ], ), - ) + ), ], ), ), - if (trailing != null) ...[const SizedBox(width: 16), trailing!] + if (trailing != null) ...[const SizedBox(width: 16), trailing!], ], ), ), diff --git a/lib/widgets/custom_settings_tile.dart b/lib/widgets/custom_settings_tile.dart index 76efb21..ee78fbc 100644 --- a/lib/widgets/custom_settings_tile.dart +++ b/lib/widgets/custom_settings_tile.dart @@ -60,18 +60,19 @@ class CustomSettingsTile extends StatelessWidget { Text( subtitle!, style: TextStyle( - color: Theme.of(context).listTileTheme.textColor, - fontSize: 14, - fontWeight: FontWeight.w400), + color: Theme.of(context).listTileTheme.textColor, + fontSize: 14, + fontWeight: FontWeight.w400, + ), ), - ] + ], ], ), - ) + ), ], ), ), - if (trailing != null) ...[const SizedBox(width: 10), trailing!] + if (trailing != null) ...[const SizedBox(width: 10), trailing!], ], ); @@ -84,12 +85,14 @@ class CustomSettingsTile extends StatelessWidget { borderRadius: BorderRadius.circular(28), onTap: onTap, child: Container( - width: double.maxFinite, - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(28), - color: thisItem == selectedItem ? Theme.of(context).colorScheme.primaryContainer : null), - child: tileBody), + width: double.maxFinite, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(28), + color: thisItem == selectedItem ? Theme.of(context).colorScheme.primaryContainer : null, + ), + child: tileBody, + ), ), ), ); diff --git a/lib/widgets/custom_switch_list_tile.dart b/lib/widgets/custom_switch_list_tile.dart index 84e65c5..8eb3875 100644 --- a/lib/widgets/custom_switch_list_tile.dart +++ b/lib/widgets/custom_switch_list_tile.dart @@ -25,13 +25,15 @@ class CustomSwitchListTile extends StatelessWidget { return Material( color: Colors.transparent, child: InkWell( - onTap: disabled != null && disabled == true - ? null - : () => onChanged(!value), + onTap: disabled != null && disabled == true ? null : () => onChanged(!value), child: Padding( - padding: padding ?? const EdgeInsets.only( - top: 12, left: 16, right: 18, bottom: 16 - ), + padding: padding ?? + const EdgeInsets.only( + top: 12, + left: 16, + right: 18, + bottom: 16, + ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -55,35 +57,33 @@ class CustomSwitchListTile extends StatelessWidget { : Theme.of(context).colorScheme.onSurface, ), ), - if (subtitle != null) ... [ + if (subtitle != null) ...[ const SizedBox(height: 5), SizedBox( - width: MediaQuery.of(context).size.width-110, + width: MediaQuery.of(context).size.width - 110, child: Text( subtitle!, style: TextStyle( fontSize: 14, color: disabled != null && disabled == true - ? Theme.of(context).listTileTheme.textColor!.withOpacity(0.38) - : Theme.of(context).listTileTheme.textColor + ? Theme.of(context).listTileTheme.textColor!.withOpacity(0.38) + : Theme.of(context).listTileTheme.textColor, ), ), ), - ] + ], ], ), ), const SizedBox(width: 16), Switch( - value: value, - onChanged: disabled != null && disabled == true - ? null - : onChanged, - ) + value: value, + onChanged: disabled != null && disabled == true ? null : onChanged, + ), ], ), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/enter_search_term_screen.dart b/lib/widgets/enter_search_term_screen.dart index f4a7d4e..d936791 100644 --- a/lib/widgets/enter_search_term_screen.dart +++ b/lib/widgets/enter_search_term_screen.dart @@ -4,9 +4,9 @@ class EnterSearchTermScreen extends StatelessWidget { final String message; const EnterSearchTermScreen({ - Key? key, + super.key, required this.message, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/error_screen.dart b/lib/widgets/error_screen.dart index 0ee0e97..55a5cdf 100644 --- a/lib/widgets/error_screen.dart +++ b/lib/widgets/error_screen.dart @@ -4,9 +4,9 @@ class ErrorScreen extends StatelessWidget { final String error; const ErrorScreen({ - Key? key, + super.key, required this.error, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/no_data_screen.dart b/lib/widgets/no_data_screen.dart index f8c0cea..650955f 100644 --- a/lib/widgets/no_data_screen.dart +++ b/lib/widgets/no_data_screen.dart @@ -4,9 +4,9 @@ class NoDataScreen extends StatelessWidget { final String message; const NoDataScreen({ - Key? key, + super.key, required this.message, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/page_transition.dart b/lib/widgets/page_transition.dart index 1735107..7042183 100644 --- a/lib/widgets/page_transition.dart +++ b/lib/widgets/page_transition.dart @@ -5,9 +5,9 @@ class PageTransition extends StatelessWidget { final Widget child; const PageTransition({ - Key? key, + super.key, required this.child, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/process_dialog.dart b/lib/widgets/process_dialog.dart index 3e7c74b..7e08f76 100644 --- a/lib/widgets/process_dialog.dart +++ b/lib/widgets/process_dialog.dart @@ -4,9 +4,9 @@ class ProcessDialog extends StatelessWidget { final String message; const ProcessDialog({ - Key? key, + super.key, required this.message, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -29,7 +29,7 @@ class ProcessDialog extends StatelessWidget { message, style: TextStyle(color: Theme.of(context).colorScheme.onSurface), ), - ) + ), ], ), ), diff --git a/lib/widgets/section_label.dart b/lib/widgets/section_label.dart index 7c0f285..26a31a8 100644 --- a/lib/widgets/section_label.dart +++ b/lib/widgets/section_label.dart @@ -5,10 +5,10 @@ class SectionLabel extends StatelessWidget { final EdgeInsets? padding; const SectionLabel({ - Key? key, + super.key, required this.label, this.padding, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/sliver_tab_body.dart b/lib/widgets/sliver_tab_body.dart index ccb88dc..10b41bb 100644 --- a/lib/widgets/sliver_tab_body.dart +++ b/lib/widgets/sliver_tab_body.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class SliverTabBody extends StatelessWidget { final Widget child; - const SliverTabBody({Key? key, required this.child}) : super(key: key); + const SliverTabBody({super.key, required this.child}); @override Widget build(BuildContext context) { @@ -28,10 +28,10 @@ class SliverTabBodyRefresh extends StatelessWidget { final Future Function() onRefresh; const SliverTabBodyRefresh({ - Key? key, + super.key, required this.child, required this.onRefresh, - }) : super(key: key); + }); @override Widget build(BuildContext context) {