Coder Social home page Coder Social logo

diagonal_scrollview's People

Contributors

ranficd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

diagonal_scrollview's Issues

Image always zoomed in

I'm using diagonal scrollview to show different images of a map. The images have different sizes and aspect ratios, and the common issue (but maybe i'm missing something) is that even if i set different values of maximum scale, the image is always super-zoomed in when i open the app, and i have to manually zoom out. The desired behavior, in my case, is having the image zoomed out to match the width or the height with the container width or height, having the possibility to zoom in and scroll in every direction. Thanks in advance!

onScaleChanged never gets called

Hey,

It seems that _handleScaleUpdate() never emits scaleChanged events because we set the state before the comparison so the new and old scale values are always be the same.

setState(() {
  _scale = newScale;
  _lastFocalPoint = focalPoint; 
  _position = newPosition;
  _boxZoomOffset = newBoxZoomOffset;
});
_emitScroll();
if (_scale != newScale) {
  _emitScaleChanged();   // this gets never called
}

Changing the code below seems to solve the issue:

bool scaleChanged = _scale != newScale;
setState(() {
  _scale = newScale;
  _lastFocalPoint = focalPoint;
  _position = newPosition;
  _boxZoomOffset = newBoxZoomOffset;
});
_emitScroll();
if (scaleChanged) {
  _emitScaleChanged();
}

Using PaginatedDataTable get error

DiagonalScrollView(child: DataTable(...)) -> It's OK

DiagonalScrollView(child: PaginatedDataTable(...)) -> error

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during paint():
RenderBox was not laid out: RenderPhysicalShape#3a534 relayoutBoundary=up9
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1702 pos 12: 'hasSize'

getChildSize always return 0

So i use DiagonalScrollView to wrap my DataTable and because my table doesn't have a fix height and width i try to set a maxHeight and maxWidth using the size of my DataTable after it render using getChildSize from the controller.

The problem is it always return 0 both on the height and width and now my table scrolls infinitely on both direction.

Blank Screen (Image.File)

Hi, I tried to open a file that I downloaded, it is 6386px by 5688px png

DiagonalScrollView(
            enableFling: true,
            enableZoom: true,
            maxHeight: _boxSize,
            maxWidth: _boxSize,
            child: Image.file(snapshot.data) ,
            )

I can see the image if I use any other widget such as a SizedBox or Container but when I use the diagonalScrollView I just have a blank screen. There are no errors in the debug console.

flutter doctor -v
[✓] Flutter (Channel dev, v1.10.14, on Mac OS X 10.15 19A602, locale en-GB)
    • Flutter version 1.10.14 at /Users/xxxxxx/Documents/Programming/flutter
    • Framework revision 1946fc4da0 (4 weeks ago), 2019-10-07 15:23:31 -0700
    • Engine revision 1d62160fdb
    • Dart version 2.6.0 (build 2.6.0-dev.1.0 d6c6d12ebf)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/xxxxxx/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

 
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.8.3

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.6.0

[✓] Connected device (2 available)
    • Nexus 7    • xxxxxxx        • android-arm   • Android 6.0.1 (API 23)
    • ASUS X00TD • xxxxxxx • android-arm64 • Android 9 (API 28)

[Feature Request] Scroll to programatically

Thanks for a really cool widget!

I am trying to figure out a way to scroll to a _position programmatically but I have not managed to solve it.

For the scenario I had in mind I would need a way to programmatically move to specific offsets of the DiagonalScrollView when certain things happen but I am not sure how to accomplish that.

All suggestions are welcome :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.