Questions tagged [build-runner]
96 questions
0
votes
0 answers
Because local_auth >=1.1.0 <2.1.3 depends on intl ^0.17.0 and every version of flutter_localizations from sdk depends on intl 0.18.1
I am receiving the following error message
Because local_auth >=1.1.0 <2.1.3 depends on intl ^0.17.0 and every
version of flutter_localizations from sdk depends on intl 0.18.1,
local_auth >=1.1.0 <2.1.3 is incompatible with …

Vũ Khang
- 1
0
votes
0 answers
How do i generate a file from annotations in flutter?
I have a bunch of cells and a file that registers all of them at once, this works fine but i have to maintain this and remember to add the new entries every time, so i'm trying to create this file using code generation, i have my cells annotated…

Dani
- 3
- 1
- 3
0
votes
0 answers
How to have multiple build configuration for build.yaml file
In json_serializable package we can define a build.yaml file to configure diffrent options. I have 2 folder for my models, one folder is for requests and the other is for responses.
I want to know how to create build.yaml with diffrent configuration…

zex_rectooor
- 692
- 7
- 26
0
votes
0 answers
Go Router Builder gives error on building
I have some simple pages and lists I want to navigate, they all work fine apart from when I add one layer deeper navigation after a list.
Here's the code for my routes:
part 'routes.g.dart';
final GlobalKey _shellNavigatorKey =
…

Tristan King
- 438
- 4
- 17
0
votes
1 answer
Flutter Objectbox build_runner build exiting with code 78
I'm writing my first flutter app. I've defined the models with objectbox and now I'm trying to build objectbox codes by running flutter pub run build_runner build. And here's the output I get:
[INFO] Generating build script...
[INFO] Generating…

Forever Spring
- 3
- 3
0
votes
0 answers
Unable to generate code using build_runner for dart_frog project
I have a dart_frog server code running on a Google Cloud - Compute Engine instance. I have used stormberry as the ORM for my postgres DB which generates code using build_runner.
Now, the issue is that, when I run dart run build_runner build…

Damien Leon
- 61
- 5
0
votes
0 answers
Running dart run build_runner build in DockerFile does not generate files
I have a DockerFile as follows:
FROM dart:stable AS build
WORKDIR /app
# Copy Dependencies
COPY packages/shared ./packages/shared
# Install Dependencies
RUN dart pub get -C packages/shared
# Resolve app dependencies.
COPY pubspec.* ./
RUN dart…

Damien Leon
- 61
- 5
0
votes
0 answers
Dart build_runner does not work as expected
I've created this small repository where I am displaying this bug. Dose anyone knows what exactly I'm missing or is it a bug?
Steps to reproduce:
Clone the repo: git clone https://github.com/Vildnex/reflectable_bug
Get the dependencies dart pub…

Mircea
- 1,671
- 7
- 25
- 41
0
votes
1 answer
Unable to access fromJson function for freezed custom model
I have declared a custom freezed model in a flutter web project as follows:
@freezed
class User with _$User {
const factory User({
required int id,
required String name,
required Address address,
@Default(null) Contact? contact,
…

Damien Leon
- 61
- 5
0
votes
1 answer
Freezed: Could not resolve annotation for `int get hashCode`: @JSONKey(ignore: true)
When I try to generate freezed files on this classes, it gives me this error. I tried to rewrite hashCode getter on MappedLesson class but it didn't change anything.
line 1, column 4214 of package:derstakip_2/models/lat_models.freezed.dart: Could…

Ataberk
- 557
- 1
- 6
- 26
0
votes
1 answer
fromJson and toJson not generated when the build code is put in build.yaml file
If I use the following code in pubspec.yaml file, then the build_runner generates code but if I put it in the build.yaml file, then the code is not generated for fromJson and toJson.
targets:
$default:
builders:
json_serializable:
…

iDecode
- 22,623
- 19
- 99
- 186
0
votes
0 answers
How to make sure flutter build_runner includes files in the test/* folder?
I am using getIt with injectable for dependency injection.
I have some mocks created with mockito that I am trying to inject as a substitute for my actual repository, but when I run the build runner, they are not showing up in the generated…

Charlie Page
- 541
- 2
- 17
0
votes
2 answers
Flutter Build_Runner Build Failing While Generating Floor
build failed after flutter upgrade.
$ flutter pub run build_runner build
[INFO] Generating build script completed, took 331ms
[WARNING] ../../.pub-cache/hosted/pub.dev/floor_generator-1.4.1/lib/misc/type_utils.dart:25:26: Error: The getter…

Dmitry
- 536
- 1
- 4
- 9
0
votes
1 answer
Flutter need to call clean and pub get everytime before build_runner
I am using the localize_it package for localization which uses the build_runner to create some code.
The problem/inconvenience is that I always have to run
flutter clean
flutter pub get
before calling
flutter pub run build_runner build…

Chris
- 1,828
- 6
- 40
- 108
0
votes
0 answers
Override flutter pub get and flutter pub run build_runner build
In my project, I have separated my code into several packages. So every time when there is a code change, I have to go through each package and run flutter pub get and flutter pub run build_runner commands. (I know flutter caches packages in my…