Showing posts with label icon button. Show all posts
Showing posts with label icon button. Show all posts

Working with Elevated Button, Outlined Button, Icon Button, and Gesture Detector

 Code for the body section:


      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                print("You clicked the Elevated Button!");
              },
              style: ElevatedButton.styleFrom(
                backgroundColor: Colors.blue,
                foregroundColor: Colors.white,
                // shape: BeveledRectangleBorder(
                //   borderRadius: BorderRadius.circular(
                //     5.0,
                //   ),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(10.0),
                ),
              ),
              child: const Text(
                "Elevated Button",
              ),
            ),
            const SizedBox(
              height: 10.0,
            ),
            OutlinedButton(
              onPressed: () {
                print("You clicked the Outlined Button!");
              },
              style: OutlinedButton.styleFrom(
                foregroundColor: Colors.red,
                // shape: BeveledRectangleBorder(
                //   borderRadius: BorderRadius.circular(
                //     5.0,
                //   ),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(10.0),
                ),
              ),
              child: const Text(
                "Outlined Button",
              ),
            ),
            const SizedBox(
              height: 10.0,
            ),
            TextButton(
              onPressed: () {
                print("You clicked the Text Button");
              },
              style: TextButton.styleFrom(
                foregroundColor: Colors.green,
                textStyle: const TextStyle(
                  fontWeight: FontWeight.bold,
                ),
              ),
              child: const Text(
                "Text Button",
              ),
            ),
            const SizedBox(
              height: 10.0,
            ),
            IconButton(
              onPressed: () {
                print("You clicked the Icon Button!");
              },
              icon: const Icon(
                Icons.star,
                color: Colors.yellow,
                size: 50.0,
              ),
            ),
            GestureDetector(
              onTap: () {
                print("You clicked the image!");
              },
              onDoubleTap: () {
                print("You double clicked the image!");
              },
              onLongPress: () {
                print("You long pressed the image!");
              },
              child: Image.asset(
                "assets/images/bike.jpg",
                height: 100.0,
                width: 100.0,
              ),
            ),
          ],
        ),
      ),

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...