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 'package:meta/meta.dart'; | |
import 'package:equatable/equatable.dart'; | |
class LoginState extends Equatable { | |
final bool isLoading; | |
final bool isLoginButtonEnabled; | |
final String error; | |
final String token; | |
LoginState({ |
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 'package:meta/meta.dart'; | |
import 'package:equatable/equatable.dart'; | |
abstract class AuthenticationState extends Equatable { | |
AuthenticationState([Iterable props]) : super(props); | |
} | |
class AuthenticationUninitialized extends AuthenticationState { | |
@override | |
String toString() => 'AuthenticationUninitialized'; |
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 Person { | |
final String name; | |
final int age; | |
const Person({this.name, this.age}); | |
} |
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
void main() { | |
final Person bob = Person(name: "Bob", age: 40); | |
} |
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
void main() { | |
final Person bob = Person(name: "Bob", age: 40); | |
print(bob == Person(name: "Bob", age: 40)); // false | |
} |
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 Person { | |
final String name; | |
final int age; | |
const Person({this.name, this.age}); | |
@override | |
bool operator ==(Object other) => | |
identical(this, other) || | |
other is Person && |
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
name: common_github_search | |
description: Shared Code between AngularDart and Flutter | |
version: 1.0.0+1 | |
environment: | |
sdk: ">=2.0.0-dev.68.0 <3.0.0" | |
dependencies: | |
meta: ^1.1.7 | |
bloc: ^0.8.0 |
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:convert'; | |
import 'package:http/http.dart' as http; | |
import 'package:common_github_search/common_github_search.dart'; | |
class GithubClient { | |
final String baseUrl; | |
final http.Client httpClient; |
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 'package:common_github_search/common_github_search.dart'; | |
class SearchResult { | |
final List<SearchResultItem> items; | |
const SearchResult({this.items}); | |
static SearchResult fromJson(Map<String, dynamic> json) { | |
final items = (json['items'] as List<dynamic>) | |
.map((dynamic 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
import 'package:common_github_search/common_github_search.dart'; | |
class SearchResultItem { | |
final String fullName; | |
final String htmlUrl; | |
final GithubUser owner; | |
const SearchResultItem({this.fullName, this.htmlUrl, this.owner}); | |
static SearchResultItem fromJson(dynamic json) { |