Sayings
A lightweight Flutter library providing categorized quotes/sayings, supporting random retrieval by type and language.
δΈζη | English
β¨ Features
- π Weekly Quotes - Automatically displays corresponding weekday quotes
- π Multiple Categories - Life, work, music themed quotes
- π Multilingual Support - Chinese and English quotes
- π² Random Retrieval - Supports getting random quotes of any type
- β‘ High Performance - Built-in caching mechanism for fast loading
- π¦ Zero Dependencies - Pure Dart implementation
π¦ Installation
Add to your pubspec.yaml
:
dependencies:
sayings: ^0.0.6
Then run:
flutter pub get
Usage
Import
import 'package:sayings/sayings.dart';
Initialize
final sayingsPlugin = Sayings();
Get Random Saying
// Get random quote of any type
Saying randomSaying = sayingsPlugin.getRandomSaying(
type: SayingType.work,
language: Language.zh
);
// Get specific type of quote
Saying lifeSaying = sayingsPlugin.getRandomSaying(SayingType.life);
// Get quote content directly
String content = sayingsPlugin.getRandomSayingContent(SayingType.music);
Types
Supported quote types:
SayingType.week
- Weekday related quotesSayingType.life
- Life related quotesSayingType.work
- Work related quotesSayingType.music
- Music related quotes
License
MIT License - See LICENSE file.