Last active
October 20, 2025 22:54
-
-
Save shafayathossain/1866a68bf589a7bd15e949c3bec67677 to your computer and use it in GitHub Desktop.
Flutter Preview - Preview Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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