Logo does not appear on the flutter inside the Gradient container

Asked

Viewed 33 times

-1

I’m trying to put my logo on the login page of my app, but I’m not getting it.

Obs.: I am beginner in language and I’m adapting to widgets.

return Scaffold(
  body: Center(
    child: Container(
      decoration: BoxDecoration(
          gradient: LinearGradient(
              begin: Alignment.topLeft,
              end: Alignment.bottomRight,
              colors: [
              Color(0xFF01ECFD),
              Color(0xFF009AFA),
          ])),
      child: Padding(
        padding: const EdgeInsets.all(36.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SizedBox(
              height: 155.0,
              child: Image.asset(
                "assets/logo.png",
                fit: BoxFit.contain,
              ),
            ),
            SizedBox(height: 45.0),
            emailField,
            SizedBox(height: 25.0),
            passwordField,
            SizedBox(
              height: 35.0,
            ),
            loginButton,
            SizedBox(
              height: 15.0,
            ),
          ],
        ),
      ),
    ),
  ),
);

1 answer

2


Did you set up this Assets path on Sey Yaml? I did a test here with your code and it worked.. I used any image here from my pc. inserir a descrição da imagem aqui

Every photo, font, package, that you need to add to your project, you need to add in your file, YAML. The yaml file itself comes commented several things ready for you to follow... take a look at it :) Ex: inserir a descrição da imagem aqui

Adding the Asset path to your yaml should probably work.

Light on our path!

  • It is worth mentioning that it is necessary to rotate flutter pub get direct from the terminal or use the corresponding button in the IDE (if it has).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.