Skip to content

Commit 121c5f8

Browse files
Peter Gordon HayesPeter Gordon Hayes
authored andcommitted
feat: expose lit auth icons to be used directly
1 parent 2193e8f commit 121c5f8

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

lib/lit_firebase_auth.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export 'src/presentation/core/extensions.dart';
77
export 'src/presentation/core/notifications.dart';
88
export 'src/presentation/lit_auth_init.dart';
99
export 'src/presentation/lit_auth_ui.dart';
10+
export 'src/presentation/widgets/lit_auth_icons.dart';
1011
export 'src/presentation/widgets/sign_in_buttons.dart';
1112
export 'src/presentation/widgets/sign_in_form.dart';
1213
export 'src/presentation/widgets/sign_in_text_fields.dart';

lib/src/presentation/widgets/oauth_logos.dart renamed to lib/src/presentation/widgets/lit_auth_icons.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
22

33
const iconSize = Size(24, 24);
44

5-
class OAuthIcon extends StatelessWidget {
6-
const OAuthIcon._({
5+
class LitAuthIcon extends StatelessWidget {
6+
const LitAuthIcon._({
77
Key key,
88
@required this.assetPath,
99
this.size = iconSize,
@@ -15,39 +15,39 @@ class OAuthIcon extends StatelessWidget {
1515
static const googleIconPath = 'graphics/google_logo.png';
1616

1717
// Google logo [Image]
18-
factory OAuthIcon.google({Size size = iconSize}) {
19-
return OAuthIcon._(
18+
factory LitAuthIcon.google({Size size = iconSize}) {
19+
return LitAuthIcon._(
2020
assetPath: googleIconPath,
2121
size: size,
2222
);
2323
}
2424

2525
// Apple black logo [Image]
26-
factory OAuthIcon.appleBlack({Size size = iconSize}) {
27-
return OAuthIcon._(
26+
factory LitAuthIcon.appleBlack({Size size = iconSize}) {
27+
return LitAuthIcon._(
2828
assetPath: 'graphics/apple_logo_black.png',
2929
size: size,
3030
);
3131
}
3232

3333
// Apple white [Image]
34-
factory OAuthIcon.appleWhite({Size size = iconSize}) {
35-
return OAuthIcon._(
34+
factory LitAuthIcon.appleWhite({Size size = iconSize}) {
35+
return LitAuthIcon._(
3636
assetPath: 'graphics/apple_logo_white.png',
3737
size: size,
3838
);
3939
}
4040
// Github logo [Image]
41-
factory OAuthIcon.github({Size size = iconSize}) {
42-
return OAuthIcon._(
41+
factory LitAuthIcon.github({Size size = iconSize}) {
42+
return LitAuthIcon._(
4343
assetPath: 'graphics/github.png',
4444
size: size,
4545
);
4646
}
4747

4848
// Twitter logo [Image]
49-
factory OAuthIcon.twitter({Size size = iconSize}) {
50-
return OAuthIcon._(
49+
factory LitAuthIcon.twitter({Size size = iconSize}) {
50+
return LitAuthIcon._(
5151
assetPath: 'graphics/twitter_logo_blue.png',
5252
size: size,
5353
);

lib/src/presentation/widgets/sign_in_buttons.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
22

33
import '../core/auth_config.dart';
44
import '../core/extensions.dart';
5-
import 'oauth_logos.dart';
5+
import 'lit_auth_icons.dart';
66

77
const double defaultButtonHeight = 40.0;
88
const FontWeight defaultFontWeight = FontWeight.w500;
@@ -44,7 +44,7 @@ class SignInWithGoogleButton extends StatelessWidget {
4444
color: Colors.white,
4545
),
4646
child: Center(
47-
child: OAuthIcon.google(),
47+
child: LitAuthIcon.google(),
4848
),
4949
),
5050
child: label ?? const _ContinueWithLabel(label: defaultLabel),
@@ -63,7 +63,7 @@ class SignInWithGoogleButton extends StatelessWidget {
6363
),
6464
icon: _IconWrapper(
6565
buttonHeight: defaultButtonHeight,
66-
child: OAuthIcon.google(),
66+
child: LitAuthIcon.google(),
6767
),
6868
child: label ?? const _ContinueWithLabel(label: defaultLabel),
6969
),
@@ -80,7 +80,7 @@ class SignInWithGoogleButton extends StatelessWidget {
8080
.copyWith(height: defaultButtonHeight),
8181
icon: _IconWrapper(
8282
buttonHeight: defaultButtonHeight,
83-
child: OAuthIcon.google(),
83+
child: LitAuthIcon.google(),
8484
),
8585
child: const _ContinueWithLabel(label: defaultLabel),
8686
),
@@ -121,7 +121,7 @@ class SignInWithAppleButton extends StatelessWidget {
121121
child: label ?? const _ContinueWithLabel(label: defaultLabel),
122122
icon: _IconWrapper(
123123
buttonHeight: defaultButtonHeight,
124-
child: OAuthIcon.appleWhite(),
124+
child: LitAuthIcon.appleWhite(),
125125
),
126126
),
127127
);
@@ -140,7 +140,7 @@ class SignInWithAppleButton extends StatelessWidget {
140140
child: label ?? const _ContinueWithLabel(label: defaultLabel),
141141
icon: _IconWrapper(
142142
buttonHeight: defaultButtonHeight,
143-
child: OAuthIcon.appleBlack(),
143+
child: LitAuthIcon.appleBlack(),
144144
),
145145
),
146146
);
@@ -156,7 +156,7 @@ class SignInWithAppleButton extends StatelessWidget {
156156
.copyWith(height: defaultButtonHeight),
157157
icon: _IconWrapper(
158158
buttonHeight: defaultButtonHeight,
159-
child: OAuthIcon.appleBlack(),
159+
child: LitAuthIcon.appleBlack(),
160160
),
161161
child: const _ContinueWithLabel(label: defaultLabel),
162162
),
@@ -194,7 +194,7 @@ class SignInWithGithubButton extends StatelessWidget {
194194
.copyWith(height: defaultButtonHeight),
195195
icon: _IconWrapper(
196196
buttonHeight: defaultButtonHeight,
197-
child: OAuthIcon.github(),
197+
child: LitAuthIcon.github(),
198198
),
199199
child: const _ContinueWithLabel(label: defaultLabel),
200200
),
@@ -233,7 +233,7 @@ class SignInWithTwitterButton extends StatelessWidget {
233233
.copyWith(height: defaultButtonHeight),
234234
icon: _IconWrapper(
235235
buttonHeight: defaultButtonHeight,
236-
child: OAuthIcon.twitter(),
236+
child: LitAuthIcon.twitter(),
237237
),
238238
child: const _ContinueWithLabel(label: defaultLabel),
239239
),

0 commit comments

Comments
 (0)