refactor: MVC multiple emote settings

This commit is contained in:
Christian Pauly 2021-04-24 08:00:03 +02:00
parent f23fdccada
commit a64ada50d4
3 changed files with 25 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import 'package:fluffychat/views/archive.dart';
import 'package:fluffychat/views/homeserver_picker.dart';
import 'package:fluffychat/views/invitation_selection.dart';
import 'package:fluffychat/views/settings_emotes.dart';
import 'package:fluffychat/views/settings_multiple_emotes.dart';
import 'package:fluffychat/views/sign_up.dart';
import 'package:fluffychat/views/sign_up_password.dart';
import 'package:fluffychat/views/widgets/matrix.dart';
@ -23,7 +24,6 @@ import 'package:fluffychat/views/ui/settings_ui.dart';
import 'package:fluffychat/views/settings_3pid.dart';
import 'package:fluffychat/views/device_settings.dart';
import 'package:fluffychat/views/settings_ignore_list.dart';
import 'package:fluffychat/views/ui/settings_multiple_emotes_ui.dart';
import 'package:fluffychat/views/ui/settings_notifications_ui.dart';
import 'package:fluffychat/views/settings_style.dart';
import 'package:flutter/material.dart';

View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'ui/settings_multiple_emotes_ui.dart';
class MultipleEmotesSettings extends StatefulWidget {
final String roomId;
MultipleEmotesSettings(this.roomId, {Key key}) : super(key: key);
@override
MultipleEmotesSettingsController createState() =>
MultipleEmotesSettingsController();
}
class MultipleEmotesSettingsController extends State<MultipleEmotesSettings> {
@override
Widget build(BuildContext context) => MultipleEmotesSettingsUI(this);
}

View File

@ -1,17 +1,19 @@
import 'package:adaptive_page_layout/adaptive_page_layout.dart';
import 'package:fluffychat/views/settings_multiple_emotes.dart';
import 'package:fluffychat/views/widgets/matrix.dart';
import 'package:flutter/material.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
class MultipleEmotesSettings extends StatelessWidget {
final String roomId;
class MultipleEmotesSettingsUI extends StatelessWidget {
final MultipleEmotesSettingsController controller;
MultipleEmotesSettings(this.roomId, {Key key}) : super(key: key);
MultipleEmotesSettingsUI(this.controller, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final room = Matrix.of(context).client.getRoomById(roomId);
final room =
Matrix.of(context).client.getRoomById(controller.widget.roomId);
return Scaffold(
appBar: AppBar(
leading: BackButton(),