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
| 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 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 DebounceLiveData<Source>( | |
| private val source: LiveData<Source>, | |
| private val debounceMs: Long | |
| ) : LiveData<Source>(), CoroutineScope { | |
| private val job = SupervisorJob() | |
| override val coroutineContext: CoroutineContext | |
| get() = Dispatchers.Main + job | |
| private var debounceJob: Job? = null | |
| private val observer = Observer<Source> { source -> |
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
| image: node:10 | |
| build: | |
| stage: build | |
| cache: | |
| paths: | |
| - node_modules/ | |
| script: | |
| - npm install --quiet | |
| - npm run build-prod |
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 React from 'react'; | |
| import { shallow } from 'enzyme'; | |
| const Item = text => <p>Item {text}</p>; | |
| const Composition = ({ showB }) => ( | |
| <p> | |
| <Item text="A" /> | |
| {showB && <Item text="B" />} | |
| </p>); |
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
| abstract class LoadingBaseState<T extends StatefulWidget> extends State<T> { | |
| bool _isLoading = false; | |
| bool _hasUser = false; | |
| String _title = ""; | |
| @override | |
| Widget build(BuildContext context) => new Scaffold( | |
| appBar: new AppBar( | |
| title: new Text(_title), |
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
| stages: | |
| - beta | |
| variables: | |
| LC_ALL: "en_US.UTF-8" | |
| LANG: "en_US.UTF-8" | |
| test_flight_build: | |
| dependencies: [] | |
| stage: beta |
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
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
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
| interface LoginContracts { | |
| interface View { | |
| fun showError(message: String) | |
| } | |
| interface Presenter { | |
| fun onDestroy() | |
| fun onLoginButtonPressed(username: String, password: String) | |
| } | |
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
| package <you_package>.data.api; | |
| import android.content.Context; | |
| import android.support.annotation.NonNull; | |
| import com.google.gson.ExclusionStrategy; | |
| import com.google.gson.FieldAttributes; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; |
NewerOlder