flutter_exif_rotation 0.2.3 copy "flutter_exif_rotation: ^0.2.3" to clipboard
flutter_exif_rotation: ^0.2.3 copied to clipboard

outdated

Flutter plugin that fixes the picture orientation when it's took in landscape for some devices.

example/lib/main.dart

import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_exif_rotation/flutter_exif_rotation.dart';
import 'package:image_picker/image_picker.dart';

void main() => runApp(MyApp());

/// The stateful widget
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

/// The class with the scaffold
class _MyAppState extends State<MyApp> {
  File _image;

  Future getImage() async {
    File image = await ImagePicker.pickImage(source: ImageSource.gallery);
    //File image = new File("/storage/emulated/0/DCIM/Camera/FrontCamera/IMG_20190620_222132.jpg");
    if (image != null && image.path != null) {
      image = await FlutterExifRotation.rotateImage(path: image.path);

      if (image != null) {
        setState(() {
          _image = image;
        });
      }
    }
  }

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Exif flutter rotation image example app'),
        ),
        body: new Center(
          child: _image == null
              ? new Text('No image selected.')
              : new Image.file(_image),
        ),
        floatingActionButton: new FloatingActionButton(
          onPressed: getImage,
          tooltip: 'Pick Image',
          child: new Icon(Icons.add),
        ),
      ),
    );
  }
}
70
likes
0
pub points
97%
popularity

Publisher

unverified uploader

Flutter plugin that fixes the picture orientation when it's took in landscape for some devices.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_exif_rotation