Fix visual issues with bottom navigation bar

This commit is contained in:
Nutcake 2023-10-10 10:57:14 +02:00
parent 1c77951431
commit 1bcebbacc8
8 changed files with 429 additions and 423 deletions

View file

@ -1,16 +1,5 @@
import 'dart:developer';
import 'package:recon/apis/github_api.dart';
import 'package:recon/client_holder.dart';
import 'package:recon/clients/api_client.dart';
import 'package:recon/clients/inventory_client.dart';
import 'package:recon/clients/messaging_client.dart';
import 'package:recon/clients/session_client.dart';
import 'package:recon/clients/settings_client.dart';
import 'package:recon/models/sem_ver.dart';
import 'package:recon/widgets/homepage.dart';
import 'package:recon/widgets/login_screen.dart';
import 'package:recon/widgets/update_notifier.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@ -22,6 +11,18 @@ import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:recon/apis/github_api.dart';
import 'package:recon/client_holder.dart';
import 'package:recon/clients/api_client.dart';
import 'package:recon/clients/inventory_client.dart';
import 'package:recon/clients/messaging_client.dart';
import 'package:recon/clients/session_client.dart';
import 'package:recon/clients/settings_client.dart';
import 'package:recon/models/sem_ver.dart';
import 'package:recon/widgets/homepage.dart';
import 'package:recon/widgets/login_screen.dart';
import 'package:recon/widgets/update_notifier.dart';
import 'models/authentication_data.dart';
void main() async {
@ -31,6 +32,16 @@ void main() async {
debug: kDebugMode,
);
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
systemStatusBarContrastEnforced: true,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
),
);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: [SystemUiOverlay.top]);
await Hive.initFlutter();
final dateFormat = DateFormat.Hms();
@ -168,7 +179,12 @@ class _ReConState extends State<ReCon> {
),
)
],
child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarColor: Theme.of(context).colorScheme.surfaceVariant,
),
child: const Home(),
),
)
: LoginScreen(
onLoginSuccessful: (AuthenticationData authData) async {

View file

@ -4,7 +4,6 @@ import 'package:recon/models/users/online_status.dart';
import 'package:recon/widgets/friends/user_search.dart';
import 'package:recon/widgets/my_profile_dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
@ -22,9 +21,6 @@ class _FriendsListAppBarState extends State<FriendsListAppBar> with AutomaticKee
super.build(context);
return AppBar(
title: const Text("ReCon"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
actions: [
Consumer<MessagingClient>(builder: (context, client, _) {
return PopupMenuButton<OnlineStatus>(

View file

@ -58,7 +58,9 @@ class _UserSearchState extends State<UserSearch> {
appBar: AppBar(
title: const Text("Find Users"),
),
body: Column(
body: SafeArea(
top: false,
child: Column(
children: [
Expanded(
child: FutureBuilder(
@ -131,6 +133,7 @@ class _UserSearchState extends State<UserSearch> {
),
],
),
),
);
}
}

View file

@ -61,16 +61,10 @@ class _InventoryBrowserAppBarState extends State<InventoryBrowserAppBar> {
? AppBar(
key: const ValueKey("default-appbar"),
title: const Text("Inventory"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
)
: AppBar(
key: const ValueKey("selection-appbar"),
title: Text("${iClient.selectedRecordCount} Selected"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
leading: IconButton(
onPressed: () {
iClient.clearSelectedRecords();

View file

@ -56,7 +56,7 @@ class _MessageAttachmentListState extends State<MessageAttachmentList> {
colors: [Colors.transparent, Colors.transparent, Colors.transparent, Theme
.of(context)
.colorScheme
.background
.surfaceVariant
],
stops: [0.0, 0.0, _showShadow ? 0.90 : 1.0, 1.0], // 10% purple, 80% transparent, 10% purple
).createShader(bounds);
@ -102,7 +102,7 @@ class _MessageAttachmentListState extends State<MessageAttachmentList> {
foregroundColor: Theme
.of(context)
.colorScheme
.onBackground,
.onSurfaceVariant,
side: BorderSide(
color: Theme
.of(context)
@ -245,7 +245,7 @@ class _MessageAttachmentListState extends State<MessageAttachmentList> {
) : const SizedBox.shrink(),
),
Container(
color: Theme.of(context).colorScheme.surface,
color: Theme.of(context).colorScheme.surfaceVariant,
child: IconButton(onPressed: () {
setState(() {
_popupIsOpen = !_popupIsOpen;

View file

@ -219,6 +219,8 @@ class _MessageInputBarState extends State<MessageInputBar> {
.surfaceVariant,
),
padding: const EdgeInsets.symmetric(horizontal: 4),
child: SafeArea(
top: false,
child: Column(
children: [
if (_isSending && _sendProgress != null)
@ -228,7 +230,7 @@ class _MessageInputBarState extends State<MessageInputBar> {
color: Theme
.of(context)
.colorScheme
.background,
.surfaceVariant,
),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
@ -565,6 +567,7 @@ class _MessageInputBarState extends State<MessageInputBar> {
],
),
),
),
);
}
}

View file

@ -16,9 +16,6 @@ class _SessionListAppBarState extends State<SessionListAppBar> {
Widget build(BuildContext context) {
return AppBar(
title: const Text("Sessions"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 4.0),

View file

@ -8,9 +8,6 @@ class SettingsAppBar extends StatelessWidget {
Widget build(BuildContext context) {
return AppBar(
title: const Text("Settings"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
);
}
}