flutter_star 0.1.2 copy "flutter_star: ^0.1.2" to clipboard
flutter_star: ^0.1.2 copied to clipboard

outdated

You can create a star easily and decide how many angle or color of the star, even the fat and progress of the star.

example/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_star/flutter_star.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
          appBar: AppBar(),
          body: Center(
              child: Column(
            children: <Widget>[
              StarWidget(
                star: Star(
                    progress: 0.8, num: 5, fat: 0.6, fillColor: Colors.green),
              ),
              _buildStarScore(),
              _buildCustomRating()
            ],
          ))),
    );
  }

  Widget _buildStarScore() => StarScore(
    score: 4.8,
    star: Star(
        fillColor: Colors.tealAccent,
        emptyColor: Colors.grey.withAlpha(88)),
    tail: Column(
      children: <Widget>[
        Text("综合评分"),
        Text("4.8"),
      ],
    ),
  );

  Widget _buildCustomRating() => Column(
    children: <Widget>[
      CustomRating(onRating: (s) {
        print(s);
      }),
      CustomRating(
          max: 6,
          score: 3.0,
          star: Star(
              num: 12,
              fillColor: Colors.orangeAccent,
              fat: 0.6,
              emptyColor: Colors.grey.withAlpha(88)),
          onRating: (s) {
            print(s);
          }),
    ],
  );
}
16
likes
30
points
182
downloads

Publisher

verified publishertoly1994.com

Weekly Downloads

You can create a star easily and decide how many angle or color of the star, even the fat and progress of the star.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_star