mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-19 02:24:21 +01:00
bugfix add bookmark bug
This commit is contained in:
@@ -80,7 +80,7 @@ class _IndexRouter extends CustState<IndexRouter>
|
|||||||
showControl() {
|
showControl() {
|
||||||
bottomSheetController = _scaffoldKey.currentState!.showBottomSheet(
|
bottomSheetController = _scaffoldKey.currentState!.showBottomSheet(
|
||||||
(context) {
|
(context) {
|
||||||
return WebControlComponent();
|
return WebControlComponent(closeControl);
|
||||||
},
|
},
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
showDragHandle: true,
|
showDragHandle: true,
|
||||||
@@ -94,13 +94,10 @@ class _IndexRouter extends CustState<IndexRouter>
|
|||||||
bool closeAble = false;
|
bool closeAble = false;
|
||||||
try {
|
try {
|
||||||
if (bottomSheetController != null) {
|
if (bottomSheetController != null) {
|
||||||
// bottomSheetController!.close();
|
|
||||||
closeAble = true;
|
closeAble = true;
|
||||||
RouterUtil.back(context);
|
bottomSheetController!.close();
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
print(e);
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {}
|
||||||
bottomSheetController = null;
|
bottomSheetController = null;
|
||||||
return closeAble;
|
return closeAble;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ import 'package:nowser/util/router_util.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class WebControlComponent extends StatefulWidget {
|
class WebControlComponent extends StatefulWidget {
|
||||||
|
Function closeControl;
|
||||||
|
|
||||||
|
WebControlComponent(this.closeControl);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
return _WebControlComponent();
|
return _WebControlComponent();
|
||||||
@@ -109,7 +113,7 @@ class _WebControlComponent extends State<WebControlComponent> {
|
|||||||
var webInfo = webProvider.currentWebInfo();
|
var webInfo = webProvider.currentWebInfo();
|
||||||
if (webInfo != null) {
|
if (webInfo != null) {
|
||||||
webProvider.addBookmark(webInfo);
|
webProvider.addBookmark(webInfo);
|
||||||
RouterUtil.back(context);
|
widget.closeControl();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user