mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 12:25:11 +00:00
fix: Styling and notification settings
This commit is contained in:
parent
67e8dedd5d
commit
5629f14d5a
7 changed files with 29 additions and 6 deletions
|
@ -17,6 +17,7 @@ class AddStoryView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
backgroundColor: Colors.blueGrey.shade900,
|
||||
appBar: AppBar(
|
||||
leading: const BackButton(color: Colors.white),
|
||||
systemOverlayStyle: SystemUiOverlayStyle.light,
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
|
@ -38,15 +39,18 @@ class AddStoryView extends StatelessWidget {
|
|||
if (controller.hasMedia)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.fullscreen_outlined),
|
||||
color: Colors.white,
|
||||
onPressed: controller.toggleBoxFit,
|
||||
),
|
||||
if (!controller.hasMedia)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.color_lens_outlined),
|
||||
color: Colors.white,
|
||||
onPressed: controller.updateColor,
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete_outlined),
|
||||
color: Colors.white,
|
||||
onPressed: controller.reset,
|
||||
),
|
||||
],
|
||||
|
|
|
@ -19,6 +19,8 @@ class ConnectPageView extends StatelessWidget {
|
|||
final identityProviders = controller.identityProviders;
|
||||
return LoginScaffold(
|
||||
appBar: AppBar(
|
||||
leading:
|
||||
controller.loading ? null : const BackButton(color: Colors.white),
|
||||
automaticallyImplyLeading: !controller.loading,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
|
|
|
@ -22,16 +22,19 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
IconButton(
|
||||
onPressed: controller.restoreBackup,
|
||||
tooltip: L10n.of(context)!.hydrate,
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.restore_outlined),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: L10n.of(context)!.privacy,
|
||||
onPressed: () => launch(AppConfig.privacyUrl),
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.shield_outlined),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: L10n.of(context)!.about,
|
||||
onPressed: () => PlatformInfos.showDialog(context),
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.info_outlined),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -15,6 +15,8 @@ class LoginView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return LoginScaffold(
|
||||
appBar: AppBar(
|
||||
leading:
|
||||
controller.loading ? null : const BackButton(color: Colors.white),
|
||||
automaticallyImplyLeading: !controller.loading,
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
|
|
|
@ -58,26 +58,33 @@ class SettingsNotifications extends StatefulWidget {
|
|||
|
||||
class SettingsNotificationsController extends State<SettingsNotifications> {
|
||||
bool? getNotificationSetting(NotificationSettingsItem item) {
|
||||
final pushRules = Matrix.of(context).client.globalPushRules;
|
||||
// Until https://gitlab.com/famedly/company/frontend/famedlysdk/-/merge_requests/1124 is shipped
|
||||
final pushRulesRaw = Matrix.of(context)
|
||||
.client
|
||||
.accountData['m.push_rules']
|
||||
?.content
|
||||
.tryGetMap<String, dynamic>('device');
|
||||
if (pushRulesRaw == null) return null;
|
||||
final pushRules = PushRuleSet.fromJson(pushRulesRaw);
|
||||
switch (item.type) {
|
||||
case PushRuleKind.content:
|
||||
return pushRules!.content
|
||||
return pushRules.content
|
||||
?.singleWhereOrNull((r) => r.ruleId == item.key)
|
||||
?.enabled;
|
||||
case PushRuleKind.override:
|
||||
return pushRules!.override
|
||||
return pushRules.override
|
||||
?.singleWhereOrNull((r) => r.ruleId == item.key)
|
||||
?.enabled;
|
||||
case PushRuleKind.room:
|
||||
return pushRules!.room
|
||||
return pushRules.room
|
||||
?.singleWhereOrNull((r) => r.ruleId == item.key)
|
||||
?.enabled;
|
||||
case PushRuleKind.sender:
|
||||
return pushRules!.sender
|
||||
return pushRules.sender
|
||||
?.singleWhereOrNull((r) => r.ruleId == item.key)
|
||||
?.enabled;
|
||||
case PushRuleKind.underride:
|
||||
return pushRules!.underride
|
||||
return pushRules.underride
|
||||
?.singleWhereOrNull((r) => r.ruleId == item.key)
|
||||
?.enabled;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ class SignupPageView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return LoginScaffold(
|
||||
appBar: AppBar(
|
||||
leading:
|
||||
controller.loading ? null : const BackButton(color: Colors.white),
|
||||
automaticallyImplyLeading: !controller.loading,
|
||||
title: Text(
|
||||
L10n.of(context)!.signUp,
|
||||
|
|
|
@ -50,6 +50,7 @@ class StoryView extends StatelessWidget {
|
|||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
leading: IconButton(
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
|
@ -96,10 +97,12 @@ class StoryView extends StatelessWidget {
|
|||
: [
|
||||
if (!controller.isOwnStory)
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(Icons.adaptive.share_outlined),
|
||||
onPressed: controller.share,
|
||||
),
|
||||
PopupMenuButton<PopupStoryAction>(
|
||||
color: Colors.white,
|
||||
onSelected: controller.onPopupStoryAction,
|
||||
itemBuilder: (context) => [
|
||||
if (controller.currentEvent?.canRedact ?? false)
|
||||
|
|
Loading…
Reference in a new issue