route avatar crop and profile view through AppRoutes

This commit is contained in:
2026-07-12 23:32:48 +02:00
parent db329c7299
commit 564a334cdc
4 changed files with 33 additions and 21 deletions
+2 -7
View File
@@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'avatar_crop_page.dart';
import '../routing/app_routes.dart';
import 'file_pick.dart';
/// Bottom sheet with "from gallery" and "take photo" actions for choosing a
@@ -61,12 +61,7 @@ Future<Uint8List?> showChatBackgroundPickerSheet(BuildContext context) async {
Future<Uint8List?> cropChatBackgroundImage(
BuildContext context,
Uint8List bytes,
) => Navigator.of(context).push<Uint8List>(
MaterialPageRoute(
fullscreenDialog: true,
builder: (_) => AvatarCropPage(imageBytes: bytes, aspectRatio: null),
),
);
) => AppRoutes.openAvatarCrop(context, imageBytes: bytes, aspectRatio: null);
Future<Uint8List?> _pickRaw(Future<XFile?> Function() pick) async {
final picked = await pick();