flutter_emoji_feedback 0.3.0 flutter_emoji_feedback: ^0.3.0 copied to clipboard
A fully customizable widget to receive feedback from your users. Can be used to get user's mood or evaluate experience (and more !)
import 'package:flutter/material.dart';
import 'package:flutter_emoji_feedback/flutter_emoji_feedback.dart';
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Example App',
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
EmojiFeedback(
initialRating: 5,
emojiPreset: handDrawnEmojiPreset,
labelTextStyle: Theme.of(context).textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w400),
onChanged: (value) {
// Show snackbar
ScaffoldMessenger.of(context)
..clearSnackBars()
..showSnackBar(SnackBar(content: Text('$value')));
},
)
],
),
),
),
);
}
}