Loading...
Loading...
Library-agnostic Flutter/Dart code review checklist covering widget best practices, state management patterns (BLoC, Riverpod, Provider, GetX, MobX, Signals), Dart idioms, performance, accessibility, security, and clean architecture.
npx skill4agent add affaan-m/everything-claude-code flutter-dart-code-reviewpubspec.yamlanalysis_options.yamlprint()dart:developerlog().g.dart.freezed.dart.gr.dart.gitignoredynamicstrict-castsstrict-inferencestrict-raw-types!if (value case var v?)this.fieldcatch (e)onErrorErrorasyncasyncawaitlatelateStringBuffer+constconstFutureawaitunawaited()varfinalfinalconstpackage:ListMapif-caseis(String, int)print()dart:developerlog()print()build()_build*()constconstconst []const {}constValueKeyGlobalKeyUniqueKeybuild()ObjectKeyTheme.of(context).colorSchemeColors.redTheme.of(context).textThemeTextStylebuild()Future.then()asyncbuild().listen()build()setState()ref.watchcopyWith()==hashCodeEquatablefreezedListMap@action.value.obsReactionDisposerAsyncValueisLoadingisErrorhasData// BAD — boolean flag soup allows impossible states
class UserState {
bool isLoading = false;
bool hasError = false; // isLoading && hasError is representable!
User? user;
}
// GOOD (immutable approach) — sealed types make impossible states unrepresentable
sealed class UserState {}
class UserInitial extends UserState {}
class UserLoading extends UserState {}
class UserLoaded extends UserState {
final User user;
const UserLoaded(this.user);
}
class UserError extends UserState {
final String message;
const UserError(this.message);
}
// GOOD (reactive approach) — observable enum + data, mutations via reactivity API
// enum UserStatus { initial, loading, loaded, error }
// Use your solution's observable/signal to wrap status and data separatelyconst.listen()dispose()close().listen()mountedsetStateBuildContextawaitcontext.mountedBuildContextsetStateValueNotifiersetState()constRepaintBoundaryAnimatedBuilderbuild()build()MediaQuery.of(context)MediaQuery.sizeOf(context)Image.assetcacheWidthcacheHeightListView.builderGridView.builderListView(children: [...])deferred asOpacityAnimatedOpacityFadeTransitionoperator ==constIntrinsicHeightIntrinsicWidthpumpWidgetpumpfind.byTypefind.textfind.byKeypumpAndSettlepump(Duration)SemanticsExcludeSemanticsMergeSemanticssemanticLabelonPressedSafeAreaAndroidManifest.xmlInfo.plistLayoutBuilderMediaQueryFlexibleExpandedFittedBox--dart-define.env.gitignore^1.2.3flutter pub outdatedpubspec.yamlpackage:other/src/internal.dartpath: ../../analysis_options.yamlNavigator.pushMap<String, dynamic>Object?FlutterError.onErrorPlatformDispatcher.instance.onErrorErrorWidget.builderrunApprunZonedGuardedifanalysis_options.yamlstrict-casts: truestrict-inference: truestrict-raw-types: true// ignore:flutter analyzeprefer_const_constructorsavoid_printunawaited_futuresprefer_final_localsalways_declare_return_typesavoid_catches_without_on_clausesalways_use_package_imports| Principle | BLoC/Cubit | Riverpod | Provider | GetX | MobX | Signals | Built-in |
|---|---|---|---|---|---|---|---|
| State container | | | | | | | |
| UI consumer | | | | | | | |
| Selector | | | | N/A | computed | | N/A |
| Side effects | | | | | | | callbacks |
| Disposal | auto via | | auto via | | | manual | |
| Testing | | | | | store directly | signal directly | widget test |