Flutter Analysis and Practice: Design of the Statistical Framework

4.1.1 What Is User Behavior Tracking?

Figure 4–1

4.1.2 User Behavior Tracking in Flutter

4.1.2.1 A Proposed Solution

4.1.2.2 Xianyu In-House Solution

Figure 4–2
Figure 4–3

4.1.3 Placement Exposure

Figure 4–4
//监听容器滚动,得到容器的偏移量
double _scrollContainerOffset = scrollNotification.metrics.pixels;
//曝光坑位Widget的context
final RenderObject childRenderObject = context.findRenderObject();
final RenderAbstractViewport viewport = RenderAbstractViewport.of (childRenderObject);
if (viewport == null) {
return;
}
if (!childRenderObject.attached) {
return;
}
//曝光坑位在容器内的偏移量
final RevealedOffset offsetToRevealTop = viewport.getOffsetToReveal (childRenderObject, 0.0);
if (当前坑位是invisible && 曝光比例 >= 0.5) {
// 记录当前坑位是visible状态
// 记录出现时间
} else if (当前坑位是visible && 曝光比例 < 0.5) {
// 记录当前坑位是invisible状态
if (当前时间-出现时间 > 500ms) {
// 调用曝光埋点接口
}
}
Figure 4–5

Original Source:

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How we decoupled application development with AOSP development?

Android guide: Broadcast receiver

ML in Android -3 : Deploy Tflite on Android using Java

Differences and Advantages of Hilt, Dagger2, Koin — 1

Flutter. NavigationRail playground

New APIs in the Android Gradle Plugin

The mystery of ConstraintLayout

How To Resize Images To Support Different Screen Sizes For An Android App

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Distribute your Flutter Application with Azure DevOps and App Center

Integrate push notifications using Amazon SNS, Firebase, & Flutter

Running integration tests as part of MRs for Add-to-App flutter apps

Scheduling FCM in Flutter