mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
refactor: hide DashbotTab button in mobile devices
This commit is contained in:
@@ -4,8 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||||||
import '../../dashbot_dashboard.dart';
|
import '../../dashbot_dashboard.dart';
|
||||||
import '../providers/dashbot_window_notifier.dart';
|
import '../providers/dashbot_window_notifier.dart';
|
||||||
|
|
||||||
/// Optionally pass provider overrides (e.g., dashbotRequestContextProvider)
|
|
||||||
/// so the host app can feed live context into Dashbot.
|
|
||||||
void showDashbotWindow(BuildContext context, WidgetRef ref) {
|
void showDashbotWindow(BuildContext context, WidgetRef ref) {
|
||||||
final isDashbotActive = ref.read(dashbotWindowNotifierProvider).isActive;
|
final isDashbotActive = ref.read(dashbotWindowNotifierProvider).isActive;
|
||||||
final isDashbotPopped = ref.read(dashbotWindowNotifierProvider).isPopped;
|
final isDashbotPopped = ref.read(dashbotWindowNotifierProvider).isPopped;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'core/providers/dashbot_window_notifier.dart';
|
import 'core/providers/dashbot_window_notifier.dart';
|
||||||
import 'core/utils/show_dashbot.dart';
|
import 'core/utils/show_dashbot.dart';
|
||||||
|
import 'package:apidash/consts.dart';
|
||||||
|
|
||||||
class DashbotTab extends ConsumerStatefulWidget {
|
class DashbotTab extends ConsumerStatefulWidget {
|
||||||
const DashbotTab({super.key});
|
const DashbotTab({super.key});
|
||||||
@@ -78,6 +79,7 @@ class _DashbotTabState extends ConsumerState<DashbotTab>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
|
if (!kIsMobile) ...[
|
||||||
ADIconButton(
|
ADIconButton(
|
||||||
icon: Icons.close_fullscreen,
|
icon: Icons.close_fullscreen,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -94,8 +96,9 @@ class _DashbotTabState extends ConsumerState<DashbotTab>
|
|||||||
),
|
),
|
||||||
ADIconButton(
|
ADIconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final isActive =
|
final isActive = ref
|
||||||
ref.read(dashbotWindowNotifierProvider).isActive;
|
.read(dashbotWindowNotifierProvider)
|
||||||
|
.isActive;
|
||||||
|
|
||||||
ref
|
ref
|
||||||
.read(dashbotWindowNotifierProvider.notifier)
|
.read(dashbotWindowNotifierProvider.notifier)
|
||||||
@@ -109,6 +112,7 @@ class _DashbotTabState extends ConsumerState<DashbotTab>
|
|||||||
icon: Icons.close,
|
icon: Icons.close,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user