Loading...
Loading...
Compare original and translation side by side
domainpackage:flutterPresentation -> Domain <- DataDataSourcesRepositoriesdomainpackage:flutter表示层 -> 领域层 <- 数据层数据源(DataSources,外部/原始数据)仓库(Repositories,领域层抽象)featureA/blocfeatureA/modelsfeatureA/viewscorecore/views/widgetsfeatureA/blocfeatureA/modelsfeatureA/viewscorecore/views/widgetsUI Event → BLoC (emit Loading) → Repository → DataSource (API/SDK)
↓
Response → Repository (map to Domain Entity) → BLoC (emit Success/Error) → UIUI Event → BLoC (emit Loading) → Repository → DataSource (API/SDK)
↓
Response → Repository (map to Domain Entity) → BLoC (emit Success/Error) → UIsealed class(String name, int age)if (value case final v?)if (value != null)finalinterfacebasesealedsealed class(String name, int age)if (value case final v?)if (value != null)finalinterfacebasesealedEither<Failure, T>Result<T>switchEither<Failure, T>Result<T>switchMethodChannelEventChannelplatform/static const channel = MethodChannel('com.app.feature/method')MethodChannelMissingPluginExceptiondefaultTargetPlatformMethodChannelEventChannelplatform/static const channel = MethodChannel('com.app.feature/method')MethodChannelMissingPluginExceptiondefaultTargetPlatformdart:ffidart:ffiPlatform.isAndroidPlatform.isIOSdart:iokIsWebpackage:flutter/foundation.dartSwitch.adaptiveSlider.adaptivePlatform.isAndroidPlatform.isIOSdart:iopackage:flutter/foundation.dartkIsWebSwitch.adaptiveSlider.adaptive