{"id":19233231,"url":"https://github.com/cevheri/flutter-bloc-advanced","last_synced_at":"2026-03-09T22:07:56.649Z","repository":{"id":199146616,"uuid":"702210009","full_name":"cevheri/flutter-bloc-advanced","owner":"cevheri","description":"Flutter Template : BLoC Pattern(Data, Models, Repository, Presentation), Environments, Configuration, Themes, IOS, Android and Web","archived":false,"fork":false,"pushed_at":"2026-03-09T13:40:07.000Z","size":19807,"stargazers_count":100,"open_issues_count":9,"forks_count":33,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-09T18:23:16.560Z","etag":null,"topics":["api-client","dart","flutter","flutter-bloc","flutter-web","internationalization","mock","state-management","unit-test"],"latest_commit_sha":null,"homepage":"https://cevheri.github.io/flutter-bloc-advanced/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cevheri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-08T20:06:27.000Z","updated_at":"2026-03-09T13:37:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"90bff83e-6978-4baf-a638-476e886b9158","html_url":"https://github.com/cevheri/flutter-bloc-advanced","commit_stats":null,"previous_names":["cevheri/flutter-bloc-advanced"],"tags_count":23,"template":true,"template_full_name":null,"purl":"pkg:github/cevheri/flutter-bloc-advanced","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevheri%2Fflutter-bloc-advanced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevheri%2Fflutter-bloc-advanced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevheri%2Fflutter-bloc-advanced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevheri%2Fflutter-bloc-advanced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cevheri","download_url":"https://codeload.github.com/cevheri/flutter-bloc-advanced/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cevheri%2Fflutter-bloc-advanced/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","dart","flutter","flutter-bloc","flutter-web","internationalization","mock","state-management","unit-test"],"created_at":"2024-11-09T16:09:23.888Z","updated_at":"2026-03-09T22:07:56.641Z","avatar_url":"https://github.com/cevheri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Flutter BLoC Template\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n[Wiki](https://deepwiki.com/cevheri/flutter-bloc-advanced)\n\n---\n\nA production-ready Flutter template built on BLoC architecture. Provides a solid foundation with authentication, role-based access control, user management, theming, internationalization, and multi-environment support (mock/API). Designed for scalable, maintainable applications targeting Android, iOS, Web, macOS, Linux, and Windows.\n\n---\n\n![img.png](assets/README_header.png)\n\n---\n\n## Tech Stack\n\n| Category | Technology |\n|---|---|\n| **Flutter** | 3.41.4 (Dart 3.11.1) |\n| **State Management** | flutter_bloc 9.1.1 |\n| **Routing** | go_router 17.1.0 |\n| **HTTP** | http 1.6.0 |\n| **Theming** | adaptive_theme 3.7.2 |\n| **Forms** | flutter_form_builder 10.3.0+2 |\n| **Localization** | intl 0.20.2 + intl_utils |\n| **Testing** | flutter_test, bloc_test 10.0.0, mockito 5.6.3 |\n\n## Features\n\n### Authentication\n- Login (username/password)\n- Register\n- Forgot Password\n- One Time Password (OTP) - Send and Verify\n\n### User Management\n- Create, Update, Delete, List users\n- Account view and update\n- Change password\n\n### Access Control\n- Role-based routing (Admin / User)\n- Public and private routes\n- Protected admin pages\n\n### UI/UX\n- Dark and light themes with adaptive_theme\n- Poppins font family\n- Responsive layout support\n- Internationalization (English, Turkish)\n- Dashboard with summary, activities, quick actions\n\n### Architecture\n- **BLoC Pattern** - Separation of data, business logic, and presentation\n- **Repository Pattern** - Abstracted data access layer\n- **Manual JSON Serialization** - No code generation required for models\n- **Multi-environment** - Local (mock data) and Production (real API)\n- **Multi-platform** - Android, iOS, Web, macOS, Linux, Windows\n\n---\n\n## Project Structure\n\n```\nlib/\n  configuration/       # App config, environment, storage, logging\n  data/\n    models/            # Data models with manual fromJson/toJson\n    repository/        # Repository implementations\n  generated/           # Localization generated files\n  l10n/                # Localization ARB files\n  main/                # Entry points (main_local.dart, main_prod.dart)\n  presentation/\n    common_blocs/      # Shared BLoCs (account, authority)\n    common_widgets/    # Reusable widgets (drawer, etc.)\n    design_system/     # Design tokens and components\n    screen/            # Feature screens with their BLoCs\n  routes/              # Navigation (go_router, navigator, get)\n  utils/               # Utility functions\n\ntest/\n  conf/                # Test configuration\n  data/model/          # Model unit tests\n  data/repository/     # Repository unit tests\n  presentation/blocs/  # BLoC unit tests\n  presentation/screen/ # Screen widget tests\n  presentation/widgets/# Widget unit tests\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- Flutter 3.41.4 (recommended via [FVM](https://fvm.app/documentation/getting-started/installation))\n- Dart 3.11.1\n- Android SDK (for Android builds)\n- Xcode (for iOS/macOS builds)\n\n### Install FVM\n\n```shell\n# macOS / Linux\nbrew tap leoafarias/fvm\nbrew install fvm\n\n# Windows\nchoco install fvm\n```\n\n### Setup\n\n```shell\ngit clone https://github.com/cevheri/flutter-bloc-advanced.git\ncd flutter-bloc-advanced\n\nfvm install 3.41.4\nfvm use 3.41.4\nfvm flutter pub get\n```\n\n---\n\n## Running the App\n\n### Local Environment (Mock Data)\n\nAll requests use mock data from `assets/mock/`. No backend required.\n\n```shell\n# Mobile\nfvm flutter run --target lib/main/main_local.dart\n\n# Web\nfvm flutter run -d chrome --target lib/main/main_local.dart\n\n# Web with specific port\nfvm flutter run -d chrome --web-port 3000 --target lib/main/main_local.dart\n```\n\n**Login credentials:**\n\n| Role | Username | Password | Access |\n|------|----------|----------|--------|\n| Admin | admin | admin | All pages |\n| User | user | user | Own profile, settings |\n\n### Production Environment (Real API)\n\nConnects to configured API endpoint.\n\n```shell\n# Mobile\nfvm flutter run --target lib/main/main_prod.dart\n\n# Web\nfvm flutter run -d chrome --target lib/main/main_prod.dart\n```\n\n---\n\n## Building\n\n```shell\n# Android APK\nfvm flutter build apk --target lib/main/main_prod.dart\n\n# iOS\nfvm flutter build ios --target lib/main/main_prod.dart\n\n# Web\nfvm flutter build web --target lib/main/main_prod.dart\n```\n\n---\n\n## Testing\n\n```shell\n# Run all tests\nfvm flutter test\n\n# Run with single thread (useful for debugging)\nfvm flutter test --concurrency=1 --test-randomize-ordering-seed=random\n```\n\n### Test Coverage\n\n| Layer | What is Tested |\n|-------|---------------|\n| **Models** | fromJson, toJson, equality, edge cases |\n| **Repositories** | API calls, error handling, mock responses |\n| **BLoCs** | State transitions, event handling, error states |\n| **Screens** | Widget rendering, user interactions, navigation |\n| **Widgets** | Reusable component behavior |\n\n---\n\n## Code Quality\n\n### Analyze\n\n```shell\nfvm dart analyze\n```\n\n### Fix\n\n```shell\nfvm dart fix --apply\n```\n\n### Format\n\n```shell\nfvm dart format . --line-length=120\n```\n\n### SonarQube\n\nGitHub Actions integration is configured. Add `SONAR_TOKEN` secret to your repository.\n\n---\n\n## Android Configuration\n\n| Component | Version |\n|---|---|\n| Gradle | 8.14 |\n| Android Gradle Plugin | 8.11.1 |\n| Kotlin | 2.2.20 |\n| Java Compatibility | 17 |\n| NDK | Dynamic (flutter.ndkVersion) |\n| Build Config | Kotlin DSL (.gradle.kts) |\n\n---\n\n## CI/CD\n\nGitHub Actions workflows:\n\n- **build_and_test.yml** - Build and test pipeline\n- **build-web.yml** - Web build pipeline\n- **sonar_scanner.yml** - SonarQube code quality analysis\n\n---\n\n## Adding New Features\n\n1. **Model** - Add to `lib/data/models/` with manual `fromJson`/`toJson` methods\n2. **Repository** - Add to `lib/data/repository/` implementing data access\n3. **BLoC** - Add to `lib/presentation/screen/\u003cfeature\u003e/bloc/` with events, states, and bloc\n4. **Screen** - Add to `lib/presentation/screen/\u003cfeature\u003e/`\n5. **Route** - Register in `lib/routes/go_router_routes/`\n6. **Mock Data** - Add JSON file to `assets/mock/` for local testing\n7. **Tests** - Add corresponding tests under `test/`\n\n---\n\n## Contributing\n\n1. Fork the repository\n2. Clone your forked repository\n3. Create your feature branch\n4. Commit your changes\n5. Push to the branch\n6. Create a Pull Request\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## References\n- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/cevheri/flutter-bloc-advanced)\n- [Understanding Flutter BLoC: A Comprehensive Guide](https://cevheri.medium.com/understanding-flutter-bloc-a-comprehensive-guide-7100dabe3975)\n- [Flutter Documentation](https://flutter.dev/)\n- [BLoC Library](https://bloclibrary.dev/)\n- [flutter_bloc on pub.dev](https://pub.dev/packages/flutter_bloc)\n- [go_router on pub.dev](https://pub.dev/packages/go_router)\n- [Upgrade Guide - Flutter 3.41.4](docs/upgrade_flutter_3.41.4.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcevheri%2Fflutter-bloc-advanced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcevheri%2Fflutter-bloc-advanced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcevheri%2Fflutter-bloc-advanced/lists"}