head_image_cropper 2.0.1 copy "head_image_cropper: ^2.0.1" to clipboard
head_image_cropper: ^2.0.1 copied to clipboard

outdated

A picture cutting part of flutter, which supports square picture and round picture preview. Suitable for fixed size image clipping. Such as cutting the head

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:head_image_cropper/head_image_cropper.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
  var _cropperKey = GlobalKey();

  ImageProvider _image;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          actions: <Widget>[
            FlatButton(
              child: Text("保存"),
              onPressed: () {
                (_cropperKey.currentContext as CropperImageElement).outImage().then((image) {
                  //保存或上传代码
                });
              },
            )
          ],
        ),
        body: Container(
          padding: EdgeInsets.all(50),
          child: CropperImage(
            NetworkImage("http://n.sinaimg.cn/sinacn12/564/w1920h1044/20181111/69c3-hnstwwq4987218.jpg"),
            key: _cropperKey,
          ),
        ),
      ),
    );
  }
}
11
likes
0
pub points
66%
popularity

Publisher

unverified uploader

A picture cutting part of flutter, which supports square picture and round picture preview. Suitable for fixed size image clipping. Such as cutting the head

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on head_image_cropper