mercredi 20 octobre 2021

I just want a preset text to be displayed in the middle of the app after pressing a button. The problem is that I can not connect it

      Padding(
        padding: EdgeInsets.only(top: 8),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            RawMaterialButton(
              onPressed: () {},

// After pressing this Button a _random Text should be show in the center. (with the AnswerGenerator)

              child: IconButton(
                icon: new Icon(Icons.add, size: 22,),
                color: Colors.white,
                onPressed: () {},
              ),

This "AnswerGenerator" generates one of these answers (in a box), after I pressed the button, one of these answers should be displayed in the box (column).

 abstract class AnswerGenerator {
   String getQuestion();
   String getDare();
   }
  class AnswerLocalGenerator implements AnswerGenerator {
  final Random _random = Random();
  final _questions = [
   "Answer2",
   "Answer3",
   "Answer4",
   "Answer5",
   ];



Aucun commentaire:

Enregistrer un commentaire