Skip to content

Instantly share code, notes, and snippets.

@shafayathossain
Last active October 20, 2025 22:54
Show Gist options
  • Select an option

  • Save shafayathossain/1866a68bf589a7bd15e949c3bec67677 to your computer and use it in GitHub Desktop.

Select an option

Save shafayathossain/1866a68bf589a7bd15e949c3bec67677 to your computer and use it in GitHub Desktop.
Flutter Preview - Preview Function
@Preview(
name: 'Simple Widget',
size: Size(401, 200),
localizations: arabicLocalizations, // <-- 4.1. Use proper preview localization data
wrapper: materialAppWrapper,
)
Widget previewSimpleWidget() {
return Builder(
builder: (context) {
final localizations = AppLocalizations.of(context)!;
return Center(
child: SimpleWidget(
text: localizations.settings, // <-- 4.2. Use localized Strings
icon: Icons.settings,
),
);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment