This file contains hidden or 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:async'; | |
void main() { | |
int count = 0; | |
var counterController = new StreamController(); | |
counterController.stream.listen((value) => print(value)); | |
void increment() { | |
counterController.add(count++); | |
} |
This file contains hidden or 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
void main() { | |
var one = enumString.HELLO; | |
print(one); | |
if(one == enumString.HELLO) | |
print("$one, Jonathan!"); | |
} | |
class enumString{ | |
static const HELLO="hello"; | |
} |
This file contains hidden or 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
main() { | |
// ?? operator | |
print("\n?? operator \n"); | |
var x; // x is null | |
String otherExp = "x is null"; | |
print(x ?? otherExp); // returns otherExp, which is a String, to print. | |
var isXNull = x ?? true; | |
print(isXNull); | |
//is the same as |
This file contains hidden or 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
#! /bin/sh | |
if [ -z "$1" ] | |
then | |
echo "Please enter a channel name after \"flutter_update\"" | |
else | |
cd ~/development/flutter/ | |
git pull | |
flutter channel $1 | |
fi |
This file contains hidden or 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 java.nio.file.Path | |
import java.nio.file.Paths | |
import com.android.builder.model.AndroidProject | |
import org.apache.tools.ant.taskdefs.condition.Os | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.GradleException | |
import org.gradle.api.Project | |
import org.gradle.api.Plugin | |
import org.gradle.api.Task |
This file contains hidden or 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
main(){ | |
String number = "3231234545"; | |
String xedNumber=""; | |
for(int i = 0; i < number.length; i++){ | |
if(i > 2 && i< number.length - 2) | |
xedNumber += "x"; | |
else | |
xedNumber += number[i]; | |
} | |
print(xedNumber); |
This file contains hidden or 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
class _MyHomePageState extends State<MyHomePage> { | |
int _counter = 0; | |
void _incrementCounter() { | |
setState(() { | |
// This call to setState tells the Flutter framework that something has | |
// changed in this State, which causes it to rerun the build method below | |
// so that the display can reflect the updated values. If we changed | |
// _counter without calling setState(), then the build method would not be | |
// called again, and so nothing would appear to happen. |
This file contains hidden or 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
Card( | |
color: backgroundColor, | |
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 5), | |
child: Padding( | |
padding: const EdgeInsets.only( | |
left: 15, | |
right: 5, | |
top: 8, | |
bottom: 8), //symmetric(vertical: 8.0, horizontal: 15), | |
child: new Row( |
This file contains hidden or 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
FAILURE: Build failed with an exception. | |
* What went wrong: | |
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. | |
> Could not find com.google.android.exoplayer:exoplayer-hls:2.9.1. | |
Searched in the following locations: | |
- file:/Users/thinkdigital/Library/Android/sdk/extras/m2repository/com/google/android/exoplayer/exoplayer-hls/2.9.1/exoplayer-hls-2.9.1.pom | |
- file:/Users/thinkdigital/Library/Android/sdk/extras/m2repository/com/google/android/exoplayer/exoplayer-hls/2.9.1/exoplayer-hls-2.9.1.jar | |
- file:/Users/thinkdigital/Library/Android/sdk/extras/google/m2repository/com/google/android/exoplayer/exoplayer-hls/2.9.1/exoplayer-hls-2.9.1.pom | |
- file:/Users/thinkdigital/Library/Android/sdk/extras/google/m2repository/com/google/android/exoplayer/exoplayer-hls/2.9.1/exoplayer-hls-2.9.1.jar |
This file contains hidden or 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
void main() async { | |
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); | |
runApp(MyApp()); | |
… | |
} |