flutter_rating 0.0.1 copy "flutter_rating: ^0.0.1" to clipboard
flutter_rating: ^0.0.1 copied to clipboard

outdated

A flutter plugin that implements rating system.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_rating/flutter_rating.dart';
void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new Test(),
    );
  }
}
class Test extends StatefulWidget {
  @override
  _TestState createState() => new _TestState();
}

class _TestState extends State<Test> {
  double rating = 3.5;

   @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text("Star Rating"),
      ),
      body:new Column(
        children: <Widget>[
        new Padding(
          padding: EdgeInsets.all(50.0),
          child: new StarRating(
            rating: rating,
            color: Colors.orange,
            borderColor: Colors.grey,
            size: 50.0,
            starCount: 6,
            onRatingChanged: (rating) => setState(
              (){
                this.rating = rating;
              }
            )
          ),
        ),
        new Text("Your rating is: $rating", style: new TextStyle(fontSize: 30.0),),
        ],
      ),
    );
    
  }
}
11
likes
0
pub points
84%
popularity

Publisher

verified publisherunicorn.games

A flutter plugin that implements rating system.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_rating