2021-04-12 18:33:43 +02:00
|
|
|
import 'package:famedlysdk/famedlysdk.dart';
|
2021-04-15 13:03:14 +02:00
|
|
|
import 'package:fluffychat/views/ui/archive_ui.dart';
|
2021-04-12 18:33:43 +02:00
|
|
|
import 'package:fluffychat/views/widgets/matrix.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Archive extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
ArchiveController createState() => ArchiveController();
|
|
|
|
}
|
|
|
|
|
|
|
|
class ArchiveController extends State<Archive> {
|
|
|
|
List<Room> archive;
|
|
|
|
|
|
|
|
Future<List<Room>> getArchive(BuildContext context) async {
|
|
|
|
if (archive != null) return archive;
|
|
|
|
return await Matrix.of(context).client.archive;
|
|
|
|
}
|
|
|
|
|
|
|
|
void forgetAction(int i) => setState(() => archive.removeAt(i));
|
|
|
|
|
|
|
|
@override
|
2021-04-15 13:03:14 +02:00
|
|
|
Widget build(BuildContext context) => ArchiveUI(this);
|
2021-04-12 18:33:43 +02:00
|
|
|
}
|