Skip to content

Instantly share code, notes, and snippets.

View alfianlosari's full-sized avatar
📱
Xcoding with Alfian | https://alfianlosari.com

Alfian Losari alfianlosari

📱
Xcoding with Alfian | https://alfianlosari.com
View GitHub Profile
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() => _HomeState();
}
class _HomeState extends State<Home> {
List<Repo> _repos = List();
bool _isFetching = false;
class GithubItem extends StatelessWidget {
final Repo repo;
GithubItem(this.repo);
@override
Widget build(BuildContext context) {
return Card(
child: InkWell(
highlightColor: Colors.lightBlueAccent,
splashColor: Colors.red,
import 'package:github_search/repo.dart';
import 'package:date_format/date_format.dart';
import 'dart:convert' show json, utf8;
import 'dart:io';
import 'dart:async';
class Api {
static final HttpClient _httpClient = HttpClient();
static final String _url = "api.github.com";
class Repo {
final String htmlUrl;
final int watchersCount;
final String language;
final String description;
final String name;
final String owner;
Repo(this.htmlUrl, this.watchersCount, this.language, this.description,
this.name, this.owner);
import 'package:flutter/material.dart';
import 'package:github_search/api.dart';
import 'package:github_search/repo.dart';
import 'package:github_search/item.dart';
import 'dart:async';
class SearchList extends StatefulWidget {
SearchList({Key key}) : super(key: key);
@override
import 'package:github_search/repo.dart';
import 'package:date_format/date_format.dart';
import 'dart:convert' show json, utf8;
import 'dart:io';
import 'dart:async';
class Api {
static final HttpClient _httpClient = HttpClient();
static final String _url = "api.github.com";
import Foundation
class EmailModel {
static let valueDidChange = Notification.Name("valueDidChange")
static let isValidDidChange = Notification.Name("isValidDidChange")
static private let regexEmail = "[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}"
init(value: String) {
self.value = value
import Foundation
class EmailViewModel: NSObject {
private let emailModel: EmailModel
@objc dynamic var emailTextValue: String
@objc dynamic var isValidValue: Bool
private var emailTextObserver: NSObjectProtocol?
private var isValidObserver: NSObjectProtocol?
import UIKit
class ViewController: UITableViewController {
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var emailValidationLabel: UILabel!
let emailViewModel = EmailViewModel(emailModel: EmailModel(value: ""))
var emailTextObserver: NSObjectProtocol?
var isValidEmailObserver: NSObjectProtocol?
import express, { Router, Request } from 'express';
import admin from 'firebase-admin';
admin.initializeApp({
credential: admin.credential.applicationDefault()
});
const db = admin.firestore();
const router = Router()
router.get('/', async (req, res, next) => {