This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_redux/flutter_redux.dart'; | |
import 'package:redux/redux.dart'; | |
class $NAME$Page extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return StoreConnector<$END$AppState, $NAME$ViewModel>( | |
converter: (store) => $NAME$ViewModel(store), | |
builder: (context, viewModel) => _$NAME$Page(viewModel), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Create new Page with Redux template": { | |
"prefix": "redux", | |
"body": [ | |
"import 'package:flutter/material.dart';", | |
"import 'package:flutter_redux/flutter_redux.dart';", | |
"import 'package:redux/redux.dart';", | |
"class ${1:name}Page extends StatelessWidget {", | |
" @override", | |
" Widget build(BuildContext context) {", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold(body: AdaptableRow()), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
home: Home(user: User()), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class RxJavaLeakActivity extends AppCompatActivity { | |
private Subscription pokemonSubscription; | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class SensorManagerLeakActivity extends AppCompatActivity implements SensorEventListener { | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); | |
Sensor lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class AnonymousClassLeakActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
new AsyncTask<Void, Void, Void>() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class InnerClassLeakActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
InnerClass innerClassInstance = new InnerClass(); | |
innerClassInstance.showToast(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
import android.content.Context; | |
import android.widget.Toast; | |
public class StaticContextLeak { | |
private static Context context; | |
public void setContext(final Context context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable<CatWithToys> catWithToysObservable = | |
getCatObservable() | |
.flatMap((cat) -> getToysForCatObservable(cat), | |
(cat, toys) -> new CatWithToys(cat, toys)); |
NewerOlder