Skip to content

Commit

Permalink
resolved all the warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Samdid committed Mar 25, 2021
1 parent 5051643 commit a7f57e7
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 99 deletions.
3 changes: 2 additions & 1 deletion lib/helpers/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion lib/helpers/route_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(),
Expand Down
163 changes: 66 additions & 97 deletions lib/views/change_username_password.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:retro_shopping/helpers/constants.dart';
import 'package:retro_shopping/views/settings.dart';
import 'package:retro_shopping/widgets/retro_button.dart';


Expand All @@ -17,9 +16,9 @@ TextEditingController _passwordController = TextEditingController();
TextEditingController _confirmPasswordController = TextEditingController();


String _username = "";
String _password = "";
String _confirmPassword = "";
String _username = '';
String _password = '';
String _confirmPassword = '';

class ChangeUsernameState extends State<ChangeUsername>{
@override
Expand Down Expand Up @@ -52,15 +51,13 @@ class ChangeUsernameState extends State<ChangeUsername>{
elevation: 0.0,
),
body: Stack(
// ignore: always_specify_types
children: [
children: <Widget>[
Positioned(
top: 70,
right: 20,
child: Center(
child: Stack(
// ignore: always_specify_types
children: [
children:<Widget>[
Transform.translate(
offset: const Offset(5,5),
child: Container(
Expand All @@ -77,15 +74,12 @@ class ChangeUsernameState extends State<ChangeUsername>{
child: Center(
child: SingleChildScrollView(
child: Column(
// ignore: always_specify_types
children: [
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10.0),
child: Row(
// ignore: always_specify_types, prefer_const_literals_to_create_immutables
children: [
// ignore: prefer_const_literals_to_create_immutables,
const Expanded(
children:const <Widget>[
Expanded(
child: Text('Change Username or Password',
style: TextStyle(
fontSize: 35,
Expand All @@ -101,39 +95,34 @@ class ChangeUsernameState extends State<ChangeUsername>{
height: height*0.011,
),
Stack(
// ignore: always_specify_types
children:[
children:<Widget>[
Transform.translate(
offset: const Offset(25,10),
child: Container(
color: Colors.black,
width: width * 0.77,
height: height * 0.065,
height: height * 0.08,
),
),
Padding(
padding: const EdgeInsets.only(left:20.0, right: 20.0),
// ignore: sized_box_for_whitespace
child: Container(
height: height*0.07,
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
)
)
),
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
)
)
),
),
]
Expand All @@ -143,40 +132,35 @@ class ChangeUsernameState extends State<ChangeUsername>{
height: height*0.030,
),
Stack(
// ignore: always_specify_types
children:[
children:<Widget>[
Transform.translate(
offset: const Offset(25,10),
child: Container(
color: Colors.black,
width: width * 0.77,
height: height * 0.065,
height: height * 0.08,
),
),
Padding(
padding: const EdgeInsets.only(left:20.0, right: 20.0),
// ignore: sized_box_for_whitespace
child: Container(
height: height*0.07,
child: TextFormField(
controller: _passwordController,
onChanged: (String value){
_password = value;
},
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
)
)
),
decoration: const InputDecoration(
labelText: 'Password',
labelStyle: TextStyle(
fontSize: 20.0,
color: Colors.black
),
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.zero
)
)
),
),
]
Expand All @@ -185,40 +169,34 @@ class ChangeUsernameState extends State<ChangeUsername>{
height: height*0.030,
),
Stack(
// ignore: always_specify_types
children:[
children:<Widget>[
Transform.translate(
offset: const Offset(25,10),
child: Container(
color: Colors.black,
width: width * 0.77,
height: height * 0.065,
height: height * 0.08,
),
),
Padding(
padding: const EdgeInsets.only(left:20.0, right: 20.0),
// ignore: sized_box_for_whitespace
child: Container(
height: height*0.07,
child: TextFormField(
controller: _confirmPasswordController,
onChanged: (String value){
_confirmPassword = value;
},
// ignore: missing_return
decoration: const InputDecoration(
labelText: 'Confirm Password',
labelStyle: TextStyle(
fontSize: 20.0,
color: Colors.black
),
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.zero
)
)
),
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
)
)
),
),
]
Expand All @@ -227,21 +205,12 @@ class ChangeUsernameState extends State<ChangeUsername>{
height: height*0.030,
),
Row(
// ignore: always_specify_types
children: [
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left:20.0, right: 20.0),
child: InkWell(
onTap: (){
debugPrint('Save!!');
// ignore: always_specify_types
// ignore: always_specify_types
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context){
return Settings();
})
)
;
},
child: RetroButton(
upperColor: Colors.black,
Expand Down
2 changes: 2 additions & 0 deletions lib/views/profile/settings/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class _SettingsState extends State<Settings> {
context,
'Change Username/\nPassword',
Icons.person,
routeName: RouteConstant.CHANGE_USERNAME_SCREEN,
push: true,
),
Padding(
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
Expand Down

0 comments on commit a7f57e7

Please sign in to comment.