flutter_background_wraper
flutter_background_wraper is a powerful Flutter package that streamlines the creation of consistent, professional-looking app screens. It eliminates boilerplate code by combining app bar, background management, state handling, and navigation elements into a single, easy-to-use widget.
Whether you're building a simple list view or a complex multi-tab screen, this package provides everything you need to create consistent, feature-rich page layouts throughout your application.
✨ Key Features
A customizable Flutter widget that provides a consistent page layout with built-in support for:
- AppBar with customizable title, back button, and actions
- Solid color or image backgrounds
- Bottom navigation bar and floating action button
- Scrollable/non-scrollable content
- Loading and error states with custom widgets
- Pull-to-refresh functionality
- Status bar customization
- Safe area handling
🚀 Installation
Add to your pubspec.yaml:
```yaml dependencies: flutter_background_wraper: ^1.0.2 ```
📖 Usage
Basic Example with Color Background
```dart import 'package:flutter_background_wraper/flutter_background_wraper.dart';
AppBackground.color( color: Colors.white, title: 'Home', child: ListView( children: ListTile(title: Text('Item 1')), ListTile(title: Text('Item 2')), , ), ) ```
Example with Image Background
```dart AppBackground.image( image: AssetImage('assets/bg.jpg'), title: 'Profile', child: Center(child: Text('Your content here')), ) ```
With All Features
```dart AppBackground.color( color: Colors.white54, title: 'FBW Example', appBarHeight: 50.0, actions: IconButton(icon: Icon(Icons.search), onPressed: () {}), IconButton(icon: Icon(Icons.notifications), onPressed: () {}), , bottomNavigationBar: BottomNavigationBar( items: BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'), BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'), , ), floatingActionButton: FloatingActionButton(onPressed: () {}), isRefresh: true, onRefresh: () async { /* Handle refresh */ }, isLoading: false, isError: false, child: MyContent(), ) ```
📚 Features
- Multiple Background Types: Use solid colors or image providers
- Flexible AppBar: Customize with title, back button, actions, and search
- State Management: Handle loading, error, and refresh states easily
- Bottom Navigation: Built-in support for bottom navigation bars
- Smooth Scrolling: Automatic content scrolling with safe area support
📝 License
📋 Requirements
- Flutter: >=2.18.0
- Dart: >=2.18.0
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.