图像资产的大小在动画启动画面中没有改变

Size for image asset not changing in Animated Splash Screen

我正在尝试为应用创建动画启动画面。我已经使用 Image.asset() 在启动画面中插入了一个图像,但是当我输入任何高度或宽度数字时,图像根本没有改变。它仍然很小,但我希望它更大。

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: AnimatedSplashScreen(
          duration: 4000,
          splash:
          Image.asset("assets/icons/icon.png",
            height: 200),
          nextScreen: Homepage(title: "Travel Nepal",),
          splashTransition: SplashTransition.fadeTransition,
          backgroundColor: Color(0xffF99DC8),
      ),
    );
  }
}

图片大小:

我也使用了“适合:BoxFit.fill”属性,但图像突然变形或被截断。关于如何对此进行更改有什么建议吗?

显然,您可以使用 AimatedSplashScreen 小部件的 splashIconSize 属性。

https://github.com/clean-code-dev/animated_splash_screen/issues/18

AnimatedSplashScreen(
        duration: 3500,
        splash: 'assets/images/app_logo.png',
        splashIconSize: double.maxFinite,
        nextScreen: CompanyList(),
        centered: true,
        splashTransition: SplashTransition.rotationTransition,
        backgroundColor: Colors.white),
AnimatedSplashScreen(
splash: 'assets/images/Splashscreen.png',
splashIconSize: double.infinity,
splashTransition: SplashTransition.fadeTransition,
nextScreen: MainPage())