mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +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,12 +68,7 @@ class OnBoardingGitUrlState extends State<OnBoardingGitUrl> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Scaffold(
|
return Column(
|
||||||
body: new Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
color: Colors.green[400],
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -89,8 +93,6 @@ class OnBoardingGitUrlState extends State<OnBoardingGitUrl> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,12 +129,7 @@ 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(
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
color: Colors.green[400],
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -152,8 +149,6 @@ class OnBoardingSshKeyState extends State<OnBoardingSshKey> {
|
|||||||
onPressed: this.doneFunction,
|
onPressed: this.doneFunction,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,17 +219,10 @@ class OnBoardingGitCloneState extends State<OnBoardingGitClone> {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Scaffold(
|
return Column(
|
||||||
body: new Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
color: Colors.green[400],
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: children,
|
children: children,
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user