Can extract date of expenses
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -13,10 +13,10 @@ part 'scan_screen.g.dart';
 | 
			
		||||
 | 
			
		||||
/// Scan a document & return generated PDF as byte file
 | 
			
		||||
@riverpod
 | 
			
		||||
Future<(Uint8List?, double?)> _scanDocument(Ref ref) async {
 | 
			
		||||
Future<(Uint8List?, BaseExpenseInfo?)> _scanDocument(Ref ref) async {
 | 
			
		||||
  final pdf = await scanDocAsPDF();
 | 
			
		||||
  final img = await renderPdf(pdfBytes: pdf);
 | 
			
		||||
  final amount = await extractTotalFromBill(img);
 | 
			
		||||
  final amount = await extractInfoFromBill(img);
 | 
			
		||||
  return (pdf, amount);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -42,11 +42,7 @@ class ScanScreen extends HookConsumerWidget {
 | 
			
		||||
      child: switch (scanDocProvider) {
 | 
			
		||||
        AsyncData(:final value) when value.$1 != null => ExpenseEditor(
 | 
			
		||||
          file: value.$1!,
 | 
			
		||||
          initialData: BaseExpenseInfo(
 | 
			
		||||
            label: null,
 | 
			
		||||
            cost: value.$2 ?? 0.0,
 | 
			
		||||
            time: DateTime.now(),
 | 
			
		||||
          ),
 | 
			
		||||
          initialData: value.$2,
 | 
			
		||||
          onFinished: (expense) async {
 | 
			
		||||
            await expenses.add(
 | 
			
		||||
              info: expense,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user