simple_quotes_plus 1.0.1
simple_quotes_plus: ^1.0.1 copied to clipboard
A Dart package for accessing motivational, love, and wisdom quotes.lling and animation.
simple_quotes_plus #
A Dart package that provides structured access to quotes, organized by category, author, and text.
Features #
- Get a random quote
- Filter by category
- Search by keyword
- See all available categories
Example #
final repo = QuoteRepository();
print(repo.getRandom()); -->
### ✨ Features
- Vertical or horizontal stacked card scroll
- Custom card dimensions
- Initial page animation
- Clean parallax-like effect
## Demo
<!-- <img src="https://raw.githubusercontent.com/MhdFahid/simple_quotes_plus
simple_quotes_plus/main/example/doc/demo_cards.gif" style="width:400px;height:450px;">
``` -->
### 🚀 Installation
Add this to your `pubspec.yaml`:
```yaml
dependencies:
simple_quotes_plus: ^1.0.0
Then run:
flutter pub get
🛠️ Contributing #
Contributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/MhdMhdFahid/simple_quotes_plus simple_quotes_plus/issues) or submit a pull request.
📄 License #
This project is licensed under the MIT License.
MIT License
Copyright (c) 2025 Muhammed Fahid
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
👤 Maintainer #
MUHAMMED Fahid
- GitHub: [@MhdFahid](https://github.com/MhdFahid/simple_quotes_plus simple_quotes_plus)
💡 Usage #
class QuoteHomePage extends StatefulWidget {
const QuoteHomePage({super.key});
@override
State<QuoteHomePage> createState() => _QuoteHomePageState();
}
class _QuoteHomePageState extends State<QuoteHomePage> {
final QuoteRepository repo = QuoteRepository();
List<Quote> displayedQuotes = [];
String? selectedCategory;
String searchQuery = '';
@override
void initState() {
super.initState();
displayedQuotes = [repo.getRandom()];
}
void _filterByCategory(String? category) {
setState(() {
selectedCategory = category;
displayedQuotes = category == null
? repo.getAll()
: repo.getAll().where((q) => q.category == category).toList();
});
}
void _searchQuotes(String query) {
setState(() {
searchQuery = query;
displayedQuotes = repo.search(query);
});
}
@override
Widget build(BuildContext context) {
final categories = repo.getCategories();
return Scaffold(
appBar: AppBar(
title: const Text('Simple Quotes'),
bottom: PreferredSize(
preferredSize: const Size.fromHeight(56),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: TextField(
onChanged: _searchQuotes,
decoration: InputDecoration(
hintText: 'Search quotes...',
prefixIcon: const Icon(Icons.search),
filled: true,
fillColor: Colors.white,
contentPadding: const EdgeInsets.all(12),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
),
),
),
),
),
body: Column(
children: [
Wrap(
spacing: 8,
children: [
ChoiceChip(
label: const Text('All'),
selected: selectedCategory == null,
onSelected: (_) => _filterByCategory(null),
),
...categories.map((cat) => ChoiceChip(
label: Text(cat),
selected: selectedCategory == cat,
onSelected: (_) => _filterByCategory(cat),
)),
],
),
const SizedBox(height: 8),
Expanded(
child: ListView.builder(
itemCount: displayedQuotes.length,
itemBuilder: (context, index) =>
QuoteCard(quote: displayedQuotes[index]),
),
)
],
),
);
}
}