将 AzureAD SSO 集成到我的 Android 应用程序中。我已在 Azure 门户上注册了一个应用程序并auth_config.json根据该应用程序获取文件。按照文档中所述逐步实现示例代码。但出现以下错误。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.poras.testapp/com.poras.testapp.MainActivity}: java.lang.IllegalStateException: Intent filter for: BrowserTabActivity is missing. Please refer to the MSAL readme.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3086)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Caused by: java.lang.IllegalStateException: Intent filter for: BrowserTabActivity is missing. Please refer to the MSAL readme.
at com.microsoft.identity.client.PublicClientApplication.checkIntentFilterAddedToAppManifest(PublicClientApplication.java:1263)
Run Code Online (Sandbox Code Playgroud)
下面是我的应用程序的AndroidManifest.xml& auto.config.json。
<!--Intent filter to capture …Run Code Online (Sandbox Code Playgroud) android azure-active-directory azure-ad-graph-api azure-ad-msal
我有一个带有两个文本字段“ UserName”,“ Password”和一个按钮“ Login”的登录表单。点击登录按钮时,我正在调用API。我想CircularProgressIndicator在此api调用中显示一个。进度对话框应显示在登录表单的中央和顶部。我已经尝试过,FutureBuilder但是它只隐藏了登录表单CircularProgressIndicator。我希望屏幕的所有内容都显示在的后面CircularProgressIndicator。
完整代码:
import 'package:flutter/material.dart';
import 'package:the_don_flutter/userModel.dart';
import 'package:validate/validate.dart';
import 'package:http/http.dart' as http;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'signup.dart';
class Login extends StatefulWidget{
@override
State<Login> createState() {
// TODO: implement createState
return LoginFormState();
}
}
class LoginFormState extends State<Login>{
final GlobalKey<FormState> formKey = new GlobalKey<FormState>();
String _passwordValidation(String value){
if(value.isEmpty){
return "Field Can't be empty.";
}else if(value.length < 6)
return "Password must be of six characters long.";
return null; …Run Code Online (Sandbox Code Playgroud) 创建一个示例来学习Flutter. 这是一个简单的程序,可以增加 a 的 onTap 计数器GestureDetetor,但是,回调方法不起作用。热重载时计数会增加,但点击时不会增加。下面是带注释的代码。
class BoxState extends State<ChangeBoxState>{
int _counter = 0;
//Callback method changes the state onTap of GestureDetector widget. It is not calling onTap.
increaseCount(){
setState(() {
++_counter;
print(_counter);
});
}
@override
Widget build(BuildContext context) {
// Passing the callback method,"increaseCount()" to stateless class where GestureDetector is defined.
return BoxWidget(onPressed: increaseCount(), counter: _counter,);
}
}
Run Code Online (Sandbox Code Playgroud)
无状态类:
class BoxWidget extends StatelessWidget{
BoxWidget({this.onPressed, this.counter});
final VoidCallback onPressed;
final int counter;
@override
Widget build(BuildContext context) …Run Code Online (Sandbox Code Playgroud)