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
version: 2.1 | |
jobs: | |
ios_distribute_beta: | |
macos: | |
xcode: "10.3.0" | |
working_directory: ~/flutter-app | |
steps: | |
- add_ssh_keys: | |
fingerprints: | |
- "ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab" |
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'; | |
class Bubble extends StatelessWidget { | |
Bubble({this.message, this.time, this.delivered, this.isMe}); | |
final String message, time; | |
final delivered, isMe; | |
@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:typed_data'; | |
void main() { | |
// Source | |
String source = 'Hello! Cześć! 你好! ご挨拶!Привет! ℌ𝔢𝔩𝔩𝔬! 🅗🅔🅛🅛🅞!'; | |
print(source.length.toString() + ': "' + source + '" (' + source.runes.length.toString() + ')'); | |
// String (Dart uses UTF-16) to bytes | |
var list = new List<int>(); |
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
class ScreenOne extends StatefulWidget { | |
@override | |
_ScreenOneState createState() => _ScreenOneState(); | |
} | |
class _ScreenOneState extends State<ScreenOne> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( |
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
echo 'export ENV_VAR=12345' >> ~/.zshenv | |
echo $ENV_VAR // perform on relaunch of zsh to check if everything is set properly. | |
12345 |
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
// Note that you can call this code in a script | |
// so that you can simply call the script at the start of each room. | |
// You can even add a final piece of code to have this | |
// automatically set all the views in all your rooms | |
// so that you only need to call it once at the start of the game. | |
// This code will just loop through every room in your game, destroy the default camera, | |
// and then create a new camera that is correct for the display size and aspect ratio, | |
// as well as enable a viewport in the room for the camera to act on. | |
var _check = true; |
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:async'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
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
A typical install of OS X won't create a .bash_profile for you. When you want to run functions from your command line, this is a must-have. | |
Start up Terminal | |
Type "cd ~/" to go to your home folder | |
Type "touch .bash_profile" to create your new file. | |
Edit .bash_profile with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit. | |
Type ". .bash_profile" to reload .bash_profile and update any functions you add. | |
/* |
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
class ApiService { | |
static let sharedInstance = ApiService() | |
let BASE_URL = "https://restcountries.eu" | |
// MARK: - List of countries | |
func countries(_ completion: @escaping(_ result: [Country]?, _ error: Error?) -> Void) { | |
let urlString = BASE_URL + "/rest/v2/all" |
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
sudo xcode-select --reset | |
swift build | |
// The whole process | |
swift package init --type executable | |
swift build | |
swift run <app-name> |