mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +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
|
.read(dashbotWindowNotifierProvider
|
||||||
.notifier)
|
.notifier)
|
||||||
.togglePopped();
|
.togglePopped();
|
||||||
ref
|
|
||||||
.read(dashbotWindowNotifierProvider
|
|
||||||
.notifier)
|
|
||||||
.toggleActive();
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user