diff --git a/lib/helpers/constants.dart b/lib/helpers/constants.dart index 0e92324..9073531 100644 --- a/lib/helpers/constants.dart +++ b/lib/helpers/constants.dart @@ -20,7 +20,8 @@ class RouteConstant { static const String ADDRESS_SCREEN = '/address-screen'; static const String SIGN_UP_SCREEN = '/sign-up-screen'; static const String MANAGE_ADDRESS_SCREEN = '/manage-address-screen'; - static const String PAYMENT_SUCCESSFULL = '/payment-successfull'; + static const String PAYMENT_SUCCESSFULL = '/payment-successful'; + static const String CHANGE_USERNAME_SCREEN = '/change_username'; } class RelicColors { diff --git a/lib/helpers/route_page.dart b/lib/helpers/route_page.dart index eef15a5..77b49a5 100644 --- a/lib/helpers/route_page.dart +++ b/lib/helpers/route_page.dart @@ -5,7 +5,7 @@ import 'package:retro_shopping/helpers/slide_route.dart'; import 'package:retro_shopping/model/product_model.dart'; import 'package:retro_shopping/views/auth/signup_view.dart'; import 'package:retro_shopping/views/profile/orders.dart'; - +import 'package:retro_shopping/views/change_username_password.dart'; import 'package:retro_shopping/views/auth/login_view.dart'; import 'package:retro_shopping/views/cart_view.dart'; @@ -91,6 +91,10 @@ class RoutePage { return SlideLeftRoute( page: FaqsScreen(), ); + case RouteConstant.CHANGE_USERNAME_SCREEN: + return SlideLeftRoute( + page: ChangeUsername(), + ); case RouteConstant.ADDRESS_SCREEN: return SlideLeftRoute( page: AddressScreen(), diff --git a/lib/views/change_username_password.dart b/lib/views/change_username_password.dart new file mode 100644 index 0000000..c4de0dd --- /dev/null +++ b/lib/views/change_username_password.dart @@ -0,0 +1,253 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:retro_shopping/helpers/constants.dart'; +import 'package:retro_shopping/widgets/retro_button.dart'; + + +class ChangeUsername extends StatefulWidget{ + @override + State createState() { + return ChangeUsernameState(); + } +} + +TextEditingController _userNameController = TextEditingController(); +TextEditingController _passwordController = TextEditingController(); +TextEditingController _confirmPasswordController = TextEditingController(); + + +String _username = ''; +String _password = ''; +String _confirmPassword = ''; + +class ChangeUsernameState extends State{ + @override + Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; + + return Scaffold( + appBar: AppBar( + backgroundColor: RelicColors.backgroundColor, + leading: Padding( + padding: const EdgeInsets.all(8.0), + child: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: RetroButton( + upperColor: Colors.white, + lowerColor: Colors.black, + width: 35, + height: 35, + borderColor: Colors.white, + child: const Icon( + Icons.arrow_back, + color: Colors.black, + ), + ), + ), + ), + elevation: 0.0, + ), + body: Stack( + children: [ + Positioned( + top: 70, + right: 20, + child: Center( + child: Stack( + children:[ + Transform.translate( + offset: const Offset(5,5), + child: Container( + width: width * 0.88, + height: height * 0.615, + decoration: const BoxDecoration(color: Colors.black), + ), + ), + Container( + height: height * 0.61, + //height: 458, + width: width * 0.87, + decoration: const BoxDecoration(color: RelicColors.primaryColor), + child: Center( + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10.0), + child: Row( + children:const [ + Expanded( + child: Text('Change Username or Password', + style: TextStyle( + fontSize: 35, + color: Colors.white, + fontFamily: 'pix M 8pt', + fontWeight: FontWeight.bold + ),), + ), + ], + ), + ), + SizedBox( + height: height*0.011, + ), + Stack( + children:[ + Transform.translate( + offset: const Offset(25,10), + child: Container( + color: Colors.black, + width: width * 0.77, + height: height * 0.08, + ), + ), + Padding( + padding: const EdgeInsets.only(left:20.0, right: 20.0), + child: TextFormField( + controller: _userNameController, + onChanged: (String value){ + _username = value; + }, + decoration: const InputDecoration( + labelText: 'Username', + labelStyle: TextStyle( + fontSize: 20.0, + color: Colors.black + ), + filled: true, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.zero + ) + ) + ), + ), + ] + ), + + SizedBox( + height: height*0.030, + ), + Stack( + children:[ + Transform.translate( + offset: const Offset(25,10), + child: Container( + color: Colors.black, + width: width * 0.77, + height: height * 0.08, + ), + ), + Padding( + padding: const EdgeInsets.only(left:20.0, right: 20.0), + child: TextFormField( + controller: _passwordController, + onChanged: (String value){ + _password = value; + }, + + decoration: const InputDecoration( + labelText: 'Password', + labelStyle: TextStyle( + fontSize: 20.0, + color: Colors.black + ), + filled: true, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.zero + ) + ) + ), + ), + ] + ), + SizedBox( + height: height*0.030, + ), + Stack( + children:[ + Transform.translate( + offset: const Offset(25,10), + child: Container( + color: Colors.black, + width: width * 0.77, + height: height * 0.08, + ), + ), + Padding( + padding: const EdgeInsets.only(left:20.0, right: 20.0), + child: TextFormField( + controller: _confirmPasswordController, + onChanged: (String value){ + _confirmPassword = value; + }, + decoration: const InputDecoration( + labelText: 'Confirm Password', + labelStyle: TextStyle( + fontSize: 20.0, + color: Colors.black + ), + filled: true, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.zero + ) + ) + ), + ), + ] + ), + SizedBox( + height: height*0.030, + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.only(left:20.0, right: 20.0), + child: InkWell( + onTap: (){ + debugPrint('Save!!'); + }, + child: RetroButton( + upperColor: Colors.black, + lowerColor: Colors.white, + height: height * 0.065, + width: width * 0.40, + borderColor: Colors.white, + child: const Center( + child: Text( + 'Save', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ], + ), + SizedBox( + height: height*0.040, + ), + + ], + ), + ), + ) + ), + ], + ), + ), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/views/profile/settings/settings_view.dart b/lib/views/profile/settings/settings_view.dart index 3fc1274..b16a890 100644 --- a/lib/views/profile/settings/settings_view.dart +++ b/lib/views/profile/settings/settings_view.dart @@ -80,6 +80,8 @@ class _SettingsState extends State { context, 'Change Username/\nPassword', Icons.person, + routeName: RouteConstant.CHANGE_USERNAME_SCREEN, + push: true, ), Padding( padding: const EdgeInsets.only(left: 16.0, right: 16.0),