implemented a customizable chat background system with support for patterns, solid colors, and gallery images; added a dedicated settings page with live preview and adjustable blur/dim effects, updated the image cropper to support flexible aspect ratios for wallpapers, and integrated file cleanup logic during account logout.
This commit is contained in:
@@ -5,12 +5,20 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'app_progress_indicator.dart';
|
||||
|
||||
/// Full-screen 1:1 cropper. Pure-Flutter so it inherits the app theme and
|
||||
/// Full-screen cropper. Pure-Flutter so it inherits the app theme and
|
||||
/// MediaQuery insets (no UCrop / native Activity needed). Returns the
|
||||
/// cropped JPEG/PNG bytes via Navigator pop, or `null` on cancel.
|
||||
///
|
||||
/// Defaults to a 1:1 crop (avatar use). Pass [aspectRatio] to override, or
|
||||
/// `null` for a free-form crop (e.g. chat backgrounds).
|
||||
class AvatarCropPage extends StatefulWidget {
|
||||
final Uint8List imageBytes;
|
||||
const AvatarCropPage({required this.imageBytes, super.key});
|
||||
final double? aspectRatio;
|
||||
const AvatarCropPage({
|
||||
required this.imageBytes,
|
||||
this.aspectRatio = 1.0,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<AvatarCropPage> createState() => _AvatarCropPageState();
|
||||
@@ -60,7 +68,7 @@ class _AvatarCropPageState extends State<AvatarCropPage> {
|
||||
child: Crop(
|
||||
image: widget.imageBytes,
|
||||
controller: _controller,
|
||||
aspectRatio: 1.0,
|
||||
aspectRatio: widget.aspectRatio,
|
||||
interactive: false,
|
||||
baseColor: theme.colorScheme.surface,
|
||||
maskColor: Colors.black.withValues(alpha: 0.6),
|
||||
|
||||
Reference in New Issue
Block a user