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.
Libraries
- authentication/auth_service
- authentication/commands/google_sign_in_command
- authentication/dtos/get_current_user_details_result
- authentication/dtos/google_sign_in_command
- authentication/dtos/user_login_command
- authentication/dtos/user_login_command_result
- authentication/google_sign_in_services
- authentication/queries/get_current_user_details_query
- authentication/user_login_screen
- authentication/user_login_view_model
- authentication/user_model
- authentication/user_service
- core_services/app_configuration_service
- core_services/app_initialization_service
- core_services/app_manager_service
- core_services/app_sections
- core_services/app_startup_service
- core_services/app_web_request_services
- core_services/core_services
- core_widgets/app_wrap
- core_widgets/screen_wrap
- events/event_bus
- events/operation_cancelled_event
- extensions/string_extensions
- framework/entity
- framework/event_broker
- framework/event_handler
- framework/event_handler_mappings
- framework/events/event_provider
- framework/events/event_scope_id_provider
- framework/events/pop_on_event_handler
- framework/events/view_model_events
- framework/loadable_state
- framework/mediator
- framework/mediator_mappings
- framework/mediator_request
- framework/mediator_result
- framework/request_handler
- framework/subscription_manager
- framework/typed_results
- framework/view_model_bases
- framework/view_state_base
- http/api_config
- http/dio_service
- http/dio_service_device
- http/dio_service_provider
- http/dio_service_web
- http/http
- http/paging_models
- http/query_string_builder
- http/web_request_handler
- http/web_request_response
- http/web_request_service
- http/web_requests
- scobro_foundation_flutter
- widgets/centered_message
- widgets/containers/card_options
- widgets/containers/loadable_state_container
- widgets/containers/loadable_state_container_v2
- widgets/containers/rich_card
- widgets/containers/shape_options
- widgets/containers/simple_box
- widgets/editors/basic_editor_page
- widgets/error_panel
- widgets/forms/command_form
- widgets/forms/form_cards_column
- widgets/forms/form_field_details
- widgets/forms/form_flows/flow_controller
- widgets/forms/form_flows/flow_state
- widgets/forms/form_flows/form_flow
- widgets/forms/form_flows/form_flow_data_controller
- widgets/forms/form_flows/form_flow_events
- widgets/forms/form_flows/form_flow_profile
- widgets/forms/form_flows/form_flow_request
- widgets/forms/form_flows/form_flow_scope
- widgets/forms/form_flows/form_flow_view_model
- widgets/forms/form_flows/form_flows
- widgets/forms/form_flows/step_panels/form_flow_panel
- widgets/forms/form_flows/step_panels/form_flow_panel_factory
- widgets/forms/form_flows/step_panels/simple_selection_list_panel
- widgets/forms/form_flows/step_panels/standard_form_panel
- widgets/forms/form_group_types/standard_form_group
- widgets/forms/form_layout_builder
- widgets/forms/form_profiles
- widgets/forms/form_row
- widgets/forms/form_row_grouping
- widgets/forms/form_row_item
- widgets/forms/inputs/input_factory
- widgets/forms/inputs/input_placeholder
- widgets/forms/inputs/mapped_field_inputs
- widgets/forms/inputs/search_input
- widgets/forms/inputs/text_input
- widgets/forms/inputs/text_input_options
- widgets/forms/map_producer
- widgets/forms/serializable
- widgets/framework/event_scope_container
- widgets/icon_map
- widgets/layout/column_container
- widgets/layout/conditional_view
- widgets/layout/constrained_centered
- widgets/layout/dialog_view
- widgets/layout/page_layout
- widgets/layout/parent_required
- widgets/layout/primary_header
- widgets/layout/responsive_layout_wrapper
- widgets/layout/scaffolding
- widgets/layout/tabbed_header
- widgets/layout/topics_and_details_view
- widgets/lists/list_container
- widgets/lists/list_pager
- widgets/lists/list_view_wrapper
- widgets/lists/rich_list_tile
- widgets/lists/search_request_list
- widgets/lists/search_request_list_generic
- widgets/lists/stack
- widgets/loading_panel
- widgets/menus/bottom_sheets
- widgets/rich_icon
- widgets/work_flows/work_flow
- widgets/work_flows/work_flow_state
- widgets/work_flows/work_flow_step_indicator