-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature/PE1-16] Implementation of the welcome page #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
c529a55
08e143a
47e6962
05b5692
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| // This class is for the calender picture in the middle of the page | ||
| class CalenderPic extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Image( | ||
| image: AssetImage('assets/images/PEwelcomeImage.png'), | ||
| fit: BoxFit.contain, | ||
| height: MediaQuery.of(context).size.height * 0.4, | ||
| width: MediaQuery.of(context).size.width * 0.8, | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class CircleOverlays extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Container( | ||
| width: MediaQuery.of(context).size.width, | ||
| child: Stack( | ||
| textDirection: TextDirection.ltr, | ||
| children: [ | ||
| Positioned( | ||
| child: CircleContainer( | ||
| assetLocation: 'assets/images/PEcircle2.png', | ||
| width: 0.6, | ||
| height: 0.33), | ||
| left: 0, | ||
| ), | ||
| Positioned( | ||
| child: CircleContainer( | ||
| assetLocation: 'assets/images/PEcircle1.png', | ||
| width: 0.6, | ||
| height: 0.216), | ||
| right: 0, | ||
| ) | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| // this class is use to hold the circles | ||
| class CircleContainer extends StatelessWidget { | ||
| final String assetLocation; | ||
| final double width; | ||
| final double height; | ||
|
|
||
| CircleContainer( | ||
| {Key key, | ||
| @required this.assetLocation, | ||
| @required this.width, | ||
| @required this.height}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Image( | ||
| width: MediaQuery.of(context).size.width * width, | ||
| height: MediaQuery.of(context).size.height * height, | ||
| image: AssetImage(assetLocation), | ||
| fit: BoxFit.contain, | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class PageTitle extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Container( | ||
| height: MediaQuery.of(context).size.height * 0.2, | ||
| child: Column( | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| textDirection: TextDirection.ltr, | ||
| children: [ | ||
| Image( | ||
| image: AssetImage('assets/images/PElogo2.png'), | ||
| fit: BoxFit.contain, | ||
| height: MediaQuery.of(context).size.height * 0.08, | ||
| ), | ||
| Text('Hello!', | ||
| style: TextStyle( | ||
| fontWeight: FontWeight.bold, | ||
| fontSize: 27, | ||
| fontFamily: 'Montserrat'), | ||
| textDirection: TextDirection.ltr), | ||
| Text('Welcome to Poly Event.', | ||
| style: TextStyle(fontSize: 20, fontFamily: 'Montserrat'), | ||
| textDirection: TextDirection.ltr), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| class BottomSquareWithButton extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Container( | ||
| height: MediaQuery.of(context).size.height * 0.45, | ||
| width: MediaQuery.of(context).size.width, | ||
| decoration: BoxDecoration( | ||
| //gradient color for the rectangle | ||
| gradient: LinearGradient( | ||
| begin: Alignment.topCenter, | ||
| end: Alignment.bottomCenter, | ||
| colors: <Color>[ | ||
| Color.fromARGB(255, 217, 188, 240), | ||
| Color.fromARGB(255, 237, 210, 240) | ||
| ]), | ||
| borderRadius: BorderRadius.only( | ||
| topLeft: const Radius.circular(25.0), | ||
| topRight: const Radius.circular(25.0), | ||
| )), | ||
| child: Column( | ||
| mainAxisSize: MainAxisSize.max, | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| textDirection: TextDirection.ltr, | ||
| children: [ | ||
| WelcomeButtons(assetLocation: 'assets/images/PEsignup.png'), | ||
| WelcomeButtons(assetLocation: 'assets/images/PElogin.png'), | ||
| Text('By Poly Team', textDirection: TextDirection.ltr) | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /// Sign up button for the welcome page, use the raised button. | ||
| class WelcomeButtons extends StatelessWidget { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your contribution! I'm a bit confused about the naming of this widget. Seems like we are only having one button inside of it, but the name is plural. Would you mind explaining why It's called |
||
| final String assetLocation; | ||
|
|
||
| WelcomeButtons({Key key, @required this.assetLocation}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return GestureDetector( | ||
| child: Image( | ||
| height: MediaQuery.of(context).size.height * 0.1, | ||
| width: MediaQuery.of(context).size.width * 0.8, | ||
| image: AssetImage(assetLocation), | ||
| fit: BoxFit.fitWidth), | ||
|
Comment on lines
+45
to
+49
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was mentioned on another pull request with @shoko-inori. @shoko-inori Did you find a solution to code this button rather than using an image? |
||
| onTap: () { | ||
| //Todo: link it to different page up page | ||
| print('hi\n'); | ||
| }, | ||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'circleOverlays.dart'; | ||
| import 'calenderPic.dart'; | ||
| import 'signInButtons.dart'; | ||
| import 'pageTitle.dart'; | ||
|
|
||
| class WelcomePage extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| body: Stack( | ||
| textDirection: TextDirection.ltr, | ||
| children: [ | ||
| Positioned( | ||
| child: CircleOverlays(), | ||
| ), | ||
| Positioned( | ||
| child: BottomSquareWithButton(), | ||
| bottom: 0, | ||
| ), | ||
| Positioned( | ||
| child: CalenderPic(), | ||
| bottom: MediaQuery.of(context).size.height * 0.35, | ||
| left: MediaQuery.of(context).size.width * 0.1, | ||
| ), | ||
| Positioned( | ||
| child: PageTitle(), | ||
| left: MediaQuery.of(context).size.width * 0.07, | ||
| top: MediaQuery.of(context).size.height * 0.07, | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I was wondering if there's a better name for this widget. For example, it might be better to call it
ButtonContainer.