mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +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);
|
: new OnBoardingScreen(stateContainer.completeOnBoarding);
|
||||||
|
|
||||||
return new MaterialApp(
|
return new MaterialApp(
|
||||||
title: 'Journal',
|
title: 'GitJournal',
|
||||||
home: home,
|
home: home,
|
||||||
theme: new ThemeData(
|
theme: new ThemeData(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.light,
|
||||||
primaryColor: Colors.lightBlue[800],
|
primaryColor: Color(0xFF66bb6a),
|
||||||
accentColor: Colors.cyan[600],
|
accentColor: Color(0xffe64a19),
|
||||||
),
|
),
|
||||||
navigatorObservers: <NavigatorObserver>[observer],
|
navigatorObservers: <NavigatorObserver>[observer],
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,7 @@ class OnBoardingScreen extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var pageController = PageController();
|
var pageController = PageController();
|
||||||
return PageView(
|
var pageView = PageView(
|
||||||
controller: pageController,
|
controller: pageController,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
OnBoardingGitUrl(doneFunction: (String sshUrl) {
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Scaffold(
|
return Column(
|
||||||
body: new Container(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
width: double.infinity,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
height: double.infinity,
|
children: <Widget>[
|
||||||
color: Colors.green[400],
|
Text(
|
||||||
child: Column(
|
'Enter the Git SSH URL -',
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
textAlign: TextAlign.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
overflow: TextOverflow.ellipsis,
|
||||||
children: <Widget>[
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||||
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);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
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) {
|
Widget build(BuildContext context) {
|
||||||
FocusScope.of(context).requestFocus(new FocusNode());
|
FocusScope.of(context).requestFocus(new FocusNode());
|
||||||
|
|
||||||
return new Scaffold(
|
return Column(
|
||||||
body: new Container(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
width: double.infinity,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
height: double.infinity,
|
children: <Widget>[
|
||||||
color: Colors.green[400],
|
Text(
|
||||||
child: Column(
|
'Deploy Public Key',
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
textAlign: TextAlign.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 38),
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
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(
|
return Column(
|
||||||
body: new Container(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
width: double.infinity,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
height: double.infinity,
|
children: children,
|
||||||
color: Colors.green[400],
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: children,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user