londonappbrewery / quizzler-flutter-challenge-final

Completed version of the Quizzler project in the Complete Flutter Bootcamp
https://www.appbrewery.co
63 stars 137 forks source link

Row of Icons appears at the bottm #2

Open Effizjens opened 5 years ago

Effizjens commented 5 years ago

In final version of quizzler, the score row widget has no height befor choosing the first answer.

After the first answer is picked, the buttons and the question are pushed to the top a bit, so the row fits in the UI.

I solved this problem by adding a Sizedbox with a height of 24.0 to the empty scoreKeeper, but i am curious if there is a better solution.

piladzisi commented 5 years ago

Can you share a code snippet? I'm not sure how to add a Sizedbox to a list of icons.

Effizjens commented 5 years ago
static Widget placeholder = SizedBox(
    width: 1.0,
    height: 24.0,
  );

  List<Widget> scoreKeeper = [placeholder];

I changed the list to a list of widgets. Upon reset, instead of clearing the scorekeeper, I will set it to scoreKeeper = [placeholder];.

raviyadav5951 commented 5 years ago
static Widget placeholder = SizedBox(
    width: 1.0,
    height: 24.0,
  );

  List<Widget> scoreKeeper = [placeholder];

I changed the list to a list of widgets. Upon reset, instead of clearing the scorekeeper, I will set it to scoreKeeper = [placeholder];.

Scorekeeper should accept only Icons type in the list how you are able to add in scoreKeeper?

akhilksugathan commented 4 years ago

I used Expanded widget and set a flex for it. so it can reserve the place for it to show.