|
|
@@ -1,5 +1,6 @@ |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
import 'package:zhiying_comm/pages/login_page/login_page.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
@@ -16,7 +17,7 @@ class RouterUtil { |
|
|
|
return Future.error('skipIdentifier 参数不存在,无法跳转页面'); |
|
|
|
} |
|
|
|
print('skipIdentifier: ${skipModel.skipIdentifier}'); |
|
|
|
|
|
|
|
hideKeyboard(context); |
|
|
|
if (skipModel?.requiredLogin == '1') { |
|
|
|
UserInfoModel user = |
|
|
|
await Provider.of<UserInfoNotifier>(context, listen: false) |
|
|
@@ -62,4 +63,19 @@ class RouterUtil { |
|
|
|
model.url = url; |
|
|
|
RouterUtil.route(model, null, context); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void hideKeyboard(BuildContext context){ |
|
|
|
try { |
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context); |
|
|
|
if (!currentFocus.hasPrimaryFocus && |
|
|
|
currentFocus.focusedChild != null) { |
|
|
|
FocusManager.instance.primaryFocus.unfocus(); |
|
|
|
} |
|
|
|
// SystemChannels.textInput.invokeMethod('TextInput.hide'); |
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); |
|
|
|
}catch(e, s){ |
|
|
|
Logger.error(e,s); |
|
|
|
} |
|
|
|
} |
|
|
|
} |