How ramonsantospinto/nuclone works
Purpose and Entry Points
NuClone is a Flutter/Dart mobile portfolio app that recreates Nubank-style Home and Pix-send experiences using Clean Architecture. Flutter starts at lib/main.dart; platform hosts bootstrap the Flutter runtime through android/app/src/main/kotlin/br/com/nuclone/nuclone/MainActivity.kt and ios/Runner/AppDelegate.swift.
Composition and Shared Core
Application-wide wiring, error contracts, styling, and formatting live under lib/app/core/. The dependency container in lib/app/core/dependency_injection/injector.dart supplies repositories, use cases, and Cubits rather than letting presentation create concrete dependencies. Shared Failure types support explicit functional error paths, while theme files define the visual system.
Feature Boundaries
Features are vertically isolated under lib/app/feature/home/ and lib/app/feature/pix/, each divided into data, domain, and presentation. The intended dependency direction is presentation → domain abstractions/use cases; data implements domain repository contracts. This keeps UI state and infrastructure replaceable per feature.
Home Data Flow
Home rendering begins at lib/app/feature/home/presentation/pages/home_page.dart, driven by home_cubit.dart. The Cubit invokes get_account_data_usecase.dart, which depends on the repository interface at domain/repositories/home_repository.dart. data/repositories/home_repository_impl.dart adapts the available source, presently data/datasources/home_mock_datasource.dart, into domain entities such as account_entity.dart and transaction_entity.dart. Outcomes propagate as Either<Failure, Success> into loading, success, or error Cubit states.
Pix Transfer Flow
The Pix screen at lib/app/feature/pix/presentation/pages/pix_send_page.dart delegates submission state to pix_cubit.dart. It calls domain/usecases/send_pix_usecase.dart through the abstract pix_repository.dart; the current concrete boundary is data/repositories/pix_repository_impl.dart. Presentation consumes Pix state transitions and displays completion through presentation/widgets/pix_success_sheet.dart.
State and UI Boundary
flutter_bloc Cubits own asynchronous feature state; pages and widgets render state rather than access repositories directly. Home presentation is composed from feature widgets including presentation/widgets/home_header.dart and presentation/widgets/quick_actions.dart. This is a native Flutter UI, not a web/server application.
Runtime and External Services
Material runtimes are Flutter 3.x and Dart 3.x, packaged for Android via Gradle (android/app/build.gradle.kts) and iOS via Xcode (ios/Runner.xcodeproj/project.pbxproj). The repository tree exposes no backend client, persistence layer, or live banking/Pix integration: Home uses a mock datasource and Pix has a repository implementation boundary suitable for a future external service.
Main entry points: main.dart Flutter app entry · injector.dart Dependency injector · home_page.dart Home page · MainActivity.kt Android host
Components 20
Runtime Hosts
- Android host · Bootstraps the Flutter runtime on Android.
android/app/src/main/kotlin/br/com/nuclone/nuclone/MainActivity.kt - iOS host · Bootstraps the Flutter runtime on iOS.
ios/Runner/AppDelegate.swift - Flutter app entry
lib/main.dart
App Core
- Dependency injector · Supplies feature repositories, use cases, and Cubits.
lib/app/core/dependency_injection/injector.dart - Failure contracts · Supports explicit functional error results.
- Theme system
Home Feature
- Home page
lib/app/feature/home/presentation/pages/home_page.dart - Home UI widgets · Header and quick-action components render Home content.
- Home Cubit · Maps account loading outcomes to UI states.
- Get account data
- Home repository contract
- Home repository implementation
- Home mock datasource · Current source for account and transaction data.
- Account & transactions
Pix Feature
- Pix send page
lib/app/feature/pix/presentation/pages/pix_send_page.dart - Pix Cubit · Owns Pix submission state transitions.
- Send Pix
- Pix repository contract
- Pix repository implementation · Concrete boundary for a future Pix service.
- Pix success sheet · Displays transfer completion.
Connections 20
- Android host → Flutter app entry: launches
- iOS host → Flutter app entry: launches
- Flutter app entry → Dependency injector: composes
- Flutter app entry → Theme system: applies
- Dependency injector → Home Cubit: provides
- Dependency injector → Pix Cubit: provides
- Home page → Home Cubit: renders state
- Home page → Home UI widgets: composes
- Home Cubit → Get account data: invokes
- Get account data → Home repository contract: depends on
- Home repository implementation → Home repository contract: implements
- Home repository implementation → Home mock datasource: reads
- Home repository implementation → Account & transactions: maps to
- Home Cubit → Failure contracts: handles Either failures
- Pix send page → Pix Cubit: submits through
- Pix Cubit → Send Pix: invokes
- Send Pix → Pix repository contract: depends on
- Pix repository implementation → Pix repository contract: implements
- Pix Cubit → Pix success sheet: shows on completion
- Pix Cubit → Failure contracts: handles failures