Skip to content

Commit

Permalink
Phonebook: The non-admin half + some admin stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andrieu committed Jan 1, 2025
1 parent 79302ad commit e69b68f
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 30 deletions.
1 change: 1 addition & 0 deletions lib/phonebook/tools/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ class PhonebookTextConstants {
}

class PhonebookColorConstants {
// Delete that class : -> secondaryContainer
static const Color textDark = Color(0xFF1D1D1D);
}
4 changes: 3 additions & 1 deletion lib/phonebook/ui/components/kinds_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
Expand Down
10 changes: 8 additions & 2 deletions lib/phonebook/ui/components/radio_chip.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
),
),
);
Expand Down
11 changes: 8 additions & 3 deletions lib/phonebook/ui/components/text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)),
),
Expand Down
15 changes: 8 additions & 7 deletions lib/phonebook/ui/pages/association_page/association_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,28 @@ 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:
const Offset(3, 3), // changes position of shadow
),
],
),
child:
const HeroIcon(HeroIcons.pencil, color: Colors.white),
child: HeroIcon(
HeroIcons.pencil,
color: Theme.of(context).colorScheme.onSecondary,
),
),
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/phonebook/ui/pages/association_page/member_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
),
),
],
Expand Down
10 changes: 5 additions & 5 deletions lib/phonebook/ui/pages/main_page/research_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -154,20 +158,20 @@ 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,
),
child: Text(
!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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e69b68f

Please sign in to comment.