|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:flutter_ui_nice/const/color_const.dart'; |
| 3 | +import 'package:flutter_ui_nice/const/gradient_const.dart'; |
| 4 | +import 'package:flutter_ui_nice/const/images_const.dart'; |
| 5 | +import 'package:flutter_ui_nice/const/size_const.dart'; |
| 6 | +import 'package:flutter_ui_nice/const/string_const.dart'; |
| 7 | +import 'dart:io'; |
| 8 | + |
| 9 | +import 'package:flutter_ui_nice/page/signup/widgets/signup_arrow_button.dart'; |
| 10 | + |
| 11 | +class SignPageThree extends StatefulWidget { |
| 12 | + @override |
| 13 | + _SignPageThreeState createState() => _SignPageThreeState(); |
| 14 | +} |
| 15 | + |
| 16 | +class _SignPageThreeState extends State<SignPageThree> { |
| 17 | + TextEditingController _username = TextEditingController(); |
| 18 | + TextEditingController _password = TextEditingController(); |
| 19 | + |
| 20 | + @override |
| 21 | + Widget build(BuildContext context) { |
| 22 | + final _media = MediaQuery.of(context).size; |
| 23 | + return Scaffold( |
| 24 | + body: Container( |
| 25 | + height: double.infinity, |
| 26 | + width: double.infinity, |
| 27 | + decoration: BoxDecoration( |
| 28 | + gradient: SIGNUP_BACKGROUND, |
| 29 | + ), |
| 30 | + child: SingleChildScrollView( |
| 31 | + physics: BouncingScrollPhysics(), |
| 32 | + child: Stack( |
| 33 | + children: <Widget>[ |
| 34 | + Padding( |
| 35 | + padding: const EdgeInsets.symmetric( |
| 36 | + vertical: 60, |
| 37 | + ), |
| 38 | + child: Column( |
| 39 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 40 | + children: <Widget>[ |
| 41 | + Center(child: Image.asset( |
| 42 | + SignUpImagePath.SignUpLogo, |
| 43 | + height: _media.height/7, |
| 44 | + ),), |
| 45 | + Row( |
| 46 | + children: <Widget>[ |
| 47 | + Container( |
| 48 | + height: _media.height/1.7, |
| 49 | + width: _media.width/1.25, |
| 50 | + |
| 51 | + decoration: BoxDecoration( |
| 52 | + borderRadius: BorderRadius.only(topRight: Radius.circular(15),bottomRight: Radius.circular(15)), |
| 53 | + gradient: SIGNUP_CARD_BACKGROUND, |
| 54 | + boxShadow: [ |
| 55 | + BoxShadow( |
| 56 | + color: Colors.black12, |
| 57 | + blurRadius: 15, |
| 58 | + spreadRadius: 8, |
| 59 | + ), |
| 60 | + ], |
| 61 | + |
| 62 | + ), |
| 63 | + child: Padding( |
| 64 | + padding: EdgeInsets.only(left: 40,top: 60), |
| 65 | + child: new Column( |
| 66 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 67 | + |
| 68 | + children: <Widget>[ |
| 69 | + Text( |
| 70 | + 'Log in', |
| 71 | + style: TextStyle( |
| 72 | + fontFamily: "Montserrat", |
| 73 | + fontWeight: FontWeight.w300, |
| 74 | + fontSize: 40), |
| 75 | + ), |
| 76 | + Text( |
| 77 | + 'to continue..', |
| 78 | + style: TextStyle( |
| 79 | + fontFamily: "Montserrat", |
| 80 | + fontWeight: FontWeight.w300, |
| 81 | + fontSize: 40), |
| 82 | + ), |
| 83 | + SizedBox(height: 40,), |
| 84 | + inputText("Username", |
| 85 | + _username, false), |
| 86 | + Divider( |
| 87 | + height: 5, |
| 88 | + color: Colors.black, |
| 89 | + ), |
| 90 | + inputText( |
| 91 | + "Password", _password, true), |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + ], |
| 98 | + ), |
| 99 | + ), |
| 100 | + |
| 101 | + ), |
| 102 | + Flexible( |
| 103 | + child: Opacity( |
| 104 | + opacity: 0.6, |
| 105 | + child: new Container( |
| 106 | + height: _media.height/1.7-20, |
| 107 | + width: 25, |
| 108 | + decoration: BoxDecoration( |
| 109 | + color: Colors.white, |
| 110 | + borderRadius: BorderRadius.only(topRight: Radius.circular(15),bottomRight: Radius.circular(15)), |
| 111 | + boxShadow: [ |
| 112 | + BoxShadow( |
| 113 | + color: Colors.black12, |
| 114 | + blurRadius: 15, |
| 115 | + spreadRadius: 8, |
| 116 | + ), |
| 117 | + ], |
| 118 | + |
| 119 | + ), |
| 120 | + ), |
| 121 | + ), |
| 122 | + ), |
| 123 | + Flexible( |
| 124 | + child: Opacity( |
| 125 | + opacity: 0.4, |
| 126 | + child: new Container( |
| 127 | + height: _media.height/1.7-40, |
| 128 | + width: 25, |
| 129 | + decoration: BoxDecoration( |
| 130 | + color: Colors.white, |
| 131 | + borderRadius: BorderRadius.only(topRight: Radius.circular(15),bottomRight: Radius.circular(15)), |
| 132 | + boxShadow: [ |
| 133 | + BoxShadow( |
| 134 | + color: Colors.black12, |
| 135 | + blurRadius: 15, |
| 136 | + spreadRadius: 8, |
| 137 | + ), |
| 138 | + ], |
| 139 | + |
| 140 | + ), |
| 141 | + ), |
| 142 | + ), |
| 143 | + ), |
| 144 | + Flexible( |
| 145 | + child: Opacity( |
| 146 | + opacity: 0.2, |
| 147 | + child: new Container( |
| 148 | + height: _media.height/1.7-60, |
| 149 | + width: 25, |
| 150 | + decoration: BoxDecoration( |
| 151 | + color: Colors.white, |
| 152 | + borderRadius: BorderRadius.only(topRight: Radius.circular(15),bottomRight: Radius.circular(15)), |
| 153 | + boxShadow: [ |
| 154 | + BoxShadow( |
| 155 | + color: Colors.black12, |
| 156 | + blurRadius: 15, |
| 157 | + spreadRadius: 8, |
| 158 | + ), |
| 159 | + ], |
| 160 | + |
| 161 | + ), |
| 162 | + ), |
| 163 | + ), |
| 164 | + ) |
| 165 | + ], |
| 166 | + ), |
| 167 | + |
| 168 | + Padding( |
| 169 | + padding: EdgeInsets.symmetric(vertical: 60), |
| 170 | + child: Row( |
| 171 | + |
| 172 | + mainAxisAlignment: MainAxisAlignment.center, |
| 173 | + crossAxisAlignment: CrossAxisAlignment.center, |
| 174 | + children: <Widget>[ |
| 175 | + Text( |
| 176 | + StringConst.SIGN_UP_TEXT, |
| 177 | + style: TextStyle(color: MAIN_COLOR), |
| 178 | + ), |
| 179 | + SizedBox( |
| 180 | + width: 5, |
| 181 | + ), |
| 182 | + GestureDetector( |
| 183 | + onTap: () => print("Sign Up Tapped"), |
| 184 | + child: Text( StringConst.SIGN_UP), |
| 185 | + ), |
| 186 | + ], |
| 187 | + ), |
| 188 | + ), |
| 189 | + SizedBox( |
| 190 | + height: 50, |
| 191 | + ) |
| 192 | + |
| 193 | + ], |
| 194 | + ), |
| 195 | + ), |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + Positioned( |
| 200 | + |
| 201 | + top: _media.height/1.7+_media.height/7+30, |
| 202 | + left: 20, |
| 203 | + child: SignUpArrowButton( |
| 204 | + icon: Icons.arrow_forward, |
| 205 | + iconSize: 26, |
| 206 | + onTap: () => print("Signup Tapped"), |
| 207 | + ) |
| 208 | + |
| 209 | + ), |
| 210 | + Positioned( |
| 211 | + |
| 212 | + top: _media.height/1.7+_media.height/7-10, |
| 213 | + left: 40, |
| 214 | + child: Text( |
| 215 | + 'Next', |
| 216 | + style: TextStyle( |
| 217 | + fontFamily: "Montserrat", |
| 218 | + fontWeight: FontWeight.w800, |
| 219 | + fontSize: 16), |
| 220 | + ), |
| 221 | + |
| 222 | + ), |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + ], |
| 233 | + ), |
| 234 | + ), |
| 235 | + ), |
| 236 | + ); |
| 237 | + } |
| 238 | +} |
| 239 | + |
| 240 | +Widget inputText( |
| 241 | + |
| 242 | + String hintText, |
| 243 | + TextEditingController controller, |
| 244 | + bool obSecure, |
| 245 | + ) { |
| 246 | + return TextField( |
| 247 | + style: TextStyle(height: 1.3), |
| 248 | + controller: controller, |
| 249 | + decoration: InputDecoration( |
| 250 | + hintText: hintText, |
| 251 | + |
| 252 | + labelStyle: TextStyle( |
| 253 | + fontSize: TEXT_NORMAL_SIZE, |
| 254 | + fontFamily: "Montserrat", |
| 255 | + fontWeight: FontWeight.w400, |
| 256 | + letterSpacing: 1, |
| 257 | + height: 0, |
| 258 | + ), |
| 259 | + border: InputBorder.none, |
| 260 | + ), |
| 261 | + obscureText: obSecure, |
| 262 | + ); |
| 263 | +} |
0 commit comments