小编cmd*_*ter的帖子

如何将渐变作为背景添加到我的 flutter web 应用程序的主体中?

这是我尝试过的:

body: Container(
          height: MediaQuery.of(context).size.height,
         width: MediaQuery.of(context).size.width,
          decoration: BoxDecoration(
            gradient:
            LinearGradient(colors: [Color(0xFFc2e59c), Color(0xFF64b3f4)]),
          )
Run Code Online (Sandbox Code Playgroud)

我也尝试过不指定宽度和高度,但最终结果始终是一个不会完全填充主体的渐变 -

在此输入图像描述

flutter flutter-web

2
推荐指数
1
解决办法
6417
查看次数

找不到包“flutter_native_splash”。您是否忘记添加依赖项?

我正在使用flutter_native_splash包。我该如何修复这个错误?

\n\n

Pubspec.yaml -

\n\n
  cupertino_icons:\n\ndev_dependencies:\n  flutter_test:\n    sdk: flutter\n\nflutter_native_splash:\n image: assets/splash.png\n color: \xe2\x80\x9c6a1b9a\xe2\x80\x9d\n android: true\n fill: true\n\n# For information on the generic Dart part of this file, see the\n# following page: https://dart.dev/tools/pub/pubspec\n\n# The following section is specific to Flutter.\nflutter:\n
Run Code Online (Sandbox Code Playgroud)\n\n

错误:

\n\n
PS C:\\Users\\project> flutter pub pub run flutter_native_splash: create\nCould not find package "flutter_native_splash". Did you forget to add a dependency?\n
Run Code Online (Sandbox Code Playgroud)\n

yaml flutter

2
推荐指数
1
解决办法
7413
查看次数

标签 统计

flutter ×2

flutter-web ×1

yaml ×1