Skip to content

Instantly share code, notes, and snippets.

View inan-mahmud's full-sized avatar
🎯
Focusing

Md. Inan Mahmud inan-mahmud

🎯
Focusing
View GitHub Profile
public class EventDataSourceFactory extends DataSource.Factory {
private String date;
private Context context;
private MutableLiveData<PageKeyedDataSource<Integer, EventsItem>> liveDataSource = new MutableLiveData<>();
public EventDataSourceFactory(String date, Context context) {
this.date = date;
this.context = context;
}
public class EventDataSource extends PageKeyedDataSource<Integer, EventsItem> {
public static final int FIRST_PAGE = 0;
private RestRepository restRepository;
private String date;
private CompositeDisposable disposable;
private MutableLiveData<Resource> resource = new MutableLiveData<>();
package com.unitor.foodhub.paging.daily;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;
import androidx.paging.PageKeyedDataSource;
import com.unitor.foodhub.data.Resource;
public class EventDataSource extends PageKeyedDataSource<Integer, EventsItem> {
private String date;
private int sourceIndex = 0;
private Context context;
private ApiInterface apiInterface;
private MutableLiveData<Resource> liveData = new MutableLiveData<>();
private MutableLiveData<List<EventsItem>> itemMutableLiveData = new MutableLiveData<>();
import 'package:flutter/material.dart';
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart';
import 'package:hub_food_park/utils/constants.dart';
import 'package:intl/intl.dart';
class FirstScreen extends StatefulWidget {
@override
State<StatefulWidget> createState() {
// TODO: implement createState
public class Contact {
private String name;
private int id;
private String phoneNumber;
@Override
public String toString() {
return "Contact{" +
"name='" + name + '\'' +
", id=" + id +
@inan-mahmud
inan-mahmud / Animal.java
Created November 11, 2019 18:16
Inheritance
public class Animal {
private String breed;
private String name;
private String color;
private int age;
private int size;
public Animal(String breed, String name, String color, int age, int size) {
this.breed = breed;
this.name = name;
package com.company;
public class Main {
public static void main(String[] args) {
Person mPerson = new Person("Sayeed","Robin","0134234432","[email protected]");
mPerson.printName();
System.out.println(mPerson.getEmailAddress());
public interface ExtraCurriculum {
void debate();
void takeQuiz();
void speech();
}
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:http/http.dart' as http;
import 'package:hub_food_park/network/network_helper.dart';
import 'package:hub_food_park/pojos/event/event_item.dart';
import 'package:hub_food_park/pojos/event/event_result.dart';