amugofjava / anytime_podcast_player

Simple, easy to use Podcast player app written in Flutter and Dart.
BSD 3-Clause "New" or "Revised" License
403 stars 101 forks source link

Allow customisation of no-subscription message. #26

Closed roeierez closed 3 years ago

roeierez commented 3 years ago

This PR allows the caller to customise the message in Library view when there are no subscriptions. In Breez we need a slightly different message.

amugofjava commented 3 years ago

Hi @roeierez,

Although this is a simple change I'm not keen on adding an additional parameter to change just one message within the application. What I have done is created a new localisation delegate that you can use to override any message within Anytime. What you'll need to do is replace:

const LocalisationsDelegate()

with:

EmbeddedLocalisationsDelegate(messages: {
  'no_subscriptions_message': {'en': 'Custom Breez subscription message'}
}),

This alternative delegate takes a map, where the key is the message to replace, pointing to another map that contains the message for the locale. So, in the above example this will override the no_subscriptions_message message with a custom message for English.

If Breez is only available in English you may also wish to remove the const Locale('de', '') call, otherwise a German user may end up with some messages in English and some in German.

roeierez commented 3 years ago

@amugofjava I agree and like this idea. Let's go for it.