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/rendering.dart'; | |
typedef OverflowCallback = void Function(double minimalHeight); | |
class RenderOverflowFallback extends RenderMetaData { | |
bool shouldClip = false; | |
@override | |
void performLayout() { |
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 Foundation | |
typealias ApiCallback<Output> = Optional<(Result<Output, Error>) -> Void> | |
protocol EndpointClient { | |
func execute<Output>(endpoint: Endpoint<Output>, onResult: ApiCallback<Output>) | |
} | |
struct RequestBuilder { | |
var path: String = "" |
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
// | |
// main.swift | |
// Completions | |
// | |
// Created by szotp on 30/06/2019. | |
// Copyright © 2019 szotp. All rights reserved. | |
// | |
import Foundation |
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 Foundation | |
struct StringCodingKey: CodingKey { | |
let stringValue: String | |
init?(stringValue: String) { | |
self.stringValue = stringValue | |
} | |
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 'dart:ui'; | |
import 'package:flutter/widgets.dart'; | |
// Usage: | |
Future<void> main() async { | |
await precacheImageCustom(SplashPage.image); | |
await precacheImageCustom(LoginPage.backgroundImage); | |
runApp(App()); |
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 { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |
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 Foundation | |
/// If T is a struct, then this class provides thread safety, because all reads and writes happen inside queue. | |
/// But, if T is very big, copying it may decrease performance. | |
class SafeAccess<T> { | |
private let queue = DispatchQueue(label: "Safe") | |
private var _value: T | |
init(_ value: T) { | |
_value = value |
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 UIKit | |
protocol ModelProtocol { | |
} | |
class ModelA: ModelProtocol { | |
} |
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 BaseViewController : UIViewController { | |
@available(*, deprecated, message: "Use coordinator.") | |
override var navigationController: UINavigationController? { | |
return super.navigationController | |
} | |
@available(*, deprecated, message: "Use coordinator.") | |
override var presentedViewController: UIViewController? { | |
return super.presentedViewController | |
} |