Flutter Tutorials

Flutter app development tutorials


flutter – How to use InkResponse

main.dart


import 'package:flutter/material.dart';

void main() {
  runApp(
      MaterialApp(
          theme: ThemeData(primarySwatch: Colors.indigo),
          home: Scaffold(
              appBar: AppBar(
                  title: const Text("Flutter - InkResponse")
              ),
              body: bodyContent()
          )
      )
  );
}

bodyContent(){
  return Card(
      elevation: 8,
      margin: const EdgeInsets.all(16),
      child: InkResponse(
          onTap: (){
            // do something here
          },
          containedInkWell: true,
          child: const Padding(
              padding: EdgeInsets.all(12),
              child: Text("Lorem Ipsum is simply dummy text of the"
                  " printing and typesetting industry. Lorem Ipsum"
                  " has been the industry's standard dummy text ever"
                  " since the 1500s, when an unknown printer took"
                  " a galley of type and scrambled"
                  " it to make a type specimen book.",
                  style: TextStyle(fontSize: 17)
              )
          )
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started