Change AppBar colors to be consistent across the app

This commit is contained in:
Nutcake 2023-06-24 13:34:25 +02:00
parent 37a2aebce5
commit d855d7dda3
9 changed files with 70 additions and 94 deletions

View file

@ -18,6 +18,7 @@ import 'package:contacts_plus_plus/widgets/update_notifier.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
import 'package:hive_flutter/hive_flutter.dart';

View file

@ -51,7 +51,6 @@ class _FriendsListAppBarState extends State<FriendsListAppBar> with AutomaticKee
value: Provider.of<MessagingClient>(context, listen: false),
child: AppBar(
title: const Text("Contacts++"),
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
actions: [
FutureBuilder(
future: _userStatusFuture,
@ -199,13 +198,6 @@ class _FriendsListAppBarState extends State<FriendsListAppBar> with AutomaticKee
),
)
],
bottom: PreferredSize(
preferredSize: const Size.fromHeight(1),
child: Container(
height: 1,
color: Colors.black,
),
),
),
);
}

View file

@ -52,6 +52,7 @@ class _HomeState extends State<Home> {
color: Theme.of(context).colorScheme.background,
),
child: BottomNavigationBar(
backgroundColor: Theme.of(context).colorScheme.surface,
type: BottomNavigationBarType.fixed,
unselectedItemColor: Theme.of(context).colorScheme.onBackground,
selectedItemColor: Theme.of(context).colorScheme.primary,

View file

@ -52,7 +52,7 @@ class _MessagesListState extends State<MessagesList> with SingleTickerProviderSt
@override
Widget build(BuildContext context) {
final appBarColor = Theme.of(context).colorScheme.surfaceVariant;
final appBarColor = Theme.of(context).colorScheme.surface;
return Consumer<MessagingClient>(builder: (context, mClient, _) {
final friend = mClient.selectedFriend ?? Friend.empty();
final cache = mClient.getUserMessageCache(friend.id);
@ -79,15 +79,6 @@ class _MessagesListState extends State<MessagesList> with SingleTickerProviderSt
),
],
),
bottom: sessions.isNotEmpty && _sessionListOpen
? null
: PreferredSize(
preferredSize: const Size.fromHeight(1),
child: Container(
height: 1,
color: Colors.black,
),
),
actions: [
if (sessions.isNotEmpty)
AnimatedRotation(
@ -107,9 +98,6 @@ class _MessagesListState extends State<MessagesList> with SingleTickerProviderSt
)
],
scrolledUnderElevation: 0.0,
backgroundColor: appBarColor,
surfaceTintColor: Colors.transparent,
shadowColor: Colors.transparent,
),
body: Column(
children: [
@ -122,11 +110,11 @@ class _MessagesListState extends State<MessagesList> with SingleTickerProviderSt
? null
: Container(
constraints: const BoxConstraints(maxHeight: 64),
decoration: BoxDecoration(
color: appBarColor,
border: const Border(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: Colors.black),
)),
),
),
child: Stack(
children: [
ListView.builder(

View file

@ -35,19 +35,24 @@ class SessionPopup extends StatelessWidget {
FormattedText(session.formattedName, style: Theme.of(context).textTheme.titleMedium),
session.formattedDescription.isEmpty
? const Text("No description")
: FormattedText(session.formattedDescription, style: Theme.of(context).textTheme.labelMedium),
Text("Tags: ${session.tags.isEmpty ? "None" : session.tags.join(", ")}",
: FormattedText(session.formattedDescription,
style: Theme.of(context).textTheme.labelMedium),
Text(
"Tags: ${session.tags.isEmpty ? "None" : session.tags.join(", ")}",
style: Theme.of(context).textTheme.labelMedium,
softWrap: true,
),
Text("Access: ${session.accessLevel.toReadableString()}", style: Theme.of(context).textTheme.labelMedium),
Text("Access: ${session.accessLevel.toReadableString()}",
style: Theme.of(context).textTheme.labelMedium),
Text("Users: ${session.sessionUsers.length}", style: Theme.of(context).textTheme.labelMedium),
Text("Maximum users: ${session.maxUsers}", style: Theme.of(context).textTheme.labelMedium),
Text("Headless: ${session.headlessHost ? "Yes" : "No"}", style: Theme.of(context).textTheme.labelMedium),
Text("Headless: ${session.headlessHost ? "Yes" : "No"}",
style: Theme.of(context).textTheme.labelMedium),
],
),
),
if (session.sessionUsers.isNotEmpty) Expanded(
if (session.sessionUsers.isNotEmpty)
Expanded(
child: Scrollbar(
trackVisibility: true,
controller: userListScrollController,
@ -60,13 +65,21 @@ class SessionPopup extends StatelessWidget {
final user = session.sessionUsers[index];
return ListTile(
dense: true,
title: Text(user.username, textAlign: TextAlign.end,),
subtitle: Text(user.isPresent ? "Active" : "Inactive", textAlign: TextAlign.end,),
title: Text(
user.username,
textAlign: TextAlign.end,
),
subtitle: Text(
user.isPresent ? "Active" : "Inactive",
textAlign: TextAlign.end,
),
);
},
),
),
) else const Expanded(
)
else
const Expanded(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
@ -74,7 +87,10 @@ class SessionPopup extends StatelessWidget {
Icon(Icons.person_remove_alt_1_rounded),
Padding(
padding: EdgeInsets.all(16.0),
child: Text("No one is currently playing.", textAlign: TextAlign.center,),
child: Text(
"No one is currently playing.",
textAlign: TextAlign.center,
),
)
],
),
@ -114,11 +130,15 @@ class SessionPopup extends StatelessWidget {
class SessionTile extends StatelessWidget {
const SessionTile({required this.session, super.key});
final Session session;
@override
Widget build(BuildContext context) {
return TextButton(
style: TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onSurface,
),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => SessionView(session: session)));
},
@ -133,7 +153,10 @@ class SessionTile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FormattedText(session.formattedName),
Text("${session.sessionUsers.length.toString().padLeft(2, "0")}/${session.maxUsers.toString().padLeft(2, "0")} active users")
Text(
"${session.sessionUsers.length.toString().padLeft(2, "0")}/${session.maxUsers.toString().padLeft(2, "0")} active users",
style: Theme.of(context).textTheme.labelMedium?.copyWith(color: Theme.of(context).colorScheme.onSurface.withOpacity(.6)),
)
],
),
)

View file

@ -15,14 +15,6 @@ class _SessionListAppBarState extends State<SessionListAppBar> {
Widget build(BuildContext context) {
return AppBar(
title: const Text("Sessions"),
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
bottom: PreferredSize(
preferredSize: const Size.fromHeight(1),
child: Container(
height: 1,
color: Colors.black,
),
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 4.0),

View file

@ -48,20 +48,7 @@ class _SessionViewState extends State<SessionView> {
maxLines: 1,
style: Theme.of(context).textTheme.titleLarge,
),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(1),
child: Row(
children: [
Expanded(
child: Container(
width: double.infinity,
height: 1,
color: Colors.black,
),
),
],
),
),
scrolledUnderElevation: 0,
),
body: RefreshIndicator(
onRefresh: () async {

View file

@ -6,15 +6,7 @@ class SettingsAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
title: const Text("Settings"),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(1),
child: Container(
height: 1,
color: Colors.black,
),
),
);
}

View file

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.3.2+1
version: 1.4.1+1
environment:
sdk: '>=3.0.1'