🐱 Catto 🐱
Purr-fect random cat memes for your Flutter app! A widget that displays hilarious cat memes with just one line of code. Tap to get a new meme!
✨ Features
- Random cat memes on demand
- Tap to refresh for endless laughs
- Fully customizable size and appearance
- Built-in error handling with retry option
- Lightweight and easy to integrate
- Works offline (with cached images)
🚀 Installation
Add this to your pubspec.yaml:
dependencies:
catto: ^0.0.1
Then run:
flutter pub get
🐾 Usage
Basic Usage
import 'package:catto/catto.dart';
// In your widget tree:
CattoWidget(
width: 300,
height: 300,
)
Advanced Usage
CattoWidget(
width: double.infinity,
height: 200,
fit: BoxFit.cover,
controller: CattoController(
repository: CattoRepository(
apiUrl: 'https://your.custom.cat.api',
),
),
)
🎨 Customization
| Parameter | Type | Description | Default |
|---|---|---|---|
width |
double? |
Width of the widget | null (auto) |
height |
double? |
Height of the widget | null (auto) |
fit |
BoxFit |
How the image should be inscribed | BoxFit.cover |
controller |
CattoController? |
Custom controller for advanced usage | null |
apiUrl |
String? |
Custom API endpoint | TheCatAPI |
🐱👤 Examples
Simple Example
Scaffold(
appBar: AppBar(title: Text('Cat Memes!')),
body: Center(
child: CattoWidget(
width: 300,
height: 300,
),
),
)
Full Screen Example
Scaffold(
body: CattoWidget(
width: double.infinity,
height: double.infinity,
),
)
🏗️ Architecture
graph TD
A[CattoWidget] --> B[CattoController]
B --> C[CattoRepository]
C --> D[TheCatAPI]
🌟 Pro Tips
- Cache memes by combining with
cached_network_image - Add animations when new memes load
- Create a meme history by storing URLs
- Custom error widget by wrapping with your own error handler
🤝 Contributing
Purr-posals and paw-ll requests are welcome!
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
📜 License
MIT - Do whatever you want with this code (but be nice to cats 😸)
Made with ❤️ and 🐾 by RndmCodeGuy20
Warning: May cause excessive laughter and sudden urges to adopt all the cats.