Last updated:
0 purchases
quotes
quotes #
Utility for working with quotes like motivational, entrepreneurial , love etc. and provides access to the top 500 English quotes as of now.
Usage #
Example
To use this package :
Add the dependency to your pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
quotes:
copied to clipboard
How to use #
// Import the Package
import 'package:quotes/quotes.dart';
//Then you can use it :
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: FlatButton(child: Text("CLICK"),onPressed: (){
//Getting the First quote that is same everytime
print(Quotes.getFirst().getId());
print(Quotes.getFirst().getContent());
print(Quotes.getFirst().getAuthor());
print(Quotes.getFirst().getAuthorId());
print(Quotes.getFirst().getTags());
print(Quotes.getFirst().getLength());
//Getting the Last quote that is same everytime
print(Quotes.getLast().getId());
print(Quotes.getLast().getContent());
print(Quotes.getLast().getAuthor());
print(Quotes.getLast().getAuthorId());
print(Quotes.getLast().getTags());
print(Quotes.getLast().getLength());
//Getting the random quote
print(Quotes.getRandom().getId());
print(Quotes.getRandom().getContent());
print(Quotes.getRandom().getAuthor());
print(Quotes.getRandom().getAuthorId());
print(Quotes.getRandom().getTags());
print(Quotes.getRandom().getLength());
},),
),
),
);
}
}
copied to clipboard
Pull Requests #
Every PRs are welcome , i will definitely look into and accept it.
Two things to PR on:
Adding more quotes to the library
For this you can add a files new_quotes.json in the data folder , i will review it and add it to main files.
Technical Addition
Can includes various other functions code like top authors , more written quotes author etc..
Created & Maintained By #
Rohan Prasad
Show some ❤️ and star the repo to support the project
Getting Started #
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.