带有Firestore图片崩溃的flutter_markdown

时间:2019-07-08 14:10:32

标签: firebase flutter

我正在使用flutter_markdown: ^0.2.0,并且想要显示保存在Firebase仓库中的图像。

如果我尝试在flutter小部件中显示降价标记:


class LessonScreen extends StatelessWidget {
  const LessonScreen({this.lesson});
  final Lesson lesson;

  @override
  Widget build(BuildContext context) {    
    return Scaffold(
      body:     
     MarkdownBody(data: lesson.content));
  }
}

我的应用程序崩溃。

I/flutter (25385): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (25385): The following _Exception was thrown resolving an image codec:
I/flutter (25385): Exception: HTTP request failed, statusCode: 403,
I/flutter (25385): https://firebasestorage.googleapis.com/v0/b/appname-db7de.appspot.com/o/image1.PNG?alt=media&token=xxxx

我在其他图像上没有这个问题,但仅在消防存储中保存了图像。

已解决

我已经看到无效的网址是:

alt=media&token=xxxx

代替

alt=media&token=xxxx

这是linkflutter_markown存储库问题。

我希望此修补程序早晚可用

2 个答案:

答案 0 :(得分:0)

HTTP request failed, statusCode: 403表示身份验证错误。

您应该检查有关firebase store的更多详细信息。 这与markdown无关。

答案 1 :(得分:0)

  • 我遇到了同样的问题,问题在于 Firebase Storage 中的权限,所以我更改了 Firebase Storage 权限。 来自
allow read, write: if request.auth != null;

为此

allow read, write;
相关问题