Created
September 24, 2023 22:03
-
-
Save JudahSan/bb313a696ccf27513acbf5bb05c41c5b to your computer and use it in GitHub Desktop.
Flutter Haptic Feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
// Haptic feedback package import | |
import 'package:haptic_feedback/haptic_feedback.dart'; | |
import 'package:tms_app/models/series.dart'; | |
class SeriesGridItem extends StatelessWidget { | |
const SeriesGridItem({ | |
super.key, | |
required this.series, | |
}); | |
final Series series; | |
@override | |
Widget build(BuildContext context) { | |
return InkWell( | |
onTap: () {}, | |
splashColor: Colors.blueAccent, | |
highlightColor: Colors.blue, | |
// Add haptic feedback | |
// haptic_feedback: hapticFeedback.light, | |
child: Card( | |
elevation: 5, | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(10.0), | |
), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: [ | |
Icon( | |
series.iconData, | |
size: 54, | |
color: series.color, | |
), | |
const SizedBox(height: 20), | |
Text( | |
series.title, | |
style: const TextStyle( | |
fontSize: 15, | |
fontWeight: FontWeight.bold, | |
), | |
) | |
], | |
)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment