mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
auth UI and Api
This commit is contained in:
@ -8,9 +8,9 @@ import 'package:syncrow_web/services/locator.dart';
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
initialSetup(); // Perform initial setup, e.g., dependency injection
|
||||
String res = await AuthBloc.getTokenAndValidate();
|
||||
String checkToken = await AuthBloc.getTokenAndValidate();
|
||||
runApp(MyApp(
|
||||
isLoggedIn: res,
|
||||
isLoggedIn: checkToken,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
on<PasswordVisibleEvent>(_passwordVisible);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////// forget password //////////////////////////////////
|
||||
final TextEditingController forgetEmailController = TextEditingController();
|
||||
final TextEditingController forgetPasswordController = TextEditingController();
|
||||
|
@ -48,6 +48,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
final forgetBloc = BlocProvider.of<AuthBloc>(context);
|
||||
return FirstLayer(
|
||||
second: Container(
|
||||
padding:const EdgeInsets.all(50) ,
|
||||
margin: const EdgeInsets.all(50),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
@ -78,12 +79,13 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
child: Form(
|
||||
key: forgetBloc.forgetFormKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 25),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 15),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'Forget Password',
|
||||
style: TextStyle(
|
||||
@ -91,11 +93,12 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Please fill in your account information to retrieve your password',
|
||||
'Please fill in your account information to\n retrieve your password',
|
||||
style: smallTextStyle,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const SizedBox(height: 20),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@ -104,6 +107,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
"Country/Region",
|
||||
style: smallTextStyle,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.2,
|
||||
child: DropdownButtonFormField<String>(
|
||||
@ -136,13 +140,14 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
const SizedBox(height: 20),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text("Account",
|
||||
style: smallTextStyle,),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: TextFormField(
|
||||
@ -161,6 +166,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
children: [
|
||||
Text("One Time Password",
|
||||
style: smallTextStyle,),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: TextFormField(
|
||||
@ -200,6 +206,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
children: [
|
||||
Text("Password",
|
||||
style: smallTextStyle,),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: TextFormField(
|
||||
|
@ -85,7 +85,7 @@ class LoginWebPage extends StatelessWidget {
|
||||
child: Form(
|
||||
key: loginBloc.loginFormKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 25),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -98,7 +98,7 @@ class LoginWebPage extends StatelessWidget {
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
const SizedBox(height: 40),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@ -107,6 +107,9 @@ class LoginWebPage extends StatelessWidget {
|
||||
"Country/Region",
|
||||
style: smallTextStyle,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.2,
|
||||
child: DropdownButtonFormField<String>(
|
||||
@ -147,6 +150,9 @@ class LoginWebPage extends StatelessWidget {
|
||||
Text("Email",
|
||||
style: smallTextStyle,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: TextFormField(
|
||||
@ -164,6 +170,9 @@ class LoginWebPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text("Password", style: smallTextStyle,),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: TextFormField(
|
||||
@ -193,7 +202,7 @@ class LoginWebPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
height: 20,
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.2,
|
||||
@ -212,6 +221,9 @@ class LoginWebPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 32,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Transform.scale(
|
||||
@ -269,7 +281,7 @@ class LoginWebPage extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
const SizedBox(height: 30.0),
|
||||
SizedBox(
|
||||
width: MediaQuery.sizeOf(context).width * 0.2,
|
||||
child: DefaultButton(
|
||||
|
Reference in New Issue
Block a user