|
@@ -1,9 +1,11 @@
|
|
|
import 'package:app_flowy/generated/locale_keys.g.dart';
|
|
|
+import 'package:app_flowy/workspace/application/appearance.dart';
|
|
|
import 'package:app_flowy/workspace/presentation/settings/widgets/settings_appearance_view.dart';
|
|
|
import 'package:app_flowy/workspace/presentation/settings/widgets/settings_language_view.dart';
|
|
|
import 'package:app_flowy/workspace/presentation/settings/widgets/settings_menu.dart';
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:provider/provider.dart';
|
|
|
|
|
|
class SettingsDialog extends StatefulWidget {
|
|
|
const SettingsDialog({Key? key}) : super(key: key);
|
|
@@ -22,41 +24,45 @@ class _SettingsDialogState extends State<SettingsDialog> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return AlertDialog(
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
- borderRadius: BorderRadius.circular(10),
|
|
|
- ),
|
|
|
- title: Text(
|
|
|
- LocaleKeys.settings_title.tr(),
|
|
|
- style: const TextStyle(
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
+ return ChangeNotifierProvider.value(
|
|
|
+ value: Provider.of<AppearanceSettingModel>(context, listen: true),
|
|
|
+ child: AlertDialog(
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(10),
|
|
|
),
|
|
|
- ),
|
|
|
- content: ConstrainedBox(
|
|
|
- constraints: const BoxConstraints(
|
|
|
- maxHeight: 600,
|
|
|
+ title: Text(
|
|
|
+ LocaleKeys.settings_title.tr(),
|
|
|
+ style: const TextStyle(
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ ),
|
|
|
),
|
|
|
- child: Row(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: SettingsMenu(
|
|
|
- changeSelectedIndex: (index) {
|
|
|
- setState(() {
|
|
|
- _selectedViewIndex = index;
|
|
|
- });
|
|
|
- },
|
|
|
- currentIndex: _selectedViewIndex,
|
|
|
+ content: ConstrainedBox(
|
|
|
+ constraints: const BoxConstraints(
|
|
|
+ maxHeight: 600,
|
|
|
+ minWidth: 600,
|
|
|
+ maxWidth: 1000,
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ SizedBox(
|
|
|
+ width: 200,
|
|
|
+ child: SettingsMenu(
|
|
|
+ changeSelectedIndex: (index) {
|
|
|
+ setState(() {
|
|
|
+ _selectedViewIndex = index;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ currentIndex: _selectedViewIndex,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- const VerticalDivider(),
|
|
|
- const SizedBox(width: 10),
|
|
|
- Expanded(
|
|
|
- flex: 4,
|
|
|
- child: settingsViews[_selectedViewIndex],
|
|
|
- )
|
|
|
- ],
|
|
|
+ const VerticalDivider(),
|
|
|
+ const SizedBox(width: 10),
|
|
|
+ Expanded(
|
|
|
+ child: settingsViews[_selectedViewIndex],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
);
|