diff --git a/lib/phonebook/tools/constants.dart b/lib/phonebook/tools/constants.dart index d065a5a76..51a16b4b9 100644 --- a/lib/phonebook/tools/constants.dart +++ b/lib/phonebook/tools/constants.dart @@ -125,5 +125,6 @@ class PhonebookTextConstants { } class PhonebookColorConstants { + // Delete that class : -> secondaryContainer static const Color textDark = Color(0xFF1D1D1D); } diff --git a/lib/phonebook/ui/components/kinds_bar.dart b/lib/phonebook/ui/components/kinds_bar.dart index 3f8f48fe4..cd3f1f8ac 100644 --- a/lib/phonebook/ui/components/kinds_bar.dart +++ b/lib/phonebook/ui/components/kinds_bar.dart @@ -49,7 +49,9 @@ class KindsBar extends HookConsumerWidget { child: Text( item, style: TextStyle( - color: selected ? Colors.white : Colors.black, + color: selected + ? Theme.of(context).colorScheme.onSecondary + : Theme.of(context).colorScheme.onSurface, fontWeight: FontWeight.bold, ), ), diff --git a/lib/phonebook/ui/components/radio_chip.dart b/lib/phonebook/ui/components/radio_chip.dart index 5e8047274..68d8dbfb7 100644 --- a/lib/phonebook/ui/components/radio_chip.dart +++ b/lib/phonebook/ui/components/radio_chip.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +// This component seems to be used nowhere... + class RadioChip extends StatelessWidget { final bool selected; final String label; @@ -23,12 +25,16 @@ class RadioChip extends StatelessWidget { child: Text( label, style: TextStyle( - color: selected ? Colors.white : Colors.black, + color: selected + ? Theme.of(context).colorScheme.onSecondary + : Theme.of(context).colorScheme.onSurface, fontWeight: FontWeight.bold, ), ), ), - backgroundColor: selected ? Colors.black : Colors.grey.shade200, + backgroundColor: selected + ? Theme.of(context).colorScheme.secondary + : Theme.of(context).colorScheme.secondaryFixed, ), ), ); diff --git a/lib/phonebook/ui/components/text_input_dialog.dart b/lib/phonebook/ui/components/text_input_dialog.dart index 9d50fd1c8..423f8504e 100644 --- a/lib/phonebook/ui/components/text_input_dialog.dart +++ b/lib/phonebook/ui/components/text_input_dialog.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:myecl/phonebook/tools/constants.dart'; +// This component seems to be used nowhere... + class TextInputDialog extends HookConsumerWidget { const TextInputDialog({ super.key, @@ -24,9 +26,12 @@ class TextInputDialog extends HookConsumerWidget { return AlertDialog( title: Center( child: Container( - decoration: const BoxDecoration( - border: Border(bottom: BorderSide(color: Colors.black)), - color: Colors.white, + decoration: BoxDecoration( + border: Border( + bottom: + BorderSide(color: Theme.of(context).colorScheme.onSurface), + ), + color: Theme.of(context).colorScheme.surface, ), child: Text(title, style: const TextStyle(fontSize: 20)), ), diff --git a/lib/phonebook/ui/pages/association_page/association_page.dart b/lib/phonebook/ui/pages/association_page/association_page.dart index 733ebef5f..8a5ef53f6 100644 --- a/lib/phonebook/ui/pages/association_page/association_page.dart +++ b/lib/phonebook/ui/pages/association_page/association_page.dart @@ -123,18 +123,17 @@ class AssociationPage extends HookConsumerWidget { const EdgeInsets.symmetric(horizontal: 12, vertical: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - gradient: const RadialGradient( + gradient: RadialGradient( colors: [ - Color.fromARGB(255, 98, 98, 98), - Color.fromARGB(255, 27, 27, 27), + Theme.of(context).colorScheme.tertiary, + Theme.of(context).colorScheme.secondary, ], center: Alignment.topLeft, radius: 1.3, ), boxShadow: [ BoxShadow( - color: const Color.fromARGB(255, 27, 27, 27) - .withOpacity(0.3), + color: Theme.of(context).shadowColor, spreadRadius: 5, blurRadius: 10, offset: @@ -142,8 +141,10 @@ class AssociationPage extends HookConsumerWidget { ), ], ), - child: - const HeroIcon(HeroIcons.pencil, color: Colors.white), + child: HeroIcon( + HeroIcons.pencil, + color: Theme.of(context).colorScheme.onSecondary, + ), ), ), ), diff --git a/lib/phonebook/ui/pages/association_page/member_card.dart b/lib/phonebook/ui/pages/association_page/member_card.dart index e42b8df7b..61f710df7 100644 --- a/lib/phonebook/ui/pages/association_page/member_card.dart +++ b/lib/phonebook/ui/pages/association_page/member_card.dart @@ -69,7 +69,7 @@ class MemberCard extends HookConsumerWidget { shape: BoxShape.circle, boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.1), + color: Theme.of(context).shadowColor, spreadRadius: 5, blurRadius: 10, offset: const Offset(2, 3), @@ -107,10 +107,10 @@ class MemberCard extends HookConsumerWidget { ), Text( "(${member.member.name} ${member.member.firstname})", - style: const TextStyle( + style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16, - color: Color.fromARGB(255, 115, 115, 115), + color: Theme.of(context).colorScheme.tertiary, ), ), ], diff --git a/lib/phonebook/ui/pages/main_page/research_bar.dart b/lib/phonebook/ui/pages/main_page/research_bar.dart index 2707d4716..84edb593a 100644 --- a/lib/phonebook/ui/pages/main_page/research_bar.dart +++ b/lib/phonebook/ui/pages/main_page/research_bar.dart @@ -20,18 +20,18 @@ class ResearchBar extends HookConsumerWidget { }, focusNode: focusNode, controller: editingController, - cursorColor: PhonebookColorConstants.textDark, + cursorColor: Theme.of(context).colorScheme.secondaryContainer, decoration: InputDecoration( isDense: true, - suffixIcon: const Icon( + suffixIcon: Icon( Icons.search, - color: PhonebookColorConstants.textDark, + color: Theme.of(context).colorScheme.secondaryContainer, size: 30, ), - label: const Text( + label: Text( PhonebookTextConstants.research, style: TextStyle( - color: PhonebookColorConstants.textDark, + color: Theme.of(context).colorScheme.secondaryContainer, ), ), focusedBorder: UnderlineInputBorder( diff --git a/lib/phonebook/ui/pages/membership_editor_page/membership_editor_page.dart b/lib/phonebook/ui/pages/membership_editor_page/membership_editor_page.dart index dfd32f8a3..968e1606e 100644 --- a/lib/phonebook/ui/pages/membership_editor_page/membership_editor_page.dart +++ b/lib/phonebook/ui/pages/membership_editor_page/membership_editor_page.dart @@ -118,8 +118,12 @@ class MembershipEditorPage extends HookConsumerWidget { ), fillColor: rolesTagList.keys.first == tagKey && !isPhonebookAdmin - ? WidgetStateProperty.all(Colors.black) - : WidgetStateProperty.all(Colors.grey), + ? WidgetStateProperty.all( + Theme.of(context).colorScheme.secondary, + ) + : WidgetStateProperty.all( + Theme.of(context).colorScheme.tertiary, + ), onChanged: rolesTagList.keys.first == tagKey && !isPhonebookAdmin ? null @@ -154,9 +158,9 @@ class MembershipEditorPage extends HookConsumerWidget { const SizedBox(height: 50), WaitingButton( builder: (child) => AddEditButtonLayout( - colors: const [ - ColorConstants.gradient1, - ColorConstants.gradient2, + colors: [ + Theme.of(context).colorScheme.primaryContainer, + Theme.of(context).colorScheme.primaryFixed, ], child: child, ), @@ -164,10 +168,10 @@ class MembershipEditorPage extends HookConsumerWidget { !isEdit ? PhonebookTextConstants.add : PhonebookTextConstants.edit, - style: const TextStyle( + style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: Color.fromARGB(255, 255, 255, 255), + color: Theme.of(context).colorScheme.onPrimaryContainer, ), ), onTap: () async { diff --git a/lib/phonebook/ui/pages/membership_editor_page/search_result.dart b/lib/phonebook/ui/pages/membership_editor_page/search_result.dart index b9763f40d..d4cdd41c4 100644 --- a/lib/phonebook/ui/pages/membership_editor_page/search_result.dart +++ b/lib/phonebook/ui/pages/membership_editor_page/search_result.dart @@ -25,10 +25,10 @@ class SearchResult extends HookConsumerWidget { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - color: Colors.white, + color: Theme.of(context).colorScheme.surface, boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.1), + color: Theme.of(context).shadowColor, offset: const Offset(0, 1), blurRadius: 4, spreadRadius: 2,