Skip to content

Commit

Permalink
fix: use new AdwPreferencesGroup.creditsBuilder from libadwaita v2
Browse files Browse the repository at this point in the history
AdwPreferencesGroup.credits has been replaced by creditsBuilder with a different argument format

Adapted from the example here:
https://github.com/gtk-flutter/libadwaita/blob/ef76db3eff3fe1b0d3f0f9cd98004dc677d86c30/example/lib/home_page.dart#L124
  • Loading branch information
tdiam committed Oct 21, 2023
1 parent 2714c1f commit 1f3600c
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions lib/src/features/home/presentation/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,27 +242,21 @@ class _HomePageState extends ConsumerState<HomePage> {
),
appName: appName,
credits: [
AdwPreferencesGroup.credits(
AdwPreferencesGroup.creditsBuilder(
title: AppLocalizations.of(context)!.authors,
children:
List.generate(developers.length, (index) {
var entry = developers[index];
return AdwActionRow(
title: entry.name,
onActivated: entry.url.launchIt,
);
}),
itemCount: developers.length,
itemBuilder: (_, index) => AdwActionRow(
title: developers[index].name,
onActivated: developers[index].url.launchIt,
),
),
AdwPreferencesGroup.credits(
AdwPreferencesGroup.creditsBuilder(
title: "Translators",
children:
List.generate(translators.length, (index) {
var entry = translators[index];
return AdwActionRow(
title: entry.name,
onActivated: entry.url.launchIt,
);
}),
itemCount: translators.length,
itemBuilder: (_, index) => AdwActionRow(
title: translators[index].name,
onActivated: translators[index].url.launchIt,
),
),
],
appIcon: SvgPicture.network(
Expand Down

0 comments on commit 1f3600c

Please sign in to comment.