63 lines
2.1 KiB
Dart
63 lines
2.1 KiB
Dart
import 'package:dio/dio.dart';
|
|
// import 'package:exif/exif.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:image_picker/image_picker.dart';
|
|
|
|
|
|
class CustomerExifPage extends StatefulWidget {
|
|
const CustomerExifPage({super.key});
|
|
|
|
@override
|
|
State<CustomerExifPage> createState() => _CustomerExifPageState();
|
|
}
|
|
|
|
class _CustomerExifPageState extends State<CustomerExifPage> {
|
|
XFile? pickedFile;
|
|
Map<String, Object>? attributes;
|
|
DateTime? shootingDate;
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
title: Text('图片信息'),
|
|
), //
|
|
body: Center(
|
|
child: TextButton(
|
|
onPressed: () async {
|
|
var response = await Dio().get('https://static.cop.jingheyijia.com/wxapp-map2/upload/moment/2025625/app-yctgxYDwcPkh.jpg');
|
|
print('response========= $response');
|
|
if (response.statusCode == 200) {
|
|
// final data = await readExifFromBytes(response.data);
|
|
// print('照片信息========= $data');
|
|
// setState(() {
|
|
// exifData = data;
|
|
// });
|
|
}
|
|
// pickedFile =
|
|
// await ImagePicker().pickImage(source: ImageSource.gallery);
|
|
// if (pickedFile == null) {
|
|
// return;
|
|
// }
|
|
// print('照片信息========= ${pickedFile?.path}/');
|
|
// exif = await Exif.fromPath(pickedFile!.path);
|
|
// coordinates = await exif!.getLatLong();
|
|
// print('地位信息========= $coordinates');
|
|
// attributes = await exif!.getAttributes();
|
|
// print('attributes========= $attributes');
|
|
// shootingDate = await exif!.getOriginalDate();
|
|
// print('shootingDate========= $shootingDate');
|
|
},
|
|
child: Text('IMAGES')),
|
|
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
);
|
|
}
|
|
}
|