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 '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:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -22,6 +11,18 @@ import 'package:intl/intl.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.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'; import 'models/authentication_data.dart';
void main() async { void main() async {
@ -31,6 +32,16 @@ void main() async {
debug: kDebugMode, debug: kDebugMode,
); );
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
systemStatusBarContrastEnforced: true,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
),
);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge, overlays: [SystemUiOverlay.top]);
await Hive.initFlutter(); await Hive.initFlutter();
final dateFormat = DateFormat.Hms(); 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(), child: const Home(),
),
) )
: LoginScreen( : LoginScreen(
onLoginSuccessful: (AuthenticationData authData) async { 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/friends/user_search.dart';
import 'package:recon/widgets/my_profile_dialog.dart'; import 'package:recon/widgets/my_profile_dialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -22,9 +21,6 @@ class _FriendsListAppBarState extends State<FriendsListAppBar> with AutomaticKee
super.build(context); super.build(context);
return AppBar( return AppBar(
title: const Text("ReCon"), title: const Text("ReCon"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
actions: [ actions: [
Consumer<MessagingClient>(builder: (context, client, _) { Consumer<MessagingClient>(builder: (context, client, _) {
return PopupMenuButton<OnlineStatus>( return PopupMenuButton<OnlineStatus>(

View file

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

View file

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

View file

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

View file

@ -219,6 +219,8 @@ class _MessageInputBarState extends State<MessageInputBar> {
.surfaceVariant, .surfaceVariant,
), ),
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
child: SafeArea(
top: false,
child: Column( child: Column(
children: [ children: [
if (_isSending && _sendProgress != null) if (_isSending && _sendProgress != null)
@ -228,7 +230,7 @@ class _MessageInputBarState extends State<MessageInputBar> {
color: Theme color: Theme
.of(context) .of(context)
.colorScheme .colorScheme
.background, .surfaceVariant,
), ),
child: AnimatedSwitcher( child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200), 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) { Widget build(BuildContext context) {
return AppBar( return AppBar(
title: const Text("Sessions"), title: const Text("Sessions"),
systemOverlayStyle: SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).navigationBarTheme.backgroundColor,
),
actions: [ actions: [
Padding( Padding(
padding: const EdgeInsets.only(right: 4.0), padding: const EdgeInsets.only(right: 4.0),

View file

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