reorganize app colors
This commit is contained in:
@@ -21,6 +21,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:pretty_qr_code/pretty_qr_code.dart';
|
||||
|
||||
Future<void> showQrCode(BuildContext context, String data) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@@ -39,9 +40,9 @@ Future<void> showQrCode(BuildContext context, String data) {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
border: Border.all(color: colorScheme.outline),
|
||||
),
|
||||
child: PrettyQrView.data(
|
||||
data: data,
|
||||
|
||||
@@ -27,7 +27,6 @@ import 'package:graphview/GraphView.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:nullability/nullability.dart';
|
||||
import 'package:skeletonizer/skeletonizer.dart';
|
||||
import 'package:weblibre/core/design/app_colors.dart';
|
||||
import 'package:weblibre/core/routing/routes.dart';
|
||||
import 'package:weblibre/features/geckoview/domain/controllers/bottom_sheet.dart';
|
||||
import 'package:weblibre/features/geckoview/domain/providers/selected_tab.dart';
|
||||
@@ -83,7 +82,7 @@ class TabTreeDialog extends HookConsumerWidget {
|
||||
return Dialog.fullscreen(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.dialogOverlay,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
elevation: 0,
|
||||
leading: const CloseButton(),
|
||||
),
|
||||
|
||||
@@ -44,8 +44,8 @@ import 'package:weblibre/features/geckoview/features/browser/presentation/contro
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/controllers/tab_view_controllers.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_fab.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/draggable_fab.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_view.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/draggable_fab.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/sheets/view_tab.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/tab_view/tab_grid_view.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/tab_view/tab_list_view.dart';
|
||||
@@ -183,8 +183,9 @@ class _TabBar extends HookConsumerWidget {
|
||||
useOnStreamChange(
|
||||
pointerMoveEvents,
|
||||
onData: (event) {
|
||||
if (!ref.read(generalSettingsWithDefaultsProvider).autoHideTabBar)
|
||||
if (!ref.read(generalSettingsWithDefaultsProvider).autoHideTabBar) {
|
||||
return;
|
||||
}
|
||||
final diff = event.dy;
|
||||
if (diff < 0) {
|
||||
if (diffAcc.value > 0) {
|
||||
@@ -502,6 +503,7 @@ class _SheetContainer extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
// Memoize maxChildSize to prevent keyboard from affecting sheet size
|
||||
final stableMaxChildSize = useMemoized(() => relativeSafeArea, []);
|
||||
|
||||
@@ -520,7 +522,7 @@ class _SheetContainer extends HookConsumerWidget {
|
||||
ref.read(bottomSheetControllerProvider.notifier).requestDismiss();
|
||||
},
|
||||
child: ColoredBox(
|
||||
color: Colors.black54, // Scrim
|
||||
color: colorScheme.scrim,
|
||||
child: GestureDetector(
|
||||
onTap: () {}, // Prevent tap from propagating to parent
|
||||
child: Align(
|
||||
|
||||
+3
-2
@@ -34,6 +34,7 @@ class AppBarTitle extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = Theme.of(context);
|
||||
final appColors = AppColors.of(context);
|
||||
|
||||
final tabState = ref.watch(selectedTabStateProvider);
|
||||
final isTabTuneledAsync = ref.watch(isTabTunneledProvider(tabState?.id));
|
||||
@@ -108,9 +109,9 @@ class AppBarTitle extends HookConsumerWidget {
|
||||
icon,
|
||||
const SizedBox(width: 4),
|
||||
if (tabState.isPrivate) ...[
|
||||
const Icon(
|
||||
Icon(
|
||||
MdiIcons.dominoMask,
|
||||
color: AppColors.privateTabPurple,
|
||||
color: appColors.privateTabPurple,
|
||||
size: 14,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
|
||||
+5
-4
@@ -482,6 +482,7 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final appColors = AppColors.of(context);
|
||||
final selectedTabId = ref.watch(selectedTabProvider);
|
||||
|
||||
final tabStates = (switch (quickTabSwitcherMode) {
|
||||
@@ -521,11 +522,11 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
||||
child: Text(item.title),
|
||||
),
|
||||
if (item.isPrivate)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 8.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Icon(
|
||||
MdiIcons.dominoMask,
|
||||
color: AppColors.privateTabPurple,
|
||||
color: appColors.privateTabPurple,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
@@ -834,7 +835,7 @@ class NavigationMenuButton extends HookConsumerWidget {
|
||||
|
||||
return Badge(
|
||||
isLabelVisible: torConnected,
|
||||
backgroundColor: AppColors.torActiveGreen,
|
||||
backgroundColor: AppColors.of(context).torActiveGreen,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
|
||||
+4
-1
@@ -97,6 +97,7 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final initializationCompleter = useMemoized(() => Completer());
|
||||
|
||||
useOnInitialization(() async {
|
||||
@@ -313,7 +314,9 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
),
|
||||
if (!hasTab)
|
||||
Positioned.fill(
|
||||
child: SizedBox.expand(child: Container(color: Colors.grey[800])),
|
||||
child: SizedBox.expand(
|
||||
child: Container(color: colorScheme.surfaceContainerHighest),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+2
-1
@@ -41,6 +41,7 @@ class _TabDraggable extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final activeTab = ref.watch(selectedTabProvider);
|
||||
|
||||
final dragData = ref.watch(
|
||||
@@ -102,7 +103,7 @@ class _TabDraggable extends HookConsumerWidget {
|
||||
DeleteDropData() => Opacity(
|
||||
opacity: 0.3,
|
||||
child: ColorFiltered(
|
||||
colorFilter: const ColorFilter.mode(Colors.red, BlendMode.modulate),
|
||||
colorFilter: ColorFilter.mode(colorScheme.error, BlendMode.modulate),
|
||||
child: tab,
|
||||
),
|
||||
),
|
||||
|
||||
+15
-10
@@ -51,6 +51,7 @@ class GridTabItemContainer extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final appColors = AppColors.of(context);
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -62,7 +63,7 @@ class GridTabItemContainer extends StatelessWidget {
|
||||
),
|
||||
child: Material(
|
||||
color: isPrivate
|
||||
? AppColors.privateTabBackground
|
||||
? appColors.privateTabBackground
|
||||
: colorScheme.surfaceContainerHighest,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14.0)),
|
||||
child: child,
|
||||
@@ -97,6 +98,9 @@ class GridTabPreview extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final appColors = AppColors.of(context);
|
||||
|
||||
final tabState =
|
||||
ref.watch(
|
||||
tabStateWithFallbackProvider(
|
||||
@@ -127,7 +131,7 @@ class GridTabPreview extends HookConsumerWidget {
|
||||
tabState.titleOrAuthority,
|
||||
maxLines: 2,
|
||||
style: tabState.isPrivate
|
||||
? const TextStyle(color: Colors.white)
|
||||
? TextStyle(color: colorScheme.onSurface)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
@@ -178,13 +182,13 @@ class GridTabPreview extends HookConsumerWidget {
|
||||
child: Text(
|
||||
tabState.url.authority,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: tabState.isPrivate ? Colors.white : null,
|
||||
color: tabState.isPrivate ? colorScheme.onSurface : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (tabState.isPrivate) ...[
|
||||
const SizedBox(width: 6.0),
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
height: 16,
|
||||
width: 24,
|
||||
child: Stack(
|
||||
@@ -194,7 +198,7 @@ class GridTabPreview extends HookConsumerWidget {
|
||||
top: -4,
|
||||
child: Icon(
|
||||
MdiIcons.dominoMask,
|
||||
color: AppColors.privateTabPurple,
|
||||
color: appColors.privateTabPurple,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -259,6 +263,7 @@ class ListTabPreview extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final appColors = AppColors.of(context);
|
||||
|
||||
final tabState =
|
||||
ref.watch(
|
||||
@@ -272,7 +277,7 @@ class ListTabPreview extends HookConsumerWidget {
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: tabState.isPrivate ? AppColors.privateTabBackground : null,
|
||||
color: tabState.isPrivate ? appColors.privateTabBackground : null,
|
||||
border: isActive ? Border.all(color: colorScheme.primary) : null,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
|
||||
),
|
||||
@@ -297,15 +302,15 @@ class ListTabPreview extends HookConsumerWidget {
|
||||
tabState.titleOrAuthority,
|
||||
maxLines: 2,
|
||||
style: tabState.isPrivate
|
||||
? const TextStyle(color: Colors.white)
|
||||
? TextStyle(color: colorScheme.onSurface)
|
||||
: null,
|
||||
),
|
||||
subtitle: Row(
|
||||
children: [
|
||||
if (tabState.isPrivate) ...[
|
||||
const Icon(
|
||||
Icon(
|
||||
MdiIcons.dominoMask,
|
||||
color: AppColors.privateTabPurple,
|
||||
color: appColors.privateTabPurple,
|
||||
size: 14,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
@@ -314,7 +319,7 @@ class ListTabPreview extends HookConsumerWidget {
|
||||
child: UriBreadcrumb(
|
||||
uri: tabState.url,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: tabState.isPrivate ? Colors.white : null,
|
||||
color: tabState.isPrivate ? colorScheme.onSurface : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -55,6 +55,7 @@ class SearchScreen extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final appColors = AppColors.of(context);
|
||||
final formKey = useMemoized(() => GlobalKey<FormState>());
|
||||
|
||||
final createChildTabsOption = ref.watch(
|
||||
@@ -190,13 +191,13 @@ class SearchScreen extends HookConsumerWidget {
|
||||
TabType.regular => null,
|
||||
TabType.private => SegmentedButton.styleFrom(
|
||||
selectedBackgroundColor:
|
||||
AppColors.privateSelectionOverlay,
|
||||
appColors.privateSelectionOverlay,
|
||||
),
|
||||
TabType.child =>
|
||||
(currentTabTabType == TabType.private)
|
||||
? SegmentedButton.styleFrom(
|
||||
selectedBackgroundColor:
|
||||
AppColors.privateSelectionOverlay,
|
||||
appColors.privateSelectionOverlay,
|
||||
)
|
||||
: null,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user