languages

A collection of programs made with different programming languages.
git clone git://evanalba.com/languages
Log | Files | Refs

square_tile.dart (683B)


      1 import 'package:flutter/material.dart';
      2 
      3 class SquareTile extends StatelessWidget {
      4   final String imagePath;
      5   final Function()? onTap;
      6   const SquareTile({
      7     super.key,
      8     required this.imagePath,
      9     required this.onTap,
     10   });
     11 
     12   @override
     13   Widget build(BuildContext context) {
     14     return GestureDetector(
     15       onTap: onTap,
     16       child: Container(
     17         padding: const EdgeInsets.all(20),
     18         decoration: BoxDecoration(
     19           border: Border.all(color: Colors.black),
     20           borderRadius: BorderRadius.circular(16),
     21           color: Colors.black,
     22         ),
     23         child: Image.asset(
     24           imagePath,
     25           height: 40,
     26         ),
     27       ),
     28     );
     29   }
     30 }