Skip to content

Instantly share code, notes, and snippets.

View kmmraj's full-sized avatar

Mohanraj kmmraj

  • Bengaluru
View GitHub Profile
static const platform = const MethodChannel('repoInfo/details');
@kmmraj
kmmraj / Podfile
Last active December 11, 2019 04:58
# 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)
@kmmraj
kmmraj / buildarr.sh
Last active December 11, 2019 04:59
$ path/my_flutter_component
$ flutter build aar
object HomeConfigurator {
fun configureFragment(fragment: HomeFragment) {
val router = HomeRouter()
router.fragment = WeakReference(fragment)
val presenter = HomePresenter()
presenter.output = WeakReference(fragment)
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())
query UserAndFollowersInfo ($login: String!) {
user(login: $login) {
repositories(first: 5, orderBy: {field: STARGAZERS, direction: DESC}) {
nodes {
repoName: name
repoUrl: url
description
}
}
following(first:5){
@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)
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
@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",
@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)