diff --git a/lib/const/color_const.dart b/lib/const/color_const.dart index 709dbc4..183ec95 100644 --- a/lib/const/color_const.dart +++ b/lib/const/color_const.dart @@ -12,4 +12,4 @@ const YELLOW = Color(0xfffbed96); const BLUE = Color(0xffabecd6); const PURPLE = Color(0xffccc3fc); const LIGHT_RED = Color(0xffffc2a1); -const RED = Color(0xffffb6b3); +const RED = Color(0xffffb1bb); diff --git a/lib/main.dart b/lib/main.dart index e20b4c9..70196ed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_ui_nice/page/page_const.dart'; import 'package:flutter_ui_nice/page/signup/SignPageEight.dart'; +import 'package:flutter_ui_nice/page/signup/SignPageFive.dart'; import 'package:flutter_ui_nice/page/signup/SignPageFour.dart'; import 'package:flutter_ui_nice/page/signup/SignPageEleven.dart'; +import 'package:flutter_ui_nice/page/signup/SignPageSeven.dart'; import 'package:flutter_ui_nice/page/signup/SignPageSix.dart'; import 'package:flutter_ui_nice/page/signup/SignPageNine.dart'; import 'package:flutter_ui_nice/page/signup/SingPageTen.dart'; @@ -31,9 +33,9 @@ class MyApp extends StatelessWidget { SIGN_UP_PAGES[1]: (context) => SignPageTwo(), //SIGN_UP_PAGES[2]: (context) => SignPageThird(), SIGN_UP_PAGES[3]: (context) => SignPageFour(), - SIGN_UP_PAGES[4]: (context) => SignPageFour(), + SIGN_UP_PAGES[4]: (context) => SignPageFive(), SIGN_UP_PAGES[5]: (context) => SignPageSix(), - SIGN_UP_PAGES[6]: (context) => SignPageFour(), + SIGN_UP_PAGES[6]: (context) => SignPageSeven(), SIGN_UP_PAGES[7]: (context) => SignPageEight(), SIGN_UP_PAGES[8]: (context) => SignPageNine(), SIGN_UP_PAGES[9]: (context) => SignPageTeen(), diff --git a/lib/page/signup/SignPageEleven.dart b/lib/page/signup/SignPageEleven.dart index 1a73093..dd60c14 100644 --- a/lib/page/signup/SignPageEleven.dart +++ b/lib/page/signup/SignPageEleven.dart @@ -143,23 +143,25 @@ class _SignPageElevenState extends State { ), Expanded( flex: 2, - child: DropdownButton( - isDense: true, - style: TextStyle( - fontSize: TEXT_NORMAL_SIZE, - color: Colors.black, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isDense: true, + style: TextStyle( + fontSize: TEXT_NORMAL_SIZE, + color: Colors.black, + ), + isExpanded: true, + onChanged: changeDropDownLocationItem, + items: _locations.map((items) { + return DropdownMenuItem( + value: items, + child: Text( + items, + ), + ); + }).toList(), + value: currentLocation, ), - isExpanded: true, - onChanged: changeDropDownLocationItem, - items: _locations.map((items) { - return DropdownMenuItem( - value: items, - child: Text( - items, - ), - ); - }).toList(), - value: currentLocation, ), ), ], diff --git a/lib/page/signup/SignPageFive.dart b/lib/page/signup/SignPageFive.dart new file mode 100644 index 0000000..444c0f3 --- /dev/null +++ b/lib/page/signup/SignPageFive.dart @@ -0,0 +1,383 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_ui_nice/const/gradient_const.dart'; +import 'package:flutter_ui_nice/const/icons.dart'; +import 'package:flutter_ui_nice/page/signup/widgets/signup_apbar.dart'; +import 'package:flutter_ui_nice/page/signup/widgets/signup_arrow_button.dart'; + +class SignPageFive extends StatefulWidget { + @override + _SignPageFiveState createState() => _SignPageFiveState(); +} + +class _SignPageFiveState extends State { + TextEditingController _emailController = TextEditingController(); + TextEditingController _passwordController = TextEditingController(); + int widgetIndex = 0; + PageController _pageController; + bool _isSelected = false; + + _selectType(bool isSelected) { + setState(() { + _isSelected = isSelected; + }); + } + + @override + void initState() { + _pageController = PageController(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + List widgets = [ + loginColumn(), + sigNupColumn(), + ]; + + return Scaffold( + appBar: SignupApbar( + title: "LOGIN", + ), + body: Stack( + children: [ + Container( + height: double.infinity, + width: double.infinity, + decoration: BoxDecoration( + gradient: SIGNUP_BACKGROUND, + ), + ), + SingleChildScrollView( + child: Container( + child: Stack( + children: [ + Container( + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + top: 80, + left: 70, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + InkWell( + onTap: () { + _selectType(false); + _pageController.previousPage( + duration: Duration(milliseconds: 300), + curve: Curves.easeInBack, + ); + }, + child: Opacity( + opacity: _isSelected ? 0.5 : 1, + child: Text( + "LOGIN", + style: TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + letterSpacing: 1.5, + wordSpacing: 1.5, + color: Colors.black87, + ), + ), + ), + ), + InkWell( + onTap: () { + _pageController.nextPage( + duration: Duration(milliseconds: 300), + curve: Curves.easeInBack, + ); + _selectType(true); + }, + child: Opacity( + opacity: _isSelected ? 1 : 0.5, + child: Text( + "SIGNUP", + style: TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + letterSpacing: 1.5, + wordSpacing: 1.5, + color: Colors.black87, + ), + ), + ), + ), + ], + ), + SizedBox( + height: 30, + ), + Column( + children: [ + Container( + height: + MediaQuery.of(context).size.height / 2, + width: double.infinity, + child: Stack( + children: [ + Container( + height: MediaQuery.of(context) + .size + .height / + 2, + width: double.infinity, + padding: EdgeInsets.all(30), + decoration: BoxDecoration( + gradient: SIGNUP_CARD_BACKGROUND, + borderRadius: BorderRadius.only( + topLeft: Radius.circular( + 15, + ), + bottomLeft: Radius.circular( + 15, + ), + ), + ), + child: PageView.builder( + controller: _pageController, + itemBuilder: (context, index) { + return widgets[index]; + }, + physics: BouncingScrollPhysics(), + itemCount: widgets.length, + scrollDirection: Axis.horizontal, + )), + ], + ), + ), + Container( + height: 20, + margin: EdgeInsets.only( + left: 15, + ), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(15), + ), + boxShadow: [ + BoxShadow( + color: + Colors.white70.withOpacity(0.3), + ) + ], + ), + ), + Container( + height: 20, + margin: EdgeInsets.only( + left: 30, + ), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(15), + ), + boxShadow: [ + BoxShadow( + color: + Colors.white70.withOpacity(0.2), + blurRadius: 2, + ) + ], + ), + ), + Container( + height: 20, + margin: EdgeInsets.only( + left: 45, + ), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(15), + ), + boxShadow: [ + BoxShadow( + color: + Colors.white54.withOpacity(0.2), + blurRadius: 8, + offset: Offset(0, 3), + ) + ], + ), + ), + ], + ), + ], + ), + ), + ], + ), + ), + Positioned( + bottom: 35, + left: 97, + child: SignUpArrowButton( + icon: IconData( + arrow_right, + fontFamily: "Icons", + ), + iconSize: 10, + onTap: () => print("Login tapped"), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } + + Column sigNupColumn() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Text( + "Welcome", + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w400, + wordSpacing: 2, + letterSpacing: 2, + ), + ), + Text( + "Sign In!", + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w400, + wordSpacing: 2, + letterSpacing: 2, + ), + ), + Expanded(child: Container()), + emailTextFieldWidget(), + SizedBox( + height: 1.5, + child: Container( + color: Colors.black, + ), + ), + Expanded( + flex: 3, + child: passwordTextFieldWidget(), + ), + Text( + "NEXT", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 15, + ) + ], + ); + } + + Column loginColumn() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Text( + "Welcome", + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w400, + wordSpacing: 2, + letterSpacing: 2, + ), + ), + Text( + "back!", + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w400, + wordSpacing: 2, + letterSpacing: 2, + ), + ), + Expanded(child: Container()), + emailTextFieldWidget(), + SizedBox( + height: 1.5, + child: Container( + color: Colors.black, + ), + ), + Expanded( + flex: 3, + child: passwordTextFieldWidget(), + ), + Text( + "NEXT", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 15, + ) + ], + ); + } + + Widget emailTextFieldWidget() { + return TextField( + controller: _emailController, + decoration: new InputDecoration( + suffixIcon: Padding( + padding: const EdgeInsets.only(right: 30.0), + child: Icon(IconData(0xe902, fontFamily: 'Icons'), + color: Color(0xff35AA90), size: 10.0), + ), + hintText: 'Email', + labelStyle: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 14, + ), + hintStyle: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + border: InputBorder.none, + ), + ); + } + + Widget passwordTextFieldWidget() { + return TextField( + controller: _passwordController, + decoration: new InputDecoration( + hintText: 'Password', + labelStyle: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + ), + hintStyle: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + border: InputBorder.none, + ), + obscureText: true, + ); + } +} diff --git a/lib/page/signup/SignPageSeven.dart b/lib/page/signup/SignPageSeven.dart new file mode 100644 index 0000000..cd52908 --- /dev/null +++ b/lib/page/signup/SignPageSeven.dart @@ -0,0 +1,432 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_ui_nice/const/gradient_const.dart'; +import 'package:flutter_ui_nice/const/icons.dart'; +import 'package:flutter_ui_nice/const/size_const.dart'; +import 'package:flutter_ui_nice/page/signup/widgets/signup_arrow_button.dart'; +import 'dart:async'; +import 'package:google_places_picker/google_places_picker.dart'; +import 'package:intl/intl.dart'; + +class SignPageSeven extends StatefulWidget { + @override + _SignPageSevenState createState() => _SignPageSevenState(); +} + +class _SignPageSevenState extends State { + String _currentDate = DateFormat('M/d/y').format(DateTime.now()); + List _countries = ["Germany", "Turkey", "Spain"]; + List _states = ["Hessen", "Istanbul", "Barcelona"]; + String _currentCountry = "Germany"; + String _currentState = "Hessen"; + Place _place; + int widgetIndex = 0; + PageController _pageController; + bool _isSelected = true; + _selectType(bool isSelected) { + setState(() { + _isSelected = isSelected; + }); + } + + @override + void initState() { + _pageController = PageController(); + + super.initState(); + } + + void changeDropDownCountryItem(String selectedCountry) { + setState(() { + _currentCountry = selectedCountry; + }); + } + + void changeDropDownStateItem(String selectedState) { + setState(() { + _currentState = selectedState; + }); + } + + Future _selectDate() async { + DateTime picked = await showDatePicker( + context: context, + initialDate: new DateTime.now(), + firstDate: new DateTime(2016), + lastDate: new DateTime(2050)); + if (picked != null) + setState( + () => _currentDate = DateFormat('M/d/y').format(picked), + ); + } + + Future _selectPlace(BuildContext context) async { + try { + Place _picker = await PluginGooglePlacePicker.showPlacePicker(); + setState(() { + _place = _picker; + }); + } catch (e) {} + } + + @override + Widget build(BuildContext context) { + final _media = MediaQuery.of(context).size; + List widgets = [ + buildLoginArea(context), + buildLoginArea(context), + ]; + return Scaffold( + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: MediaQuery.of(context).padding, + height: _media.height, + width: _media.width, + decoration: BoxDecoration( + gradient: SIGNUP_BACKGROUND, + ), + child: Stack( + alignment: Alignment.center, + children: [ + Row( + children: [ + Container( + height: _media.height, + width: _media.width / 2, + decoration: BoxDecoration( + gradient: _isSelected + ? LinearGradient( + colors: [ + Colors.black.withOpacity(0.05), + Colors.transparent, + ], + begin: FractionalOffset.topCenter, + end: FractionalOffset.bottomCenter, + stops: [0.2, 0.8]) + : null, + ), + child: Padding( + padding: const EdgeInsets.only(top: 25.0), + child: Opacity( + opacity: _isSelected ? 0.5 : 1, + child: Text( + "Log In", + style: TextStyle( + fontSize: 30, + color: Colors.black54, + ), + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + height: _media.height, + width: _media.width / 2, + decoration: BoxDecoration( + gradient: !_isSelected + ? LinearGradient( + colors: [ + Colors.black.withOpacity(0.05), + Colors.transparent, + ], + begin: FractionalOffset.topCenter, + end: FractionalOffset.bottomCenter, + stops: [0.2, 0.8]) + : null, + ), + child: Padding( + padding: const EdgeInsets.only(top: 25.0), + child: Opacity( + opacity: _isSelected ? 1 : 0.5, + child: Text( + "Sign Up", + style: TextStyle( + fontSize: 30, + color: Colors.black54, + ), + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + Stack( + children: [ + Container( + margin: EdgeInsets.only( + top: 110, + left: 50, + right: 50, + bottom: 60, + ), + height: _media.height, + width: _media.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + gradient: SIGNUP_CARD_BACKGROUND, + boxShadow: [ + BoxShadow( + color: Colors.grey.shade400, + blurRadius: 30, + spreadRadius: 0, + offset: Offset( + 0, + 10, + ), + ) + ], + ), + child: PageView.builder( + controller: _pageController, + itemBuilder: (context, index) { + return widgets[index]; + }, + physics: BouncingScrollPhysics(), + itemCount: widgets.length, + scrollDirection: Axis.horizontal, + ), + ), + ], + ), + Positioned( + child: SignUpArrowButton( + onTap: () { + _pageController.previousPage( + duration: Duration(milliseconds: 300), + curve: Curves.easeInBack, + ); + _selectType(true); + }, + iconSize: 9, + icon: IconData( + arrow_left, + fontFamily: "Icons", + ), + ), + bottom: 80, + left: 25, + ), + Positioned( + child: SignUpArrowButton( + onTap: () { + _pageController.nextPage( + duration: Duration(milliseconds: 300), + curve: Curves.easeInBack, + ); + _selectType(false); + }, + iconSize: 9, + icon: IconData( + arrow_right, + fontFamily: "Icons", + ), + ), + bottom: 80, + right: 25, + ), + Positioned( + child: Text( + "2/3", + style: TextStyle( + letterSpacing: 2.0, + color: Color(0xff353535), + ), + ), + bottom: 80, + ) + ], + ), + ), + ), + ); + } + + Padding buildLoginArea(BuildContext context) { + return Padding( + padding: const EdgeInsets.only( + left: 25.0, + right: 25, + top: 30, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + formTextField("DATE OF BIRTH"), + buildDivider(), + buildDropdown("COUNTRY", _countries, _currentCountry, + changeDropDownCountryItem), + buildDivider(), + buildDropdown( + "STATE", _states, _currentState, changeDropDownStateItem), + buildDivider(), + buildCity("CITY", context), + buildDivider(), + buildStreet("STREET", context), + buildDivider(), + ], + ), + ); + } + + Widget buildStreet(String text, BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + text, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + color: Colors.black26, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 15.0, bottom: 20), + child: InkWell( + onTap: () => _selectPlace(context), + child: Text( + _place != null ? _place.name : 'Ostendstr. 27', + style: TextStyle( + letterSpacing: 2.0, + color: Color(0xff353535), + fontSize: 12.0, + fontWeight: FontWeight.bold, + fontFamily: 'Montserrat'), + overflow: TextOverflow.fade, + ), + ), + ) + ], + ); + } + + Widget buildCity(String text, BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + text, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + color: Colors.black26, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 15.0, bottom: 20), + child: InkWell( + onTap: () => _selectPlace(context), + child: Text( + _place != null ? _place.name : 'Frankfurt am Main', + style: TextStyle( + letterSpacing: 2.0, + color: Color(0xff353535), + fontSize: 12.0, + fontWeight: FontWeight.bold, + fontFamily: 'Montserrat'), + overflow: TextOverflow.fade, + ), + ), + ) + ], + ); + } + + Widget formTextField(String text) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + text, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + color: Colors.black26, + ), + ), + TextField( + keyboardType: TextInputType.datetime, + onTap: _selectDate, + decoration: InputDecoration( + border: InputBorder.none, + hintText: _currentDate, + hintStyle: TextStyle( + letterSpacing: 2.0, + color: Color(0xff353535), + fontSize: 12.0, + fontWeight: FontWeight.bold, + fontFamily: 'Montserrat', + ), + suffixIcon: Padding( + padding: const EdgeInsets.only(left: 25.0), + child: Icon( + Icons.arrow_drop_down, + color: Colors.grey.shade700, + ), + ), + ), + ), + ], + ); + } + + Column buildDropdown( + String text, List dropDownList, String current, Function change) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + text, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + color: Colors.black26, + ), + ), + DropdownButtonHideUnderline( + child: DropdownButton( + style: TextStyle( + letterSpacing: 2.0, + color: Color(0xff353535), + fontSize: 12.0, + fontWeight: FontWeight.bold, + fontFamily: 'Montserrat', + ), + isExpanded: true, + onChanged: change, + items: dropDownList.map((items) { + return DropdownMenuItem( + value: items, + child: Text( + items, + style: TextStyle( + letterSpacing: 1.1, + ), + ), + ); + }).toList(), + value: current, + ), + ), + ], + ); + } + + Container buildDivider() { + return Container( + margin: EdgeInsets.only(top: 0, right: 8, bottom: 15), + padding: EdgeInsets.only( + right: 5, + ), + color: Colors.black, + height: 1.2, + ); + } +} diff --git a/lib/page/signup/widgets/signup_arrow_button.dart b/lib/page/signup/widgets/signup_arrow_button.dart index 7d2a244..1e042b2 100644 --- a/lib/page/signup/widgets/signup_arrow_button.dart +++ b/lib/page/signup/widgets/signup_arrow_button.dart @@ -6,13 +6,16 @@ class SignUpArrowButton extends StatelessWidget { final double iconSize; final double height; final double width; + final Color iconColor; - SignUpArrowButton( - {this.icon, - this.iconSize, - this.onTap, - this.height = 50.0, - this.width = 50.0}); + SignUpArrowButton({ + this.icon, + this.iconSize, + this.onTap, + this.height = 50.0, + this.width = 50.0, + this.iconColor = const Color(0xFFdbedb0), + }); @override Widget build(BuildContext context) { @@ -43,7 +46,7 @@ class SignUpArrowButton extends StatelessWidget { child: Icon( icon, size: iconSize, - color: Colors.white, + color: iconColor, ), ), );