scobro_foundation_flutter 0.0.6
scobro_foundation_flutter: ^0.0.6 copied to clipboard
Foundational widgets and classes for Flutter Development
Scobro Foundation Flutter #
A comprehensive foundational Flutter package that provides reusable widgets, services, and framework components to accelerate Flutter application development.
Features #
π Authentication #
- User Login Screen: Pre-built login interface with form validation
- Authentication Service: Centralized authentication management
- Authorized Widget: Wrapper for protecting authenticated content
- User Management: Complete user model and service layer
π HTTP & API Services #
- Web Request Service: Robust HTTP client with error handling
- API Configuration: Centralized API endpoint management
- Response Handling: Structured response processing with DTOs
π¨ UI Components #
- Layout Widgets: Responsive layout components including
ConstrainedCentered
- Loading Panels: Consistent loading states across the app
- Error Panels: Standardized error display and handling
- Workflow Components: Multi-step workflow management with progress indicators
- Menu Components: Bottom sheets and menu utilities
ποΈ Framework & Architecture #
- MVVM Framework: Base classes for ViewModels and ViewStates
- Riverpod Integration: Built-in state management with Riverpod
- App Services: Application lifecycle and initialization services
- Core Services: Centralized service management
π± Responsive Design #
- Layout Wrapper: Responsive layout system for different screen sizes
- Mobile/Tablet/Desktop: Optimized layouts for various devices
- Constrained Layouts: Width-constrained centered layouts
Getting Started #
Prerequisites #
- Flutter SDK ^3.6.1
- Dart SDK ^3.6.1
Installation #
Add this to your package's pubspec.yaml
file:
dependencies:
scobro_foundation_flutter: ^0.0.1
Dependencies #
This package includes the following dependencies:
flutter_riverpod: ^2.6.1
- State managementloading_animation_widget: ^1.3.0
- Loading animationsflutter_svg: ^2.1.0
- SVG supporthttp: ^1.3.0
- HTTP clientrequests_plus: ^4.8.6
- Enhanced HTTP requests
Usage #
Authentication #
import 'package:scobro_foundation_flutter/authentication/user_login_screen.dart';
// Use the pre-built login screen
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: UserLogin(),
);
}
}
Layout Components #
import 'package:scobro_foundation_flutter/widgets/layout/constrained_centered.dart';
// Create a centered, width-constrained layout
ConstrainedCentered(
width: 600,
child: Card(
child: Padding(
padding: EdgeInsets.all(16),
child: Text('Your content here'),
),
),
)
Loading and Error States #
import 'package:scobro_foundation_flutter/widgets/loading_panel.dart';
import 'package:scobro_foundation_flutter/widgets/error_panel.dart';
// Wrap content with loading and error handling
LoadingPanel(
isLoading: isLoading,
childBuilder: (context) => ErrorPanel(
viewModel: viewModel,
state: state,
child: YourContent(),
),
)
MVVM Framework #
import 'package:scobro_foundation_flutter/framework/view_model_bases.dart';
// Create a ViewModel
class MyViewModel extends ViewModelBase<MyViewState> {
@override
MyViewState build() => MyViewState();
Future<void> loadData() async {
await executeOperation(
() => apiService.getData(),
(result) => state = state.withData(result),
);
}
}
Workflow Components #
import 'package:scobro_foundation_flutter/widgets/work_flows/work_flow.dart';
// Create a multi-step workflow
final steps = [
WorkflowStep(
id: 'step1',
title: 'Step 1',
description: 'First step description',
shortTitle: 'Step 1',
contentBuilder: (context) => Step1Content(),
),
// ... more steps
];
WorkflowWidget(
state: workflowState,
viewModel: workflowViewModel,
steps: steps,
)
Project Structure #
lib/
βββ authentication/ # User authentication components
βββ core_services/ # Application lifecycle services
βββ core_widgets/ # Basic reusable widgets
βββ framework/ # MVVM framework base classes
βββ http/ # HTTP and API services
βββ widgets/ # UI components
βββ containers/ # Container widgets
βββ layout/ # Layout components
βββ lists/ # List-related widgets
βββ menus/ # Menu components
βββ work_flows/ # Workflow management
Additional Information #
Contributing #
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Issues and Support #
- Report bugs and feature requests through GitHub issues
- For questions and support, please open an issue with the appropriate label
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Version History #
See CHANGELOG.md for a complete version history.