user14709104
user14709104

Reputation:

flutter show text when button is pressed

I have a row with a text saying terms of use and a button. I want to show some data but perhaps I'm not using the correct keywords. All I'm getting is how to change a text on button click.

Anyway, what should I do to let the user see the terms of use on button click?

      Container(
        padding: EdgeInsets.only(top: 20),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text(
              "Terms of Use",
              style: TextStyle(
                color: Color(0xff18172b),
                fontSize: 18,
                fontFamily: "Poppins",
                fontWeight: FontWeight.w400,
              ),
            ),
            IconButton(
                iconSize: 18,
                onPressed: () {},
                icon: Icon(Icons.arrow_forward_ios))
          ],
        ),
      ),

Upvotes: 0

Views: 712

Answers (1)

Moaid ALRazhy
Moaid ALRazhy

Reputation: 1744

you can navigate to another page that hold the Terms or show modal like this :

            IconButton(
                iconSize: 18,
                onPressed: () async {
                  await showDialog(
                      barrierColor: Colors.black12.withOpacity(.6),
                      context: context,
                      builder: (_) {
                        return Dialog(
                          elevation: 0,
                          backgroundColor: Colors.transparent,
                          child: Container(
                            child: Text("TERMS"),
                          ),
                        );
                      });
                },
                icon: Icon(Icons.arrow_forward_ios))

Upvotes: 1

Related Questions