Fix some issues
This commit is contained in:
@@ -315,7 +315,10 @@ func quickStart(dirChar *C.char, paramsChar *C.char, stateParamsChar *C.char, po
|
||||
bytes := []byte(C.GoString(paramsChar))
|
||||
stateParams := C.GoString(stateParamsChar)
|
||||
go func() {
|
||||
handleInitClash(dir)
|
||||
res := handleInitClash(dir)
|
||||
if res == false {
|
||||
bridge.SendToPort(i, "init error")
|
||||
}
|
||||
handleSetState(stateParams)
|
||||
bridge.SendToPort(i, handleUpdateConfig(bytes))
|
||||
}()
|
||||
|
||||
@@ -289,6 +289,7 @@ class ProfileItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final key = GlobalKey<CommonPopupBoxState>();
|
||||
return CommonCard(
|
||||
isSelected: profile.id == groupValue,
|
||||
onPressed: () {
|
||||
@@ -308,6 +309,7 @@ class ProfileItem extends StatelessWidget {
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: CommonPopupBox(
|
||||
key: key,
|
||||
popup: CommonPopupMenu(
|
||||
items: [
|
||||
ActionItemData(
|
||||
@@ -352,7 +354,9 @@ class ProfileItem extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
target: IconButton(
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
key.currentState?.pop();
|
||||
},
|
||||
icon: Icon(Icons.more_vert),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -99,6 +99,10 @@ Future<void> _service(List<String> flags) async {
|
||||
)
|
||||
.then(
|
||||
(res) async {
|
||||
if (res.isNotEmpty) {
|
||||
await vpn?.stop();
|
||||
exit(0);
|
||||
}
|
||||
await vpn?.start(
|
||||
clashLibHandler.getAndroidVpnOptions(),
|
||||
);
|
||||
|
||||
@@ -182,9 +182,6 @@ class CommonCard extends StatelessWidget {
|
||||
|
||||
return OutlinedButton(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
onLongPress: (){
|
||||
|
||||
},
|
||||
style: ButtonStyle(
|
||||
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
|
||||
shape: WidgetStatePropertyAll(
|
||||
|
||||
@@ -93,16 +93,14 @@ class CommonPopupBox extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
State<CommonPopupBox> createState() => _CommonPopupBoxState();
|
||||
State<CommonPopupBox> createState() => CommonPopupBoxState();
|
||||
}
|
||||
|
||||
class _CommonPopupBoxState extends State<CommonPopupBox> {
|
||||
final _targetKey = GlobalKey();
|
||||
class CommonPopupBoxState extends State<CommonPopupBox> {
|
||||
final _targetOffsetValueNotifier = ValueNotifier(Offset.zero);
|
||||
|
||||
_handleTargetOffset() {
|
||||
final renderBox =
|
||||
_targetKey.currentContext?.findRenderObject() as RenderBox?;
|
||||
final renderBox = context.findRenderObject() as RenderBox?;
|
||||
if (renderBox == null) {
|
||||
return;
|
||||
}
|
||||
@@ -111,29 +109,23 @@ class _CommonPopupBoxState extends State<CommonPopupBox> {
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Listener(
|
||||
onPointerDown: (details) {
|
||||
_handleTargetOffset();
|
||||
Navigator.of(context).push(
|
||||
CommonPopupRoute(
|
||||
barrierLabel: other.id,
|
||||
builder: (BuildContext context) {
|
||||
return widget.popup;
|
||||
},
|
||||
offsetNotifier: _targetOffsetValueNotifier,
|
||||
),
|
||||
);
|
||||
},
|
||||
key: _targetKey,
|
||||
child: LayoutBuilder(
|
||||
builder: (_, __) {
|
||||
return widget.target;
|
||||
pop() {
|
||||
_handleTargetOffset();
|
||||
Navigator.of(context).push(
|
||||
CommonPopupRoute(
|
||||
barrierLabel: other.id,
|
||||
builder: (BuildContext context) {
|
||||
return widget.popup;
|
||||
},
|
||||
offsetNotifier: _targetOffsetValueNotifier,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return widget.target;
|
||||
}
|
||||
}
|
||||
|
||||
class OverflowAwareLayoutDelegate extends SingleChildLayoutDelegate {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: fl_clash
|
||||
description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.
|
||||
publish_to: 'none'
|
||||
version: 0.8.73+202502021
|
||||
version: 0.8.74+202502031
|
||||
environment:
|
||||
sdk: '>=3.1.0 <4.0.0'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user