The config above moved the generated mapper file from some/path/to/foo.mapper.dart to lib/generated/some/path/to/foo.mapper.dart and on Windows platform in the Generated code, the part of statement broke like this:
part of '..\main.dart';
which should be part of ..\\main.dart or part of ../main.dart.
Create a new flutter project and add dart_mappable (also the builder) as dependency.
Add some code to use dart_mappable in main.dart:
part '../generated/main.mapper.dart';
@MappableClass()
class Foo with FooMappable {}
4. Save the following config in `build.yaml`:
```yaml
targets:
$default:
builders:
dart_mappable_builder:
options:
build_extensions:
'lib/{{}}.dart':
- 'lib/generated/{{}}.mapper.dart'
Run dart run build_runner build and in the generated file there is:
part of '..\main.dart'; which is broken on Windows.
Description
I encountered this error when using v4.2.0 (latest version) on Windows with the following build config:
The config above moved the generated mapper file from
some/path/to/foo.mapper.dart
tolib/generated/some/path/to/foo.mapper.dart
and on Windows platform in the Generated code, thepart of
statement broke like this:which should be
part of ..\\main.dart
orpart of ../main.dart
.Reproduce
Just use the repo here.
Or:
@MappableClass() class Foo with FooMappable {}
dart run build_runner build
and in the generated file there is:part of '..\main.dart';
which is broken on Windows.Info