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
static const platform = const MethodChannel('repoInfo/details'); |
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
# Path to the flutter component | |
flutter_application_path = '/flutter/withExtApps/flutter_gh_detail' | |
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb') | |
install_all_flutter_pods(flutter_application_path) |
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
$ path/my_flutter_component | |
$ flutter build aar |
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
object HomeConfigurator { | |
fun configureFragment(fragment: HomeFragment) { | |
val router = HomeRouter() | |
router.fragment = WeakReference(fragment) | |
val presenter = HomePresenter() | |
presenter.output = WeakReference(fragment) |
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
private fun getUserInfo() { | |
apolloClient.query(UserAndFollowersInfoQuery | |
.builder() | |
.login(userName) | |
.build()) | |
.enqueue(object : ApolloCall.Callback<UserAndFollowersInfoQuery.Data>() { | |
override fun onFailure(e: ApolloException) { | |
Log.d(TAG,e.message.toString()) |
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
query UserAndFollowersInfo ($login: String!) { | |
user(login: $login) { | |
repositories(first: 5, orderBy: {field: STARGAZERS, direction: DESC}) { | |
nodes { | |
repoName: name | |
repoUrl: url | |
description | |
} | |
} | |
following(first:5){ |
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
@Test | |
fun homeRouter_determineNextScreen_when_pastTripIs_Input() { | |
// Given | |
val homeRouter = HomeRouter() | |
val flightList = ArrayList<FlightViewModel>() | |
val flight1 = FlightViewModel( | |
flightName = "9Z 231", startingTime = "2017/12/31", departureCity = "BLR", arrivalCity = "CJB", | |
departureTime = "18:10", arrivalTime = "19:00") | |
flightList.add(flight1) |
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
internal interface HomeRouterInput { | |
fun determineNextScreen(position: Int): Fragment | |
fun passDataToNextScene(position: Int, nextFragment: Fragment) | |
} | |
class HomeRouter : HomeRouterInput, AdapterView.OnItemClickListener { | |
var fragment: WeakReference<HomeFragment>? = null | |
var currentTime: Calendar? = null | |
get() = if (field == null) Calendar.getInstance() else field |
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
@Test | |
fun verify_HomePresenter_getDaysDiff_is_CalculatedCorrectly_ForFutureTrips() { | |
// Given | |
val homePresenter = HomePresenter() | |
val homeResponse = HomeResponse() | |
val flightsList = ArrayList<FlightModel>() | |
val flight1 = FlightModel( | |
flightName = "9Z 231", |
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
@Test | |
fun presentHomeMetaData_with_validInput_shouldCall_displayHomeData() { | |
// Given | |
val homePresenter = HomePresenter() | |
val homeResponse = HomeResponse() | |
homeResponse.listOfFlights = FlightWorker().futureFlights | |
val homeFragmentInputSpy = HomeFragmentInputSpy() | |
homePresenter.output = WeakReference(homeFragmentInputSpy) |