Why is it that there is anOption.expect(M)
, but noResult.expect(M)
?
I opened a pull request [pr] which put this in, and it turns out the reason there is no expect
function is because you are intended to use composition:
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MyApp()); | |
} | |
class SandyShores extends StatelessWidget { | |
static String routeName = "sandyShores"; | |
@override |
class AppRestService : IAppRestService { | |
override fun getAppRestService(): IRestService { | |
val httpClient = OkHttpClient().newBuilder() | |
val interceptor = Interceptor { chain -> | |
val request = chain?.request()?.newBuilder()?.addHeader("SomeHeader", "SomeHeaderProperty")?.build(); | |
chain?.proceed(request) | |
} | |
httpClient.networkInterceptors().add(interceptor) | |
val customGson = GsonBuilder().registerTypeAdapter(MyClassCloud::class.java, MyClassCloudDeserializer("1")).create() | |
val retrofit = Retrofit.Builder().baseUrl(IRestService.URL_BASE).addConverterFactory(GsonConverterFactory.create(customGson)).client(httpClient.build()).build() |
Why is it that there is anOption.expect(M)
, but noResult.expect(M)
?
I opened a pull request [pr] which put this in, and it turns out the reason there is no expect
function is because you are intended to use composition: