Skip to content

Commit cb29948

Browse files
authored
Initial memory leak case study. (#1063)
* Initial memory leak case study. * Code cleanup. * More more leak added.
1 parent 12a8168 commit cb29948

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2045
-0
lines changed

case_study/memory_leak/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
.atom/
3+
.idea
4+
.packages
5+
.pub/
6+
build/
7+
ios/.generated/
8+
packages
9+
pubspec.lock
10+
.flutter-plugins

case_study/memory_leak/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Using Tab Bar
2+
3+
A material design widget that displays a horizontal row of tabs.
4+
5+
Read [[Documentation](https://docs.flutter.io/flutter/material/TabBar-class.html)] [[Material Design Spec](https://material.io/guidelines/components/tabs.html)]
6+
7+
<img src="demo_img.gif" height="600em" />
8+
9+
10+
## Getting Started
11+
12+
For help getting started with Flutter, view online [documentation](http://flutter.io/).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
GeneratedPluginRegistrant.java
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withInputStream { stream ->
5+
localProperties.load(stream)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
apply plugin: 'com.android.application'
15+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
16+
17+
android {
18+
compileSdkVersion 28
19+
20+
21+
lintOptions {
22+
disable 'InvalidPackage'
23+
}
24+
25+
defaultConfig {
26+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
27+
applicationId "github.nisrulz.usingtabs"
28+
minSdkVersion 16
29+
targetSdkVersion 28
30+
versionCode 1
31+
versionName "1.0"
32+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
33+
}
34+
35+
buildTypes {
36+
release {
37+
// TODO: Add your own signing config for the release build.
38+
// Signing with the debug keys for now, so `flutter run --release` works.
39+
signingConfig signingConfigs.debug
40+
}
41+
}
42+
}
43+
44+
flutter {
45+
source '../..'
46+
}
47+
48+
dependencies {
49+
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
50+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
51+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
52+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="github.nisrulz.usingtabs">
3+
4+
<!-- The INTERNET permission is required for development. Specifically,
5+
flutter needs it to communicate with the running application
6+
to allow setting breakpoints, to provide hot reload, etc.
7+
-->
8+
<uses-permission android:name="android.permission.INTERNET"/>
9+
10+
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
11+
calls FlutterMain.startInitialization(this); in its onCreate method.
12+
In most cases you can leave this as-is, but you if you want to provide
13+
additional functionality it is fine to subclass or reimplement
14+
FlutterApplication and put your custom class here. -->
15+
<application android:name="io.flutter.app.FlutterApplication" android:label="using_tabs" android:icon="@mipmap/ic_launcher">
16+
<activity android:name=".MainActivity"
17+
android:launchMode="singleTop"
18+
android:theme="@android:style/Theme.Black.NoTitleBar"
19+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
20+
android:hardwareAccelerated="true"
21+
android:windowSoftInputMode="adjustResize">
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN"/>
24+
<category android:name="android.intent.category.LAUNCHER"/>
25+
</intent-filter>
26+
</activity>
27+
</application>
28+
</manifest>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package github.nisrulz.usingtabs;
2+
3+
import android.os.Bundle;
4+
5+
import io.flutter.app.FlutterActivity;
6+
import io.flutter.plugins.GeneratedPluginRegistrant;
7+
8+
public class MainActivity extends FlutterActivity {
9+
@Override
10+
protected void onCreate(Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
GeneratedPluginRegistrant.registerWith(this);
13+
}
14+
}
544 Bytes
Loading
442 Bytes
Loading
721 Bytes
Loading
1.01 KB
Loading

0 commit comments

Comments
 (0)