-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: sign in page to welcome page (#3)
Closes #2
- Loading branch information
Showing
9 changed files
with
215 additions
and
52 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
import 'package:album_searcher_for_google_photos/widgets/sign_in_elevated_button.dart'; | ||
import 'package:flutter/gestures.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class WelcomePage extends StatefulWidget { | ||
const WelcomePage({Key? key}) : super(key: key); | ||
|
||
@override | ||
_WelcomePageState createState() => _WelcomePageState(); | ||
} | ||
|
||
class _WelcomePageState extends State<WelcomePage> { | ||
late TapGestureRecognizer _tapGestureRecognizer; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: SafeArea( | ||
child: Center( | ||
child: ConstrainedBox( | ||
constraints: BoxConstraints( | ||
maxWidth: 800, | ||
), | ||
child: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Card( | ||
margin: const EdgeInsets.all(8), | ||
child: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: CircleAvatar( | ||
child: SvgPicture.asset( | ||
'images/image-search.svg', | ||
width: 50, | ||
height: 50, | ||
color: Theme.of(context).colorScheme.onPrimary, | ||
), | ||
backgroundColor: | ||
Theme.of(context).colorScheme.primary, | ||
radius: 40, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Text( | ||
'Welcome to Album Searcher for Google Photos', | ||
style: Theme.of(context).textTheme.headline6, | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Text( | ||
'Album Searcher for Google Photos gives you an enhanced search experience for shared albums.', | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
Card( | ||
margin: const EdgeInsets.all(8), | ||
child: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Text( | ||
'Sign in with Google to continue to Album Searcher for Google Photos.', | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Text( | ||
'Album Searcher for Google Photos will have read access to your photos library.', | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Text.rich( | ||
TextSpan( | ||
children: [ | ||
TextSpan( | ||
text: | ||
'By continuing to Album Searcher for Google Photos you agree to the ', | ||
), | ||
TextSpan( | ||
text: 'Terms of Service', | ||
style: Theme.of(context) | ||
.textTheme | ||
.bodyText2! | ||
.copyWith( | ||
color: Theme.of(context) | ||
.colorScheme | ||
.primary, | ||
), | ||
recognizer: _tapGestureRecognizer, | ||
), | ||
TextSpan( | ||
text: '.', | ||
), | ||
], | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: SignInElevatedButton(), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
_tapGestureRecognizer.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
_tapGestureRecognizer = TapGestureRecognizer() | ||
..onTap = () async => await launch('/terms.html'); | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
lib/route_paths/sign_in_route_path.dart → lib/route_paths/welcome_route_path.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:album_searcher_for_google_photos/route_paths/route_path.dart'; | ||
|
||
class SignInRoutePath extends RoutePath { | ||
const SignInRoutePath(); | ||
class WelcomeRoutePath extends RoutePath { | ||
const WelcomeRoutePath(); | ||
} |
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
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
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