- for Flutter Toast Message
- and the second one for rating bar
Url: https://pub.dev/packages/fluttertoast/install
With Flutter:
$ flutter pub add fluttertoast
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies: fluttertoast: ^8.2.2 Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Import it Now in your Dart code, you can use:
import 'package:fluttertoast/fluttertoast.dart';
import 'package:fluttertoast/fluttertoast.dart';
Future<bool?> _maxCart(message,len){ return Fluttertoast.showToast( msg: message, toastLength:len, gravity: ToastGravity.CENTER, timeInSecForIosWeb: 1, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 );
}
Url: https://pub.dev/packages/flutter_rating_bar/install
Run this command:
With Flutter:
$ flutter pub add flutter_rating_bar
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get ):
dependencies: flutter_rating_bar: ^4.0.1 Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Import it Now in your Dart code, you can use:
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
RatingBar.builder( initialRating: 3.5, minRating: 1, direction: Axis.horizontal, itemCount: 5, itemSize: 16, itemPadding: EdgeInsets.symmetric(horizontal: 5), itemBuilder: (context,index)=>( Icon(Icons.star,color: Colors.red,) ), onRatingUpdate: (index){}, ),
#ScreenShot: