Adjusted ColorScheme: replaced custom grey with standard blue.

master
Rafael 2024-06-18 02:24:42 +02:00
parent 489f1139b5
commit 780d3cbbc2
13 changed files with 65 additions and 61 deletions

View File

@ -15,7 +15,6 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
final TextEditingController _feedbackController = TextEditingController();
final GlobalKey<FormState> _formKey = GlobalKey();
// get instance of firestore and auth
final FirebaseFirestore _firestore = FirebaseFirestore.instance;
final AuthService _authService = AuthService();
@ -53,24 +52,14 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
child: const Text('Cancel'),
onPressed: () => Navigator.pop(context),
),
TextButton(
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.secondary,
),
child: const Text(
'Send feedback',
style: TextStyle(
color: Colors.blue,
),
),
ElevatedButton(
child: const Text('Send feedback'),
onPressed: () async {
// Only if the input form is valid (the user has entered text)
if (_formKey.currentState!.validate()) {
String message;
bool error = false;
try {
// Get a reference to the feedbacks collection
final collection =
_firestore.collection(Constants.dbCollectionFeedbacks);
@ -90,10 +79,12 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
// Show a snackBar with the result
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message),
backgroundColor: error ? Colors.red : Colors.green,
));
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: error ? Colors.red : Colors.green,
),
);
Navigator.pop(context);
}
}

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'text_bold.dart';
class MyButton extends StatelessWidget {
final void Function()? onTap;
@ -16,13 +17,13 @@ class MyButton extends StatelessWidget {
onTap: onTap,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.all(16),
margin: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(text, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),),
child: TextBold(text: text),
),
),
);

View File

@ -23,20 +23,17 @@ class MyTextField extends StatelessWidget {
controller: controller,
focusNode: focusNode,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Theme.of(context).colorScheme.tertiary),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Theme.of(context).colorScheme.primary),
),
fillColor: Theme.of(context).colorScheme.secondary,
filled: true,
hintText: hintText,
hintStyle: TextStyle(
color: Theme.of(context).colorScheme.primary,
)),
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Theme.of(context).colorScheme.tertiary),
),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Theme.of(context).colorScheme.primary),
),
filled: true,
hintText: hintText,
),
),
);
}

View File

@ -26,7 +26,7 @@ class UserTileChats extends StatelessWidget {
onTap: onTap,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12),
),
margin: const EdgeInsets.symmetric(vertical: 5, horizontal: 25),

View File

@ -64,6 +64,7 @@ class _UserTileLikesState extends State<UserTileLikes> {
: null);
return Card(
color: Theme.of(context).colorScheme.onInverseSurface,
margin: const EdgeInsets.all(8.0),
child: ListTile(
leading: Column(

View File

@ -36,21 +36,24 @@ class MatchedScreen extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// imageUrl cant be null or empty with NetworkImage
CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (currentUserImageUrl.isEmpty)
? null
: NetworkImage(currentUserImageUrl),
radius: 50,
child: (currentUserImageUrl.isEmpty)
? const Icon(Icons.person, size: 50)
: null,
),
const SizedBox(width: 24),
CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (otherUserImageUrl.isEmpty)
? null
: NetworkImage(otherUserImageUrl),
radius: 50,
child: (otherUserImageUrl.isEmpty)
? const Icon(Icons.person, size: 50)
: null,
),
],
),

View File

@ -106,11 +106,18 @@ class ProfileCategoryFormState<T> extends State<ProfileCategoryForm<T>> {
ScaffoldMessenger.of(context)
.showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: Colors.red,
content: Text(
message,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
backgroundColor: Theme.of(context).colorScheme.errorContainer,
//duration: Duration(seconds: 2),
action: SnackBarAction(
label: 'Dismiss',
textColor: Theme.of(context).colorScheme.primary,
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
_isSnackBarVisible = false;

View File

@ -250,8 +250,9 @@ class EditProfilePageState extends State<EditProfilePage> {
right: 0,
child: IconButton(
icon: Ink(
padding: const EdgeInsets.all(4),
decoration: ShapeDecoration(
color: Theme.of(context).colorScheme.primary,
color: Theme.of(context).colorScheme.surfaceContainer,
shape: const CircleBorder(),
),
child: const Icon(Icons.camera_alt),

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import '../components/my_drawer.dart';
class HomePage extends StatelessWidget {
@ -87,12 +86,15 @@ class HomePage extends StatelessWidget {
Icon(
icon,
size: 50,
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
),
const SizedBox(height: 10),
Text(
title,
style: const TextStyle(color: Colors.white, fontSize: 20),
style: TextStyle(
color: Theme.of(context).colorScheme.surface,
fontSize: 20,
),
),
],
),

View File

@ -15,7 +15,7 @@ class SettingsPage extends StatelessWidget {
),
body: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12),
),
margin: const EdgeInsets.all(25),

View File

@ -1,11 +1,8 @@
import 'package:flutter/material.dart';
ThemeData darkMode = ThemeData(
colorScheme: ColorScheme.dark(
surface: Colors.grey.shade900,
primary: Colors.grey.shade600,
secondary: Colors.grey.shade700,
tertiary: Colors.grey.shade800,
inversePrimary: Colors.grey.shade300,
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: Colors.blue,
),
);
);

View File

@ -1,11 +1,8 @@
import 'package:flutter/material.dart';
ThemeData lightMode = ThemeData(
colorScheme: ColorScheme.light(
surface: Colors.grey.shade300,
primary: Colors.grey.shade500,
secondary: Colors.grey.shade200,
tertiary: Colors.white,
inversePrimary: Colors.grey.shade900,
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.light,
seedColor: Colors.blue,
),
);
);

View File

@ -19,14 +19,21 @@ void showMsg(BuildContext context, String title, String content) {
);
}
/// Show a red colored SnackBar with a [Dismiss] Button
/// Show an error colored SnackBar with a [Dismiss] Button
void showErrorSnackBar(BuildContext context, String message) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: Colors.red,
content: Text(
message,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
backgroundColor: Theme.of(context).colorScheme.errorContainer,
action: SnackBarAction(
label: 'Dismiss',
textColor: Theme.of(context).colorScheme.primary,
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
},