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

View File

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

View File

@ -31,12 +31,9 @@ class MyTextField extends StatelessWidget {
borderSide: borderSide:
BorderSide(color: Theme.of(context).colorScheme.primary), BorderSide(color: Theme.of(context).colorScheme.primary),
), ),
fillColor: Theme.of(context).colorScheme.secondary,
filled: true, filled: true,
hintText: hintText, hintText: hintText,
hintStyle: TextStyle( ),
color: Theme.of(context).colorScheme.primary,
)),
), ),
); );
} }

View File

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

View File

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

View File

@ -36,21 +36,24 @@ class MatchedScreen extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// imageUrl cant be null or empty with NetworkImage
CircleAvatar( CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (currentUserImageUrl.isEmpty) backgroundImage: (currentUserImageUrl.isEmpty)
? null ? null
: NetworkImage(currentUserImageUrl), : NetworkImage(currentUserImageUrl),
radius: 50, radius: 50,
child: (currentUserImageUrl.isEmpty)
? const Icon(Icons.person, size: 50)
: null,
), ),
const SizedBox(width: 24), const SizedBox(width: 24),
CircleAvatar( CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (otherUserImageUrl.isEmpty) backgroundImage: (otherUserImageUrl.isEmpty)
? null ? null
: NetworkImage(otherUserImageUrl), : NetworkImage(otherUserImageUrl),
radius: 50, 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) ScaffoldMessenger.of(context)
.showSnackBar( .showSnackBar(
SnackBar( SnackBar(
content: Text(message), content: Text(
backgroundColor: Colors.red, message,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
backgroundColor: Theme.of(context).colorScheme.errorContainer,
//duration: Duration(seconds: 2), //duration: Duration(seconds: 2),
action: SnackBarAction( action: SnackBarAction(
label: 'Dismiss', label: 'Dismiss',
textColor: Theme.of(context).colorScheme.primary,
onPressed: () { onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).hideCurrentSnackBar();
_isSnackBarVisible = false; _isSnackBarVisible = false;

View File

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

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../components/my_drawer.dart'; import '../components/my_drawer.dart';
class HomePage extends StatelessWidget { class HomePage extends StatelessWidget {
@ -87,12 +86,15 @@ class HomePage extends StatelessWidget {
Icon( Icon(
icon, icon,
size: 50, size: 50,
color: Colors.white, color: Theme.of(context).colorScheme.surface,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
title, 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( body: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
margin: const EdgeInsets.all(25), margin: const EdgeInsets.all(25),

View File

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

View File

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

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) { void showErrorSnackBar(BuildContext context, String message) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(message), content: Text(
backgroundColor: Colors.red, message,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
backgroundColor: Theme.of(context).colorScheme.errorContainer,
action: SnackBarAction( action: SnackBarAction(
label: 'Dismiss', label: 'Dismiss',
textColor: Theme.of(context).colorScheme.primary,
onPressed: () { onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).hideCurrentSnackBar();
}, },