initialize static method

FrConfig initialize({
  1. Level logLevel = Level.INFO,
  2. FrLogRecordPrinter printer = LoggableMx.devLogRecordPrinter,
  3. FrUnion? frUnion,
  4. GetIt? di,
  5. bool emitEqualValues = false,
})

Creates and applies the global FlowR configuration.

logLevel sets Logger.root.level. printer receives records from Logger.root.onRecord. Calling FrConfig again replaces the previous FlowR log listener instead of adding another listener. frUnion registers a global FrUnionViewModel. Set it to null to skip the global union feature. di defaults to GetIt.I. emitEqualValues uses Cubit's equal-state suppression semantics by default. Set it to true to preserve the old BehaviorSubject behavior where put(value) emits even when value == currentValue.

Implementation

static FrConfig initialize({
  Level logLevel = Level.INFO,
  FrLogRecordPrinter printer = LoggableMx.devLogRecordPrinter,
  FrUnion? frUnion,
  GetIt? di,
  bool emitEqualValues = false,
}) {
  final flowrDartConfig = flowr_dart.FrConfig.initialize(
    logLevel: logLevel,
    printer: printer,
    emitEqualValues: emitEqualValues,
  );
  final config = FrConfig._(
    flowrDartConfig: flowrDartConfig,
    frUnion: frUnion,
    di: di ?? GetIt.I,
  );
  config._apply();
  _instance = config;
  return config;
}