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:http/http.dart' as http; | |
import './api_request.dart'; | |
import './api_error.dart'; | |
import './api_method.dart'; | |
abstract class APIClientInterface { | |
Future<T> call<T>(APIRequest<T> request); | |
} |
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:bloc/bloc.dart'; | |
import 'package:equatable/equatable.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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 | |
// MARK: - Entity | |
struct HogeEntity { | |
let title: String | |
} | |
struct FugaEntity { | |
let title: 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
import UIKit | |
import PlaygroundSupport | |
// MARK: - Settings | |
let allSize: CGFloat = 200 | |
let radius: CGFloat = 24.0 | |
let smallRadius: CGFloat = 20.0 | |
let nanoRadius: CGFloat = 16.0 |
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 | |
final class CodeViewController: UIViewController { | |
// MARK: - UI | |
lazy var titleLabel: UILabel = { | |
let label = UILabel() | |
label.translatesAutoresizingMaskIntoConstraints = false | |
label.font = UIFont.boldSystemFont(ofSize: 18) |
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 | |
final class StoryboardViewController: UIViewController { | |
// MARK: - Lifecycle | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} |
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
// | |
// FirebaseProvider.swift | |
// MlKitSample | |
// | |
import Foundation | |
import Firebase | |
import FirebaseMLCommon | |
final class FirebaseMLKitProvider { |
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
/// HttpRequest: | |
/// Dart の基本の Request クラスを HttpRequestProtocol で拡張したもの | |
class HttpRequest extends Request { | |
final HttpRequestProtocol service; | |
HttpRequest(this.service) | |
: super( | |
service.method.value, | |
Uri.parse('${service.baseUrl}${service.path}${service.queryParameters}') | |
); |
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
/// HttpMethod: | |
/// リクエストのメソッドを定義 | |
/// Enum は Swift っぽくかける Util を使用 | |
class HttpMethod extends Enum<String> { | |
const HttpMethod(String val): super(val); | |
static const HttpMethod GET = const HttpMethod('GET'); | |
static const HttpMethod POST = const HttpMethod('POST'); | |
static const HttpMethod PUT = const HttpMethod('PUT'); | |
static const HttpMethod DELETE = const HttpMethod('DELETE'); |
NewerOlder