FRC2706 / 2024-2706-Robot-Code

Code for the 2024 game.
Other
2 stars 0 forks source link

[scout] Add team logo on home page #67

Open jwt2706 opened 7 months ago

jwt2706 commented 7 months ago

On the home page of the app (start.dart in the /lib/ folder), add the logo of the team beside the title "MergeData" on the top bar.

NOTE: To test run the app, you'll have to install the Flutter SDK. I can show you that in person. But you should be able to follow the steps here without that for now.

Steps you'll have to do:

  1. Clone the repo. Go on the dev branch and THEN make a new branch.
  2. Get an image of our team logo and put it in the /assets/images/ folder.
  3. Find the pubspec.yaml file and open it.
  4. Scroll down to like line ~80 or something and here you'll find how we reference other images. This tells the app which images to load. Add the path to your new image in there. Save.
  5. Then, find the start.dart file in the /lib/screens/ folder. The /lib/ folder contains all our source code for the app (like /src/ in the robot code repo).
  6. Then, open start.dart. Locate lines 52, 53, and 54. This is where we will make our change. As you can see, we have the title have some text using the Text() function. We want to add a second function to this, that be, and image function. What we'll use for this is:
    Image.asset("here/put/the/path/to/your/image.png", height: the-height-you-want, weight: the-weight-you-want)

    Make sure to change the values in the parameters to what you need them to be.

  7. There's one thing left to do. We need to tell the app to use BOTH the text AND the image. Here's how we do it:
    title: Row(
            children: [
              Image.asset(...),
              Text(...),
            ]
          )

    So here, we're telling the app to put both the image and the text in a row. The row is one object, and it has two children (the image and the text). And the Row() function will put them both side by side, like we want.

  8. yay

BONUS: add the current year using widget.year.toString() to the title