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 AppTextTheme { | |
/// https://material.io/design/typography/the-type-system.html#type-scale - Helps to create textTheme | |
static TextTheme get textTheme => textThemeSourceSansPro; | |
static TextTheme textThemeSourceSansPro = TextTheme( | |
headline1: TextStyle( | |
fontFamily: 'Metropolis', | |
fontSize: 96, | |
fontWeight: FontWeight.w300, |
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 AppColorScheme { | |
static ColorScheme get colorScheme => colorSchemeLight; | |
static final ColorScheme colorSchemeLight = ColorScheme.fromSwatch( | |
brightness: Brightness.light, | |
backgroundColor: white, | |
accentColor: accentColor, | |
primarySwatch: primarySwatch, | |
); |
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 Repository { | |
final ApiClient _myApiClient; | |
final ToDoDao _dao; | |
Repository(this._remoteDataSource, this._localDataSource); | |
@override | |
Stream<Resource<List<ToDoItem>>> toDoItemsStream() { | |
return NetworkBoundResources<List<ToDoItem>,List<ToDoItem>>() |
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 NetworkBoundResource<ResultType, RequestType> { | |
StreamController<Resource<ResultType>> _result; | |
Stream<Resource<ResultType>> asStream({ | |
@required Stream<ResultType> loadFromDb(), | |
@required bool shouldFetch(ResultType data), | |
@required Future<RequestType> createCall(), | |
@required ResultType processResponse(RequestType result), | |
@required Future saveCallResult(RequestType item), |
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 Resource<T> { | |
final Status status; | |
final T data; | |
final String message; | |
final Exception error; | |
const Resource({this.data, @required this.status, this.message, this.error}); | |
static Resource<T> loading<T>({T data}) => |
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
public class CommonUtilities { | |
public static final String SERVER = "https://x.wobbi.com.br/"; | |
public static final String SERVER_FOLDER_PATH = ""; | |
public static final String SERVER_WEBSERVICE_PATH = SERVER_FOLDER_PATH + "webservice.php"; | |
public static final String SERVER_URL = SERVER + SERVER_FOLDER_PATH; | |
public static final String SERVER_URL_WEBSERVICE = SERVER + SERVER_WEBSERVICE_PATH + "?"; | |
public static final String SERVER_URL_PHOTOS = SERVER_URL + "webimages/"; | |
public static final String TOLLURL = "https://tce.cit.api.here.com/2/calculateroute.json?app_id="; | |
public static final String PROVIDER_PHOTO_PATH = SERVER_URL_PHOTOS + "upload/Driver/"; |
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:io'; | |
import 'package:firebase_storage/firebase_storage.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:hotaru_car/src/models/car_ad.dart'; | |
import 'package:hotaru_car/src/models/collections_mapper.dart'; | |
import 'package:hotaru_car/src/models/response/user_response.dart'; | |
import 'package:hotaru_car/src/models/user.dart'; |
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
package br.net.ouroverde.agendamentoleves.utils; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import br.net.ouroverde.agendamentoleves.R; |
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
public LiveData<MyObject> getMyObject(){ | |
if(mylivedata == null){ | |
mylivedata = new MutableLiveData<MyObject>; | |
doHttpRequest(); | |
} | |
return mylivedata; | |
} |
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
fbLoginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { | |
@Override | |
public void onSuccess(LoginResult loginResult) { | |
GraphRequest request = GraphRequest.newMeRequest( | |
loginResult.getAccessToken(), | |
(object, response) -> { | |
navigationController.navigateToRegister(BeforeHomeActivity.this,response.getJSONObject()); | |
finish(); | |
}); |