fit_image 0.1.2 copy "fit_image: ^0.1.2" to clipboard
fit_image: ^0.1.2 copied to clipboard

discontinued

A Image Widget that can be used with BoxFit.

example/main.dart

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

class Sample extends StatefulWidget {
  @override
  _SampleState createState() => new _SampleState();
}

class _SampleState extends State<Sample> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('FixImage'),
      ),
      body: new ListView.builder(
        itemBuilder: _buildChild,
        itemCount: BoxFit.values.length,
      ),
    );
  }

  Widget _buildChild(BuildContext context, int index) {
    var fit = BoxFit.values[index];

    return new Column(
      children: <Widget>[
        new SizedBox(
          width: 100.0,
          height: 120.0,
          child: new FitImage(
            child: new Image.asset("img/flutter-mark-square-100.png"),
            fit: fit,
          ),
        ),
        new Text('$fit'),
      ],
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A Image Widget that can be used with BoxFit.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on fit_image