WIP
This commit is contained in:
parent
642daa3848
commit
ecd9408f35
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
|
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
|
|
@ -70,7 +70,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> processLocals(BuildContext context) async {
|
Future<bool> processLocals(BuildContext context) async {
|
||||||
print('-> processLocals');
|
log('-> processLocals');
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = FreAccessWSGlobal.getLocalsCall;
|
final GetLocalsCall callback = FreAccessWSGlobal.getLocalsCall;
|
||||||
final ApiCallResponse response = await callback.call();
|
final ApiCallResponse response = await callback.call();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:developer';
|
||||||
import 'package:app_links/app_links.dart';
|
import 'package:app_links/app_links.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/features/storage/index.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
import 'dart:developer' as dev;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -50,7 +51,7 @@ Future<Map<String, String>> stringToMap(String v) async {
|
||||||
}),
|
}),
|
||||||
));
|
));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Error parsing string to map: $e');
|
dev.log('Error parsing string to map: $e');
|
||||||
return Future.value({});
|
return Future.value({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -165,7 +166,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
(() async {
|
(() async {
|
||||||
final String url =
|
final String url =
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId';
|
'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId';
|
||||||
print('img: $url');
|
log('img: $url');
|
||||||
Response response = await get(Uri.parse(url));
|
Response response = await get(Uri.parse(url));
|
||||||
String base64 = base64Encode(response.bodyBytes);
|
String base64 = base64Encode(response.bodyBytes);
|
||||||
uploadedTempFile = await ImageUtils.convertToUploadFile(base64);
|
uploadedTempFile = await ImageUtils.convertToUploadFile(base64);
|
||||||
|
@ -282,7 +283,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
img = "base64;jpeg,$img";
|
img = "base64;jpeg,$img";
|
||||||
final url =
|
final url =
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId';
|
'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId';
|
||||||
print('img: $url');
|
log('img: $url');
|
||||||
final response = await FreAccessWSGlobal.updatePet.call(
|
final response = await FreAccessWSGlobal.updatePet.call(
|
||||||
petID: petId,
|
petID: petId,
|
||||||
image: img,
|
image: img,
|
||||||
|
|
|
@ -87,7 +87,7 @@ class ReadViewState extends State<ReadView> {
|
||||||
name: '${widget.title}.pdf', mimeType: 'application/pdf');
|
name: '${widget.title}.pdf', mimeType: 'application/pdf');
|
||||||
await Share.shareXFiles([xfile], text: 'Confira este PDF!');
|
await Share.shareXFiles([xfile], text: 'Confira este PDF!');
|
||||||
} else {
|
} else {
|
||||||
print('Erro ao baixar o arquivo: ${response.statusCode}');
|
log('Erro ao baixar o arquivo: ${response.statusCode}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +110,20 @@ class ReadViewState extends State<ReadView> {
|
||||||
future: _initializePdf(),
|
future: _initializePdf(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (!snapshot.hasData) return buildLoadingIndicator(context);
|
if (!snapshot.hasData) return buildLoadingIndicator(context);
|
||||||
|
|
||||||
return PdfView(
|
return PdfView(
|
||||||
controller: snapshot.data!,
|
controller: snapshot.data!,
|
||||||
|
renderer: (PdfPage page) => page.render(
|
||||||
|
width: page.width * 2,
|
||||||
|
height: page.height * 2,
|
||||||
|
cropRect: Rect.fromLTWH(
|
||||||
|
10.0, 10.0, page.width * 2, page.height * 2),
|
||||||
|
forPrint: false,
|
||||||
|
quality: 100,
|
||||||
|
removeTempFile: true,
|
||||||
|
format: PdfPageImageFormat.jpeg,
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
),
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue