Impressions or tracking on Flutter widget - flutter

I want to track if a widget is show on the screen. Like a card in a list view.
There is a widget in Flutter like GestureDetector for impression or tracking?

You might want to look into the firebase_analytics plugin. You can set it up to track when users look at certain pages. See the plugin page for more info.

I wrote a library for this https://github.com/623637646/flutter_impression
ImpressionDetector(
impressedCallback: () {
debugPrint('impressed');
},
child: MyWidget(),
)

Related

Flutter: How to fix a container at the Bottom over all the screens on the App

I want to use Ad mob on my app, but I want to use the same ad for all screens on my app. So one ad at the bottom of the screen, that dosn't change by navigating through the app.
How can I do that?
You can use bottomSheet and place the widget based on your need.
return Scaffold(
bottomSheet: showWidget ? Text("ad-banner") : null,

How to add suggetionbox in web when cursor is on button

I want to show suggestion when cursor is on button or on some widget in flutter web
I share example how I want to show suggestion box but I don't know how to add suggestion box in flutter
You need to wrap widget with Tooltip see example.
flutter tooltip example
Try below code hope its help to you. Used Tooltip Widget
Refer Tooltip here
Test below code here
Tooltip(
message: "Managers",
child: ElevatedButton(
onPressed: () {},
child: Text('OK'),
),
),
Result Screen->
In addition to all the tooltip related recommendations, if they don't quite meet your requirements, there's OverlayEntry It allows to use any widget, but is not super easy to handle, so there's a couple packages out there that do some work with Overlays for you that you might consider.
https://pub.dev/packages/flutter_portal
https://pub.dev/packages/modals
To show overlay entry when hovering over some widget, wrap it with MouseRegion and use its onEnter and onExit methods to show and hide overlay

Flutter swipe to sides like in chrome

In my book-like Flutter app, there is a requirement to swipe in horizontal direction in order to navigate to previous and next page. I looked for a package which does something like that in pub.dev and didn't find. I'd like to know if there is already something like that to not-invent a wheel. If not, I'd like to hear (not excepting you to make it for me) what approach can be taken in order to implement it by myself.
What you're looking for is the PageView widget. Just provide the pages, the swiping functionality is built-in.
PageView(
controller: _controller,
children: [
MyPage1Widget(),
MyPage2Widget(),
MyPage3Widget(),
],
)
Since you're saying it's for a book which likely has a lot of pages you might want to use PageView.builder() instead of better performance.
There's a more information about the widget here

How to return a combination of SliverAppBar and SliverList in flutter

I have an app that has a cart screen, in this screen I want to divide the ordered products according to their respective factories, so I want to use SliverAppBars and SliverLists.
Now what I really need is to make a custom widget that can returns a SliverAppBar and a SliverList together so that I build this widget and get multiple SliverAppBars and SliverLists.
Anyone knows how to do that?
I found a package on pub.dev that can do that, it's called sliver_tools and here's the link to it here

Building specific Navigation animation with Flutter

Is there a way to build such an effect with Flutter by navigate from one page to another?
Do you have an idea to build an effect like that? I would post code examples, but I really have no idea how to do anything like this...
I think the navigations between those pages are the Hero Animations.
As for another transition, you can use this package.
I hope it will help you.
You can Hero Widget to achieve this.
In the first screen wrap your image with Hero widget and provide it with a tag.
In the second screen wrap your image with Hero widget and provide it with the same tag.
Hero(
tag: 'firstImage'
child: Image.asset('images/1.png'),
)
You can watch the Hero widget video in the Flutter widget of week https://www.youtube.com/watch?v=Be9UH1kXFDw&feature=emb_logo.
To read more about the hero widget, you can checkout https://flutter.dev/docs/development/ui/animations/hero-animations.