How to detect mouse wheel scrolling in flutter web? - flutter-web

How can you detect mouse wheel scroll in flutter web? It seems like it would be in a gesture detector but I don't see it in there. How do list views detect mouse scroll?

Wrap your ListView (or any other scroll view) with Listener and listen for PointerScrollEvent:
Listener(
onPointerSignal: (pointerSignal){
if(pointerSignal is PointerScrollEvent){
// do something when scrolled
print('Scrolled');
}
},
child: ... //your scrollview here
)

Related

When back from activity to the parent layout drawer menu hover wrong menu

I have a problem when opening activity from the navigation menu and when the back button clicks, it come back into the parent layout but the navigation menu hover (Current Menu Fragment/Activity Pointer) shows the menu that is connected to the previous activity.
it's obvious in the images below:
if the gif is not obvious main quality of it is below link.
Gif With Main Quality
when back from the activity (in the gif it's 'Custom') into the parent fragment ( 'Home') the ('Custom') menu is hover, but it should hover the ('Home').
When We Back From Activity Drawer Should Hover The 'Home' Like Below But it Hovers The 'Custom'
You need to handle it through code, using setChecked(boolean checked) method

Auto scroll ScrollView when I touch on the bottom of the screen

I trying to create a view which have a scroll view. If I Touch to bottom or if I drag my finger to bottom ,then the Scrollview should scroll automatically in fixed speed. consider the below Image
I am using PanResponder class in react native to achieve this functionalities.
for scrolling I am using scrollTo() . But I am failed do this. I like to share my code but it was too bulky and not understandable.
So my question is Is anyone have any code to achieve this. or Is there any libraries available?
Please help me
Use scrollToEnd({animated: true}) to go the bottom of scrollView in react-native.
From doc.s of facebook https://facebook.github.io/react-native/docs/scrollview#scrolltoend
scrollToEnd()
If this is a vertical ScrollView scrolls to the bottom. If this is a horizontal ScrollView scrolls to the right.
Use scrollToEnd({animated: true}) for smooth animated scrolling, scrollToEnd({animated: false}) for immediate scrolling. If no options are passed, animated defaults to true.

How can i show spinner in titlebar when link is clicked on webview

Am new to android programming. I want to create a little spinner on my title bar in webview when a link is clicked. An example is the one in opera mini (on the top left) shown in this photo. Pls I'll really appreciate your help.
Implement toolbar with progress bar or spinner. Then setup javascriptInterface for your webview and update toolbar's spinner when it's called from webview.

Enable mouse scroll in flipview children

In my WinJS application, I use a flipview, with a Listview inside it.
The listview as a long content, so it is scrollable : the scrollbar is visible, I can scroll with the finger on a touch screen, but the mouse wheel doesn't work.
After looking at the flipview source code, I added the win-interactive class on my listview, and now I can use the mouse wheel to scroll, but the problem is that the scroll also applies to the flipview container : the mouse scroll directly between the different flipview items.
Is there a way to enable the scroll on the listview, without modifying the flipview behavior ?
Yes there is, you can subscribe to the mousewheel event being fired in your ListView and stopPropagation() from there to the FlipView.

Android wallpaper also sliding left and right when we swipe the home screen

I want to develop a new home screen application for android. I saw the default home screen in my android 2.3.3 device, when ever I swipe the home screen left and right, the background wallpaper also sliding left and right. What is that view? How to get the same effect in an app?
Is it ViewPager? I checked the ViewPager class, but I didn't found any common background image for all views in that.
You probably want to use a canvas with a draw-able, then detect the users swiping and animate it in the background. It is likely that the default android backgrounds are doing the same. You wont be drawing the unseen portions of the view.
http://developer.android.com/guide/topics/graphics/2d-graphics.html
I suggest doing their lunar lander tutorial to learn how to use the canvas first.
You will make a canvas the background to your app and then lay your other ui elements on top of it unless you make the ui based inside the canvas.

Resources