build method

  1. @override
T build(
  1. dynamic args
)
override

Implementation

@override
T build(dynamic args) {
  if (builder == null) {
    throw Exception(
      'You cannot call build method on this TypeDataSource since no builder was provided in this DataSource '
      'with DataKey=$dataKey',
    );
  }

  final result = builder!(args, locale);

  if (result is! T) {
    throw Exception(
        'build method should return a ${T.runtimeType} instead ${result.runtimeType} was returned');
  }

  return result;
}