Skip to content
This repository was archived by the owner on Feb 21, 2021. It is now read-only.

Commit add11cf

Browse files
committed
Initial commit.
0 parents  commit add11cf

33 files changed

+584
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.pub/
2+
.packages
3+
pubspec.lock

.travis.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# See https://docs.travis-ci.com/user/languages/dart
2+
language: dart
3+
sudo: false
4+
dart:
5+
- dev
6+
- stable
7+
8+
# Avoid re-downloading packages across different builds if possible.
9+
cache:
10+
directories:
11+
- $HOME/.pub-cache
12+
13+
# We are using some non-standard setup, so install Dartium and Xvfb manually.
14+
before_install:
15+
- tool/travis.sh
16+
- sh -e /etc/init.d/xvfb start
17+
- sleep 3
18+
19+
# Check for analysis issues, run the test cases, and ensure `dartfmt` is run.
20+
dart_task:
21+
- dartanalyzer
22+
- dartfmt
23+
24+
# Run our component tests.
25+
script:
26+
- pub run angular_test -p dartium
27+
28+
# The Dart language is constantly being worked on, and sometimes the dev and
29+
# stable builds don't agree on what is considered formatted or what is analysis
30+
# warning free (though this does not effect _using_ the library, likely).
31+
#
32+
# We exclude `dev` from analysis and formatting checks.
33+
matrix:
34+
exclude:
35+
- dart: dev
36+
dart_task: dartfmt
37+
- dart: dev
38+
dart_task: dartanalyzer

AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Matan Lurey/Google Inc. <matanl@google.com>

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
- Initial commit of `GoogleSignInComppnent`.

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright 2017, Google Inc. All rights reserved.
2+
Redistribution and use in source and binary forms, with or without
3+
modification, are permitted provided that the following conditions are
4+
met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of package:dom nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<p align="center">
2+
<h1 align="center">angular_fire</h1>
3+
<p align="center">
4+
An <em>unofficial</em> library for <a href="https://webdev.dartlang.org/angular">AngularDart</a> and <a href="https://firebase.google.com">Firebase</a>.
5+
</p>
6+
</p>
7+
8+
* [Install](#install)
9+
* [Usage](#usage)
10+
* [Components](#components)
11+
* [GoogleSignInComponent](#google-sign-in-component)
12+
* [Contributing](#contributing)
13+
* [Testing](#testing)
14+
15+
## Install
16+
17+
The current stable release of `angular_fire` works best with the following:
18+
19+
```yaml
20+
dependencies:
21+
angular2: ^3.1.0
22+
angular_fire: ^0.1.0
23+
firebase: ^3.1.0
24+
```
25+
26+
To get started, you need to, at minimum, include the Firebase SDK:
27+
28+
```html
29+
<body>
30+
<script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script>
31+
</body>
32+
```
33+
34+
<!-- TODO: Add an `example` folder. -->
35+
36+
## Usage
37+
38+
### Components
39+
40+
#### GoogleSignInComponent
41+
42+
Displays a rendered sign in box for Google authentication that follows the
43+
[branding guidelines](https://developers.google.com/identity/branding-guidelines).
44+
45+
![GoogleSignInComponent](https://cloud.githubusercontent.com/assets/168174/26565270/896f1ac6-449e-11e7-8e7a-967547e5fb65.png)
46+
47+
```dart
48+
import 'dart:html';
49+
50+
import 'package:angular2';
51+
import 'package:angular_fire/angular_fire.dart';
52+
53+
@Component(
54+
selector: 'angular-fire-example',
55+
directives: const [
56+
GoogleSignInComponent,
57+
],
58+
template: r'''
59+
<google-sign-in (trigger)="onTrigger()">
60+
</google-sign-in>
61+
62+
<google-sign-in [useDarkTheme]="true" (trigger)="onTrigger()">
63+
</google-sign-in>
64+
''',
65+
)
66+
class AngularFireExample {
67+
void onTrigger() {
68+
window.alert('Pressed!');
69+
}
70+
}
71+
```
72+
73+
**NOTE**: To use this component, you must have the brand assets in your
74+
`web/assets` directory, or use the `[assetPath]` property, or the
75+
`googleSignInAssetPath` token at `bootstrap` time to configure the location of
76+
your assets - for example on an external CDN.
77+
78+
## Contributing
79+
80+
We welcome a diverse set of contributions, including, but not limited to:
81+
* [Filing bugs and feature requests][file_issue]
82+
* [Send a pull request][pull_request]
83+
* Or, create something awesome using this API and share with us and others!
84+
85+
For the stability of the API and existing users, consider opening an issue
86+
first before implementing a large new feature or breaking an API. For smaller
87+
changes (like documentation, bug fixes), just send a pull request.
88+
89+
[file_issue]: https://github.com/matanlurey/angular_fire/issues/new
90+
[pull_request]: https://github.com/matanlurey/angular_fire/pulls/new
91+
92+
### Testing
93+
94+
Run the (simple) test suite in Dartium:
95+
96+
```shell
97+
$ pub run angular_test -p dartium
98+
```

analysis_options.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
analyzer:
2+
strong-mode:
3+
implicit-casts: false
4+
implicit-dynamic: false
5+
6+
linter:
7+
rules:
8+
# Error Rules
9+
- avoid_empty_else
10+
- comment_references
11+
- control_flow_in_finally
12+
- empty_statements
13+
- hash_and_equals
14+
- invariant_booleans
15+
- iterable_contains_unrelated_type
16+
- list_remove_unrelated_type
17+
- no_adjacent_strings_in_list
18+
- no_duplicate_case_values
19+
- test_types_in_equals
20+
- throw_in_finally
21+
- unrelated_type_equality_checks
22+
- valid_regexps
23+
24+
# Style Rules
25+
- annotate_overrides
26+
- avoid_init_to_null
27+
- avoid_return_types_on_setters
28+
- camel_case_types
29+
- cascade_invocations
30+
- constant_identifier_names
31+
- directives_ordering
32+
- empty_catches
33+
- empty_constructor_bodies
34+
- implementation_imports
35+
- library_names
36+
- library_prefixes
37+
- non_constant_identifier_names
38+
- omit_local_variable_types
39+
- only_throw_errors
40+
- prefer_adjacent_string_concatenation
41+
- prefer_collection_literals
42+
- prefer_const_constructors
43+
- prefer_contains
44+
- prefer_final_fields
45+
- prefer_final_locals
46+
- prefer_initializing_formals
47+
- prefer_interpolation_to_compose_strings
48+
- prefer_is_empty
49+
- prefer_is_not_empty
50+
- recursive_getters
51+
- slash_for_doc_comments
52+
- type_init_formals
53+
- unnecessary_brace_in_string_interps
54+
- unnecessary_this

lib/angular_fire.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2017, Google Inc. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
export 'src/components/google_sign_in.dart'
6+
show googleSignInAssetPath, googleSignInDarkTheme, GoogleSignInComponent;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:host {
2+
background-size: 191px 46px;
3+
4+
display: inline-block;
5+
width: 191px;
6+
height: 46px;
7+
}
8+
9+
/* We are using a custom focus image. */
10+
:host:focus {
11+
outline: none !important;
12+
}

0 commit comments

Comments
 (0)