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';
/// Result of the user's choice inside [showAvatarActionsSheet]. The sheet
@@ -107,10 +107,5 @@ Future<Uint8List?> _pickAndCrop(
if (picked == null) return null;
final bytes = await picked.readAsBytes();
if (!context.mounted) return null;
return Navigator.of(context).push<Uint8List>(
MaterialPageRoute(
fullscreenDialog: true,
builder: (_) => AvatarCropPage(imageBytes: bytes),
),
);
return AppRoutes.openAvatarCrop(context, imageBytes: bytes);
}