Merge pull request #745 from pangeachat/learning-settings-popup
when navigating to learning settings from chat popup menu, show page …
This commit is contained in:
commit
704e3bf7d1
3 changed files with 37 additions and 2 deletions
|
|
@ -8,7 +8,11 @@ import 'package:fluffychat/widgets/matrix.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class SettingsLearning extends StatefulWidget {
|
||||
const SettingsLearning({super.key});
|
||||
final bool isPopup;
|
||||
const SettingsLearning({
|
||||
this.isPopup = false,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
SettingsLearningController createState() => SettingsLearningController();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@ class SettingsLearningView extends StatelessWidget {
|
|||
title: Text(
|
||||
L10n.of(context)!.learningSettings,
|
||||
),
|
||||
leading: controller.widget.isPopup
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:fluffychat/pangea/pages/settings_learning/settings_learning.dart';
|
||||
import 'package:fluffychat/pangea/utils/download_chat.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
|
|
@ -150,7 +152,30 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
|||
);
|
||||
break;
|
||||
case ChatPopupMenuActions.learningSettings:
|
||||
context.go('/rooms/settings/learning');
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (c) {
|
||||
return kIsWeb
|
||||
? Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 600,
|
||||
maxHeight: 600,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
child: const SettingsLearning(isPopup: true),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Dialog.fullscreen(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 600),
|
||||
child: const SettingsLearning(isPopup: true),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
break;
|
||||
// Pangea#
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue