improve bottom app bar
This commit is contained in:
@@ -228,8 +228,9 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
horizontal: 8.0,
|
horizontal: 8.0,
|
||||||
),
|
),
|
||||||
child: readerabilityState.when(
|
child: readerabilityState.when(
|
||||||
data: (_) => (isReaderable == true || readerableApplied)
|
data: (_) => Visibility(
|
||||||
? InkWell(
|
visible: isReaderable == true || readerableApplied,
|
||||||
|
child: InkWell(
|
||||||
onTap: readerabilityState.isLoading
|
onTap: readerabilityState.isLoading
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
@@ -248,8 +249,8 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: icon,
|
child: icon,
|
||||||
)
|
),
|
||||||
: const SizedBox.shrink(),
|
),
|
||||||
error: (error, stackTrace) => SizedBox.shrink(),
|
error: (error, stackTrace) => SizedBox.shrink(),
|
||||||
loading: () => AnimateGradientShader(
|
loading: () => AnimateGradientShader(
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
@@ -315,6 +316,7 @@ class KagiScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TabsActionButton(
|
TabsActionButton(
|
||||||
|
isActive: displayedSheet is ViewTabs,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (displayedSheet case ViewTabs()) {
|
if (displayedSheet case ViewTabs()) {
|
||||||
ref.read(bottomSheetProvider.notifier).dismiss();
|
ref.read(bottomSheetProvider.notifier).dismiss();
|
||||||
|
|||||||
@@ -3,12 +3,19 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:lensai/features/web_view/domain/repositories/web_view.dart';
|
import 'package:lensai/features/web_view/domain/repositories/web_view.dart';
|
||||||
|
|
||||||
class TabsActionButton extends HookConsumerWidget {
|
class TabsActionButton extends HookConsumerWidget {
|
||||||
|
final bool isActive;
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
|
|
||||||
const TabsActionButton({required this.onTap, super.key});
|
const TabsActionButton({
|
||||||
|
required this.onTap,
|
||||||
|
this.isActive = false,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
final tabCount =
|
final tabCount =
|
||||||
ref.watch(webViewRepositoryProvider.select((tabs) => tabs.length));
|
ref.watch(webViewRepositoryProvider.select((tabs) => tabs.length));
|
||||||
|
|
||||||
@@ -23,7 +30,9 @@ class TabsActionButton extends HookConsumerWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 2.0,
|
width: 2.0,
|
||||||
color: DefaultTextStyle.of(context).style.color!,
|
color: isActive
|
||||||
|
? theme.colorScheme.primary
|
||||||
|
: DefaultTextStyle.of(context).style.color!,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
),
|
),
|
||||||
@@ -31,9 +40,10 @@ class TabsActionButton extends HookConsumerWidget {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
tabCount.toString(),
|
tabCount.toString(),
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
|
color: isActive ? theme.colorScheme.primary : null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user