40 lines
1.0 KiB
Dart
40 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
|
|
|
class RatingEmote extends StatelessWidget {
|
|
const RatingEmote({super.key, required this.onRate});
|
|
|
|
final Function onRate;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return RatingBar.builder(
|
|
initialRating: 0,
|
|
itemCount: 3,
|
|
itemSize: 80,
|
|
itemBuilder: (context, index) {
|
|
switch (index) {
|
|
case 0:
|
|
return const Icon(
|
|
Icons.sentiment_very_dissatisfied,
|
|
color: Color.fromRGBO(236, 91, 91, 1.0),
|
|
);
|
|
case 1:
|
|
return const Icon(
|
|
Icons.sentiment_neutral,
|
|
color: Color.fromRGBO(236, 173, 91, 1.0),
|
|
);
|
|
case 2:
|
|
return const Icon(
|
|
Icons.sentiment_very_satisfied,
|
|
color: Color.fromRGBO(95, 175, 72, 1.0),
|
|
);
|
|
}
|
|
return const Icon(Icons.error);
|
|
},
|
|
|
|
onRatingUpdate: (rating) {},
|
|
);
|
|
}
|
|
}
|