mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
OnBoardingScreens: Get the background color from the theme
Also reduce a lot of code duplication
This commit is contained in:
@ -21,12 +21,12 @@ class JournalApp extends StatelessWidget {
|
||||
: new OnBoardingScreen(stateContainer.completeOnBoarding);
|
||||
|
||||
return new MaterialApp(
|
||||
title: 'Journal',
|
||||
title: 'GitJournal',
|
||||
home: home,
|
||||
theme: new ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
primaryColor: Colors.lightBlue[800],
|
||||
accentColor: Colors.cyan[600],
|
||||
brightness: Brightness.light,
|
||||
primaryColor: Color(0xFF66bb6a),
|
||||
accentColor: Color(0xffe64a19),
|
||||
),
|
||||
navigatorObservers: <NavigatorObserver>[observer],
|
||||
);
|
||||
|
@ -11,7 +11,7 @@ class OnBoardingScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pageController = PageController();
|
||||
return PageView(
|
||||
var pageView = PageView(
|
||||
controller: pageController,
|
||||
children: <Widget>[
|
||||
OnBoardingGitUrl(doneFunction: (String sshUrl) {
|
||||
@ -35,6 +35,15 @@ class OnBoardingScreen extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
return new Scaffold(
|
||||
body: new Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
color: Theme.of(context).primaryColor,
|
||||
child: pageView,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,38 +68,31 @@ class OnBoardingGitUrlState extends State<OnBoardingGitUrl> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
body: new Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
color: Colors.green[400],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Enter the Git SSH URL -',
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||
),
|
||||
Form(
|
||||
child: TextFormField(
|
||||
key: sshUrlKey,
|
||||
textAlign: TextAlign.center,
|
||||
autofocus: true,
|
||||
),
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("Next"),
|
||||
onPressed: () {
|
||||
var url = sshUrlKey.currentState.value;
|
||||
this.doneFunction(url);
|
||||
},
|
||||
)
|
||||
],
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Enter the Git SSH URL -',
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||
),
|
||||
),
|
||||
Form(
|
||||
child: TextFormField(
|
||||
key: sshUrlKey,
|
||||
textAlign: TextAlign.center,
|
||||
autofocus: true,
|
||||
),
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("Next"),
|
||||
onPressed: () {
|
||||
var url = sshUrlKey.currentState.value;
|
||||
this.doneFunction(url);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -127,33 +129,26 @@ class OnBoardingSshKeyState extends State<OnBoardingSshKey> {
|
||||
Widget build(BuildContext context) {
|
||||
FocusScope.of(context).requestFocus(new FocusNode());
|
||||
|
||||
return new Scaffold(
|
||||
body: new Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
color: Colors.green[400],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Deploy Public Key',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||
),
|
||||
Text(
|
||||
publicKey,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 10,
|
||||
style: TextStyle(fontSize: 10),
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("Start Clone"),
|
||||
onPressed: this.doneFunction,
|
||||
)
|
||||
],
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Deploy Public Key',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
publicKey,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 10,
|
||||
style: TextStyle(fontSize: 10),
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("Start Clone"),
|
||||
onPressed: this.doneFunction,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -224,17 +219,10 @@ class OnBoardingGitCloneState extends State<OnBoardingGitClone> {
|
||||
];
|
||||
}
|
||||
|
||||
return new Scaffold(
|
||||
body: new Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
color: Colors.green[400],
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: children,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user