osom_rating 0.0.1 osom_rating: ^0.0.1 copied to clipboard
A new flutter plugin project.
import 'package:flutter/material.dart';
import 'package:osom_rating/osom_rating.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
double ratingValue = 3.45;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Osom Rating Demo'),
),
body: OsomRating(
rating: ratingValue,
sizeStar: 60,
colorStar: Colors.blue,
colorEmptyStar: Colors.red,
minimunHalfValue: 4,
totalStars: 5,
onTapped: (currentRating) {
setState(() {
this.ratingValue = currentRating;
});
},
onDoubleTapped: () {
setState(() {
this.ratingValue = 0;
});
},
),
),
);
}
}