bugfix add bookmark bug

This commit is contained in:
DASHU
2024-09-18 13:39:24 +08:00
parent c1866a1a8b
commit c3076ee725
2 changed files with 8 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ class _IndexRouter extends CustState<IndexRouter>
showControl() {
bottomSheetController = _scaffoldKey.currentState!.showBottomSheet(
(context) {
return WebControlComponent();
return WebControlComponent(closeControl);
},
enableDrag: true,
showDragHandle: true,
@@ -94,13 +94,10 @@ class _IndexRouter extends CustState<IndexRouter>
bool closeAble = false;
try {
if (bottomSheetController != null) {
// bottomSheetController!.close();
closeAble = true;
RouterUtil.back(context);
}
} catch (e) {
print(e);
bottomSheetController!.close();
}
} catch (e) {}
bottomSheetController = null;
return closeAble;
}

View File

@@ -7,6 +7,10 @@ import 'package:nowser/util/router_util.dart';
import 'package:provider/provider.dart';
class WebControlComponent extends StatefulWidget {
Function closeControl;
WebControlComponent(this.closeControl);
@override
State<StatefulWidget> createState() {
return _WebControlComponent();
@@ -109,7 +113,7 @@ class _WebControlComponent extends State<WebControlComponent> {
var webInfo = webProvider.currentWebInfo();
if (webInfo != null) {
webProvider.addBookmark(webInfo);
RouterUtil.back(context);
widget.closeControl();
}
},
),