mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 02:39:19 +08:00
feat: hide dashbot fab when dashbot is open
This commit is contained in:
@@ -144,10 +144,6 @@ class DashbotWindow extends ConsumerWidget {
|
||||
.read(dashbotWindowNotifierProvider
|
||||
.notifier)
|
||||
.togglePopped();
|
||||
ref
|
||||
.read(dashbotWindowNotifierProvider
|
||||
.notifier)
|
||||
.toggleActive();
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
|
||||
@@ -87,10 +87,6 @@ class _DashbotTabState extends ConsumerState<DashbotTab>
|
||||
.read(dashbotWindowNotifierProvider.notifier)
|
||||
.togglePopped();
|
||||
|
||||
ref
|
||||
.read(dashbotWindowNotifierProvider.notifier)
|
||||
.toggleActive();
|
||||
|
||||
final newState =
|
||||
ref.read(dashbotWindowNotifierProvider);
|
||||
if (newState.isPopped) {
|
||||
|
||||
@@ -23,20 +23,6 @@ class DashbotHomePage extends ConsumerStatefulWidget {
|
||||
class _DashbotHomePageState extends ConsumerState<DashbotHomePage> {
|
||||
@override
|
||||
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(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
|
||||
@@ -21,6 +21,8 @@ class Dashboard extends ConsumerWidget {
|
||||
ref.watch(settingsProvider.select((value) => value.isDashBotEnabled));
|
||||
final isDashBotActive = ref
|
||||
.watch(dashbotWindowNotifierProvider.select((value) => value.isActive));
|
||||
final isDashBotPopped = ref
|
||||
.watch(dashbotWindowNotifierProvider.select((value) => value.isPopped));
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Row(
|
||||
@@ -129,7 +131,9 @@ class Dashboard extends ConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: isDashBotEnabled && !isDashBotActive
|
||||
floatingActionButton: isDashBotEnabled &&
|
||||
!isDashBotActive &&
|
||||
isDashBotPopped
|
||||
? FloatingActionButton(
|
||||
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
||||
onPressed: () => showDashbotWindow(context, ref),
|
||||
|
||||
Reference in New Issue
Block a user