yin_drag_sacle 0.0.2

  • Readme
  • Changelog
  • Installing
  • 75

yin_drag_sacle #

Image zooming in, zooming out, dragging, you can customize the zoom scale, the project is from flutter_drag_scale, the modification is published to meet their own project

图片缩放,缩放,拖动,可以自定义缩放比例,该项目是来自flutter_drag_scale,修改后发布,以满足自己的项目

Getting Started #

  • amplification

    • gesture magnification
    • double click to enlarge
  • to reduce the

  • drag

  • 放大

    • 手势放大
    • 双击放大
  • 缩小

  • 拖动

它可以配合轮播使用

import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:yin_drag_sacle/yin_drag_sacle.dart';

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

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

class MyAppState extends State<MyApp> {
  List<String> path = [
    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575024212241&di=b017d085f3982d951b9a365fbc9cfdd4&imgtype=0&src=http%3A%2F%2Fimg2.mukewang.com%2F5c18cf540001ac8206000338.jpg',
    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575024212240&di=a69285fddbc441702f83a707a2d2af17&imgtype=0&src=http%3A%2F%2Fdingyue.nosdn.127.net%2FetqmQabSGrqHXhTvzaS91gV006NWCPDnEgLHRoAVony8E1543979039684.png',
    'http://h.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=0d023672312ac65c67506e77cec29e27/9f2f070828381f30dea167bbad014c086e06f06c.jpg',
  ];

  ///item 视图
  Widget itemView(BuildContext context, int index) {
    String value = path[index];
    return DragScaleContainer(
      child: Image(image: NetworkImage(value)),
      doubleTapStillScale: false,
      maxScale: 4, //放大最大倍数
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('图片显示')),
        body: Swiper(
          itemBuilder: itemView,
          itemCount: path.length,
          pagination: SwiperPagination(),
          control: SwiperControl(),
        ),
      ),
    );
  }
}

[0.0.1] - TODO: Add release date. #

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  yin_drag_sacle: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:yin_drag_sacle/yin_drag_sacle.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/core/multitap.dart. (-3.93 points)

Analysis of lib/core/multitap.dart reported 8 hints, including:

line 8 col 8: Don't import implementation files from another package.

line 9 col 8: Don't import implementation files from another package.

line 10 col 8: Don't import implementation files from another package.

line 12 col 8: Don't import implementation files from another package.

line 13 col 8: Don't import implementation files from another package.

Fix lib/core/scale.dart. (-2.48 points)

Analysis of lib/core/scale.dart reported 5 hints:

line 8 col 8: Don't import implementation files from another package.

line 9 col 8: Don't import implementation files from another package.

line 10 col 8: Don't import implementation files from another package.

line 11 col 8: Don't import implementation files from another package.

line 12 col 8: Don't import implementation files from another package.

Fix lib/core/custom_gesture_detector.dart. (-1 points)

Analysis of lib/core/custom_gesture_detector.dart reported 2 hints:

line 38 col 8: Don't import implementation files from another package.

line 39 col 8: Don't import implementation files from another package.

Fix additional 3 files with analysis or formatting issues. (-1.50 points)

Additional issues in the following files:

  • lib/core/touchable_container.dart (2 hints)
  • lib/core/double_details.dart (1 hint)
  • lib/yin_drag_sacle.dart (Run flutter format to format lib/yin_drag_sacle.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and yin_drag_sacle.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test