feat: hide dashbot fab when dashbot is open

This commit is contained in:
Udhay-Adithya
2025-09-24 22:27:21 +05:30
parent 35fad1338a
commit 5149179d66
4 changed files with 5 additions and 23 deletions

View File

@@ -144,10 +144,6 @@ class DashbotWindow extends ConsumerWidget {
.read(dashbotWindowNotifierProvider .read(dashbotWindowNotifierProvider
.notifier) .notifier)
.togglePopped(); .togglePopped();
ref
.read(dashbotWindowNotifierProvider
.notifier)
.toggleActive();
}, },
), ),
IconButton( IconButton(

View File

@@ -87,10 +87,6 @@ class _DashbotTabState extends ConsumerState<DashbotTab>
.read(dashbotWindowNotifierProvider.notifier) .read(dashbotWindowNotifierProvider.notifier)
.togglePopped(); .togglePopped();
ref
.read(dashbotWindowNotifierProvider.notifier)
.toggleActive();
final newState = final newState =
ref.read(dashbotWindowNotifierProvider); ref.read(dashbotWindowNotifierProvider);
if (newState.isPopped) { if (newState.isPopped) {

View File

@@ -23,20 +23,6 @@ class DashbotHomePage extends ConsumerStatefulWidget {
class _DashbotHomePageState extends ConsumerState<DashbotHomePage> { class _DashbotHomePageState extends ConsumerState<DashbotHomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final hasOkResponse = ref.watch(
// selectedRequestModelProvider.select((req) =>
// req?.httpResponseModel?.statusCode != null &&
// req?.httpResponseModel?.statusCode == 200),
// );
// ref.listen(
// selectedRequestModelProvider,
// (current, next) {
// if (current?.id != next?.id) {
// Navigator.pop(context);
// }
// },
// );
return Container( return Container(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(

View File

@@ -21,6 +21,8 @@ class Dashboard extends ConsumerWidget {
ref.watch(settingsProvider.select((value) => value.isDashBotEnabled)); ref.watch(settingsProvider.select((value) => value.isDashBotEnabled));
final isDashBotActive = ref final isDashBotActive = ref
.watch(dashbotWindowNotifierProvider.select((value) => value.isActive)); .watch(dashbotWindowNotifierProvider.select((value) => value.isActive));
final isDashBotPopped = ref
.watch(dashbotWindowNotifierProvider.select((value) => value.isPopped));
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
child: Row( child: Row(
@@ -129,7 +131,9 @@ class Dashboard extends ConsumerWidget {
], ],
), ),
), ),
floatingActionButton: isDashBotEnabled && !isDashBotActive floatingActionButton: isDashBotEnabled &&
!isDashBotActive &&
isDashBotPopped
? FloatingActionButton( ? FloatingActionButton(
backgroundColor: Theme.of(context).colorScheme.primaryContainer, backgroundColor: Theme.of(context).colorScheme.primaryContainer,
onPressed: () => showDashbotWindow(context, ref), onPressed: () => showDashbotWindow(context, ref),