forked from coronavirus-diary/coronavirus-diary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
214 additions
and
81 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
|
||
import 'package:coronavirus_diary/src/blocs/preferences/preferences.dart'; | ||
import 'package:coronavirus_diary/src/ui/router.dart'; | ||
|
||
class GetStartedStep extends StatelessWidget { | ||
void _completeTutorial(BuildContext context, PreferencesState state) { | ||
// Save response | ||
Preferences newPreferences = state.preferences.cloneWith( | ||
completedTutorial: true, | ||
); | ||
context.bloc<PreferencesBloc>().add(UpdatePreferences(newPreferences)); | ||
|
||
// Navigate to home page and put it at the | ||
// bottom of the navigation stack | ||
Navigator.pushNamedAndRemoveUntil( | ||
context, | ||
HomeScreen.routeName, | ||
(Route<dynamic> route) => false, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<PreferencesBloc, PreferencesState>( | ||
builder: (context, state) { | ||
return SafeArea( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Container( | ||
width: double.infinity, | ||
color: Colors.white.withOpacity(0.2), | ||
padding: EdgeInsets.symmetric(horizontal: 40, vertical: 20), | ||
margin: EdgeInsets.only(bottom: 20), | ||
child: Center( | ||
child: FaIcon( | ||
FontAwesomeIcons.handsHelping, | ||
color: Colors.white, | ||
size: 80, | ||
), | ||
), | ||
), | ||
Container( | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
margin: EdgeInsets.only(bottom: 50), | ||
child: Text( | ||
"You've joined the Coronavirus Diary community!", | ||
textAlign: TextAlign.center, | ||
style: Theme.of(context).textTheme.title, | ||
), | ||
), | ||
Container( | ||
padding: EdgeInsets.symmetric(horizontal: 40), | ||
margin: EdgeInsets.only(bottom: 40), | ||
child: RaisedButton( | ||
onPressed: () => _completeTutorial(context, state), | ||
child: Text('Click here to get started'), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
} |
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,9 +1,3 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'consent.dart'; | ||
import 'intro.dart'; | ||
|
||
final List<Widget> steps = [ | ||
IntroStep(), | ||
ConsentStep(), | ||
]; | ||
export 'consent.dart'; | ||
export 'get_started.dart'; | ||
export 'intro.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