Coder Social home page Coder Social logo

add-to-cart-flutter's Introduction

Add to Cart in flutter

Use this package as a library

Add two dependencies in your pubspec.yaml

  1. for Flutter Toast Message
  2. and the second one for rating bar

Url: https://pub.dev/packages/fluttertoast/install

Run this command:

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';

Example Code:

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 );

}

Use this package as a library

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';

Example Code:

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:

Screenshot_2 Screenshot_1

add-to-cart-flutter's People

Contributors

sajibmalek avatar

Stargazers

Sunjita Yesmin Bithy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.