diff --git a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart index 4681fcc2b8..030377c80d 100644 --- a/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart +++ b/frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_language_view.dart @@ -1,10 +1,53 @@ +import 'package:app_flowy/workspace/application/appearance.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flowy_infra/language.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class SettingsLanguageView extends StatelessWidget { const SettingsLanguageView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { - return const Center(child: Text('Work In Progress')); + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + SizedBox( + height: 15, + ), + LanguageSelectorDropdown() + ], + ), + ); + } +} + +class LanguageSelectorDropdown extends StatefulWidget { + const LanguageSelectorDropdown({ + Key? key, + }) : super(key: key); + + @override + State createState() => _LanguageSelectorDropdownState(); +} + +class _LanguageSelectorDropdownState extends State { + @override + Widget build(BuildContext context) { + return DropdownButton( + value: context.read().language, + onChanged: (val) { + setState(() { + context.read().setLanguage(val!); + }); + }, + items: AppLanguage.values.map((language) { + return DropdownMenuItem( + value: language, + child: Text(describeEnum(language)), + ); + }).toList(), + ); } }