InkWell implementations

PHOTO EMBED

Mon Apr 29 2024 06:07:09 GMT+0000 (Coordinated Universal Time)

Saved by @salauddin01

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demoooooo',
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.cyan[100],
        appBar: AppBar(
          title: const Text("Flutter margin padding"),
          backgroundColor: Colors.blueAccent,
        ), //appbar
        body: Center(
          child: InkWell(
            onTap: () {
              print("Container is clicked");
            },
            onDoubleTap: () {
              print("container is double tapped");
            },
            child: Container(
              width: 200,
              height: 200,
              color: Colors.blueGrey,
              child:  Center(
                  child: InkWell(
                    onTap: (){
                      print("text is clicked");
                    },
                      child: const Text(
                "I am a container",
                style:
                    TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
              ))),
            ),
          ),
        ));
  }
}
content_copyCOPY