Generate g.dart file failed
manhpv-1697 opened this issue · 0 comments
I'm using build_value_generator 8.4.1, but when i run flutter packages pub run build_runner build --delete-conflicting-outputs, i receive error : "[SEVERE] built_value_generator:built_value on lib/state/app_state.dart (cached):
Error in BuiltValueGenerator for abstract class AppState implements Built<AppState, AppStateBuilder>, HostState, ClientState, StateWithNavigation.
Please make the following changes to use BuiltValue:
- Make builder field navigation a normal field or a getter/setter pair.
"
This is my code:
part 'app_state.g.dart';
abstract class AppState
implements
Built<AppState, AppStateBuilder>,
HostState,
ClientState,
StateWithNavigation {
AppState._();
factory AppState() = _$AppState;
static Serializer get serializer => _$appStateSerializer;
@BuiltValueField(serialize: false)
int get shieldCounter;
@OverRide
@BuiltValueField(serialize: false)
NavigationState get navigation;
@OverRide
Settings get settings;
bool get isPro;
@BuiltValueField(serialize: false)
String get languageCode;
String get webViewUrl {
final gameId = currentGame?.gameId;
return gameId == null
? ""
: '';
}
bool get isFirstRun;
@BuiltValueField(serialize: false)
bool get linkSubscriptionHasStarted;
@BuiltValueField(serialize: false)
Offering? get offering;
@OverRide
bool get isCreatingGame;
bool get showHeader;
}
abstract class AppStateBuilder
implements
Builder<AppState, AppStateBuilder>,
CommonStateBuilder,
HostStateBuilder,
ClientStateBuilder,
StateWithNavigationBuilder {
AppStateBuilder._();
factory AppStateBuilder() = _$AppStateBuilder;
@OverRide
void replace(covariant AppState other);
@OverRide
bool isCreatingGame = false;
int shieldCounter = 0;
bool showHeader = false;
bool isFirstRun = true;
bool isPro = false;
bool linkSubscriptionHasStarted = false;
String languageCode = window.locale.languageCode;
@OverRide
SettingsBuilder settings = SettingsBuilder();
Offering? offering;
@OverRide
String userId = "";
@OverRide
CurrentGameBuilder currentGame = CurrentGameBuilder();
@OverRide
NavigationStateBuilder get navigation => NavigationStateBuilder()
..stacks![Navigators.main] =
RouteStack((b) => b..stack.add(const AppSetupRoute()))
..stacks![Navigators.popups] = RouteStack();
}