slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
419 stars 36 forks source link

Upon upgrading Flutter from version 3.13.4 to 3.19.4, specifying only variables as values in JSON ceased to convert them to strings. #207

Closed chocoyama closed 3 months ago

chocoyama commented 3 months ago

Describe the bug Upon upgrading Flutter from version 3.13.4 to 3.19.4, specifying only variables as values in JSON ceased to convert them to strings.

To Reproduce

  1. Add the following definition to a json file:
    "hoge": "{hoge}",
  2. The following Dart code is generated:
    String hoge({required Object hoge}) => hoge;
  3. When trying to execute, the following error occurs:
    ib/i18n/strings.g.dart:634:64: Error: A value of type 'Object' can't be returned from a function with return type 'String'.
    - 'Object' is from 'dart:core'.
    String hoge({required Object hoge}) => hoge;

Expected behavior Previously, the following code was generated:

String hoge({required Object hoge}) => '$hoge';

Additional context Add any other context about the problem here.

Tienisto commented 3 months ago

Thank you. This bug has been fixed in 3.30.2