Skip to content

Commit

Permalink
#36 Add Switch language to retranslate
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Nov 25, 2021
1 parent 4fb9e5c commit 1edfbc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ class _HomePageState extends State<HomePage>
_sourceLanguage = newSourceLanguage;
_targetLanguage = newTargetLanguage;
});
if (_text.isNotEmpty) {
_handleButtonTappedTrans();
}
},
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/home/translation_target_select_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _AvailableLanguageSelector extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 12, top: 12, bottom: 12),
margin: const EdgeInsets.only(left: 12, top: 12, bottom: 12),
width: double.infinity,
child: Wrap(
alignment: WrapAlignment.start,
Expand All @@ -32,7 +32,7 @@ class _AvailableLanguageSelector extends StatelessWidget {
height: 28,
child: Builder(builder: (_) {
bool isSelected = value == supportedLanguage;
EdgeInsets padding = EdgeInsets.only(left: 6, right: 6);
EdgeInsets padding = const EdgeInsets.only(left: 6, right: 6);
Widget child = LanguageLabel(
supportedLanguage,
flagSize: 18,
Expand Down

0 comments on commit 1edfbc7

Please sign in to comment.