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:convert'; | |
void main() { | |
final stringifiedJson = '{"id": "1", "name": "ford", "description": "fast car", "roof_material": "glass", "some_other_prop": "hello"}'; | |
final json = jsonDecode(stringifiedJson); | |
final cabrio = Car.fromJson(json, 'cabrio') as Cabrio; | |
print('Roof material: ${cabrio.roofMaterial}'); // null | |
print('Some other prop: ${cabrio.someOtherProp}'); | |
} |
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:fluttery_audio/fluttery_audio.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MaterialApp(home: new ExampleApp())); | |
} | |
class ExampleApp extends StatefulWidget { | |
@override | |
_ExampleAppState createState() => new _ExampleAppState(); |
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:flute_music_player/flute_music_player.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MaterialApp(home: new ExampleApp())); | |
} | |
class ExampleApp extends StatefulWidget { | |
@override | |
_ExampleAppState createState() => new _ExampleAppState(); |
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:audioplayers/audio_cache.dart'; | |
import 'package:audioplayers/audioplayers.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MaterialApp(home: new ExampleApp())); | |
} | |
class ExampleApp extends StatefulWidget { | |
@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
import 'package:flutter/material.dart'; | |
import 'package:assets_audio_player/assets_audio_player.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => _MyAppState(); | |
} |
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
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
body: new Container( | |
padding: EdgeInsets.all(20.0), | |
child: new Form( | |
key: this._formKey, | |
child: new Column( | |
mainAxisAlignment: MainAxisAlignment.center, |
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
#!/bin/sh | |
# Created by Mark O'Sullivan - 30th January 2016 | |
# Update everything | |
apt-get -y update | |
apt-get -y dist-upgrade | |
# Adding packages | |
sudo add-apt-repository -y ppa:webupd8team/java |
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
Just a reminder for future projects that these are the sizes needed in the mipmap directories. | |
mipmap-mdpi = 48x48 | |
mipmap-hdpi = 72x72 | |
mipmap-xhdpi = 96x96 | |
mipmap-xxhdpi = 144x144 |