change: Remove wallpaper feature
This commit is contained in:
parent
1da3a1b250
commit
5d20185140
52 changed files with 0 additions and 313 deletions
|
|
@ -1,5 +1,4 @@
|
|||
abstract class SettingKeys {
|
||||
static const String wallpaper = 'chat.fluffy.wallpaper';
|
||||
static const String renderHtml = 'chat.fluffy.renderHtml';
|
||||
static const String hideRedactedEvents = 'chat.fluffy.hideRedactedEvents';
|
||||
static const String hideUnknownEvents = 'chat.fluffy.hideUnknownEvents';
|
||||
|
|
|
|||
|
|
@ -198,14 +198,6 @@ class ChatView extends StatelessWidget {
|
|||
onDragExited: controller.onDragExited,
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
if (Matrix.of(context).wallpaper != null)
|
||||
Image.file(
|
||||
Matrix.of(context).wallpaper!,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
filterQuality: FilterQuality.medium,
|
||||
),
|
||||
SafeArea(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/widgets/app_lock.dart';
|
||||
import 'package:fluffychat/widgets/theme_builder.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'settings_style_view.dart';
|
||||
|
|
@ -18,28 +14,6 @@ class SettingsStyle extends StatefulWidget {
|
|||
}
|
||||
|
||||
class SettingsStyleController extends State<SettingsStyle> {
|
||||
void setWallpaperAction() async {
|
||||
final picked = await AppLock.of(context).pauseWhile(
|
||||
FilePicker.platform.pickFiles(
|
||||
type: FileType.image,
|
||||
withData: false,
|
||||
),
|
||||
);
|
||||
final pickedFile = picked?.files.firstOrNull;
|
||||
|
||||
if (pickedFile == null) return;
|
||||
await Matrix.of(context)
|
||||
.store
|
||||
.setString(SettingKeys.wallpaper, pickedFile.path!);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void deleteWallpaperAction() async {
|
||||
Matrix.of(context).wallpaper = null;
|
||||
await Matrix.of(context).store.remove(SettingKeys.wallpaper);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void setChatColor(Color? color) async {
|
||||
AppConfig.colorSchemeSeed = color;
|
||||
ThemeController.of(context).setPrimaryColor(color);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import '../../config/app_config.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'settings_style.dart';
|
||||
|
||||
class SettingsStyleView extends StatelessWidget {
|
||||
|
|
@ -16,7 +15,6 @@ class SettingsStyleView extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const colorPickerSize = 32.0;
|
||||
final wallpaper = Matrix.of(context).wallpaper;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: const Center(child: BackButton()),
|
||||
|
|
@ -159,41 +157,6 @@ class SettingsStyleView extends StatelessWidget {
|
|||
onChanged: controller.switchTheme,
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.wallpaper,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (wallpaper != null)
|
||||
ListTile(
|
||||
title: Image.file(
|
||||
wallpaper,
|
||||
height: 38,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
trailing: const Icon(
|
||||
Icons.delete_outlined,
|
||||
color: Colors.red,
|
||||
),
|
||||
onTap: controller.deleteWallpaperAction,
|
||||
),
|
||||
Builder(
|
||||
builder: (context) {
|
||||
return ListTile(
|
||||
title: Text(L10n.of(context)!.changeWallpaper),
|
||||
trailing: Icon(
|
||||
Icons.photo_outlined,
|
||||
color: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
),
|
||||
onTap: controller.setWallpaperAction,
|
||||
);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.messagesStyle,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -187,8 +186,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
final StreamController<Map<String, dynamic>?> onShareContentChanged =
|
||||
StreamController.broadcast();
|
||||
|
||||
File? wallpaper;
|
||||
|
||||
void _initWithStore() async {
|
||||
try {
|
||||
if (client.isLogged()) {
|
||||
|
|
@ -429,9 +426,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
}
|
||||
|
||||
void initSettings() {
|
||||
final path = store.getString(SettingKeys.wallpaper);
|
||||
if (path != null) wallpaper = File(path);
|
||||
|
||||
AppConfig.fontSizeFactor =
|
||||
double.tryParse(store.getString(SettingKeys.fontSizeFactor) ?? '') ??
|
||||
AppConfig.fontSizeFactor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue