feat(create):exif
This commit is contained in:
62
example/lib/exif/customer_exif_Page.dart
Normal file
62
example/lib/exif/customer_exif_Page.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
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.
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:example/exif/customer_exif_Page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:image_editor_plus/image_editor_plus.dart';
|
||||
@@ -34,7 +35,8 @@ class MyApp extends StatelessWidget {
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
// home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
home: CustomerExifPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,13 @@ dependencies:
|
||||
cupertino_icons: ^1.0.8
|
||||
image_editor_plus: ^1.0.6
|
||||
dio: ^5.9.0
|
||||
image_picker: ^1.1.0 #相册单选
|
||||
# native_exif: ^0.6.2
|
||||
# exif: ^3.3.0
|
||||
|
||||
flutter_common:
|
||||
git:
|
||||
url: https://code.keplerjai.com/wangliankun/flutter_common.git
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user