Showing posts with label showDialog function. Show all posts
Showing posts with label showDialog function. Show all posts

The Alert Dialog

 Code for showing the Alert Dialog when the OutlinedButton is clicked:


            OutlinedButton(
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (BuildContext context) {
                      return AlertDialog(
                        title: const Text(
                          "This is the title",
                          style: TextStyle(color: Colors.red),
                        ),
                        content: Column(
                          mainAxisSize: MainAxisSize.min,
                          children: [
                            Image.asset(
                              "assets/images/bike.jpg",
                              height: 100,
                              width: 100,
                            ),
                            const Text("This is the body of the dialog!"),
                          ],
                        ),
                        backgroundColor: Colors.green,
                        actions: [
                          ElevatedButton(
                            onPressed: () {
                              Navigator.pop(context);
                            },
                            child: const Text(
                              "CLOSE",
                            ),
                          ),
                          IconButton(
                            onPressed: () {},
                            icon: Icon(Icons.star),
                          ),
                        ],
                      );
                    });
              },
              style: OutlinedButton.styleFrom(
                foregroundColor: Colors.red,
                // shape: BeveledRectangleBorder(
                //   borderRadius: BorderRadius.circular(
                //     5.0,
                //   ),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(10.0),
                ),
              ),
              child: const Text(
                "Show Alert Dialog",
              ),
            ),

AI PILIPINO MUSIC

The YouTube channel  AI PILIPINO MUSIC   presents itself as a niche platform offering content that seems to span a unique blend of creativit...