localizely/intl_utils

[Feature Request] const support

Closed this issue · 1 comments

Hi

The generated classes generates getters like:

/// `Documento`
  String get document {
    return Intl.message(
      'Documento',
      name: 'document',
      desc: '',
      args: [],
    );
  }

Request

Is there any way to also generate const versions of this? our widgets are not been able to be built with const because of messages and in some cases this may be ultra useful.

lzoran commented

According to the Dart documentation, const variables are defined as compile-time constants and can't be modified at runtime. This is indeed distinct from how localization messages dynamically adjust based on the app's selected language during its usage. Maybe I've missed something, but I think localization messages can't be const.