feat: show dish recognition result as bottom sheet on home screen
Remove "Определить блюдо" from ScanScreen and the /scan/dish route. The + button on each meal card now triggers dish recognition inline — picks image, shows loading dialog, then presents DishResultSheet as a modal bottom sheet. After adding to diary the sheet closes and the user stays on home. Also fix Navigator.pop crash: showDialog uses the root navigator by default, so capture Navigator.of(context, rootNavigator: true) before the async gap and use it to close the loading dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../../core/api/api_client.dart';
|
||||
import '../../core/auth/auth_provider.dart';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Models
|
||||
@@ -181,3 +183,7 @@ class RecognitionService {
|
||||
return {'image_base64': base64Data, 'mime_type': mimeType};
|
||||
}
|
||||
}
|
||||
|
||||
final recognitionServiceProvider = Provider<RecognitionService>((ref) {
|
||||
return RecognitionService(ref.read(apiClientProvider));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user