小编Ahm*_*ohy的帖子

Flutter 错误:错误状态:平台不允许不安全的 HTTP

当我运行与 HTTP URL 建立网络连接的 Flutter 应用程序时,出现错误: 错误状态:平台不允许使用不安全的 HTTP

每次使用 Dio 发出网络请求时,都会遇到这样的异常。

DioError [DioErrorType.DEFAULT]: Bad state: Insecure HTTP is not allowed by platform: <my_private_api_url>
Run Code Online (Sandbox Code Playgroud)

dart flutter

14
推荐指数
0
解决办法
1万
查看次数

Flutter:我收到此错误 &gt; 失败的断言:第 447 行 pos 12:'context != null':不是真的

我有一个返回alertDialog 的小部件,根据http 请求的结果,我显示另一个alertDialog。螺母我收到以下错误:

[错误:flutter/lib/ui/ui_dart_state.cc(157)] 未处理的异常:'package:flutter/src/widgets/localizations.dart':断言失败:第 447 行 pos 12:'context != null':不是真的。



import 'dart:io';

import 'package:Zabatnee/common_app/provider/user_details_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ForgetPasswordDialog extends StatefulWidget {
  static const routeName = '/customeDialog';
  final String title,description;
  

  ForgetPasswordDialog({
    this.title, 
    this.description,
    });

  @override
  _ForgetPasswordDialogState createState() => _ForgetPasswordDialogState();
}

class _ForgetPasswordDialogState extends State<ForgetPasswordDialog> {
final emailController = TextEditingController();
  var _isLoading = false;

_showDialog(String title, String message) {
    showDialog(
      barrierDismissible: false,
      context: context,
      builder: (ctx) => WillPopScope(
        onWillPop: () async => false,
        child: new AlertDialog(
          elevation: 15,
          shape: …
Run Code Online (Sandbox Code Playgroud)

provider https android-alertdialog dart flutter

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

dart ×2

flutter ×2

android-alertdialog ×1

https ×1

provider ×1