scobro_foundation_flutter 0.0.6 copy "scobro_foundation_flutter: ^0.0.6" to clipboard
scobro_foundation_flutter: ^0.0.6 copied to clipboard

Platformweb

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 management
  • loading_animation_widget: ^1.3.0 - Loading animations
  • flutter_svg: ^2.1.0 - SVG support
  • http: ^1.3.0 - HTTP client
  • requests_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 #

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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.