Add new mih text form field to Auth
This commit is contained in:
@@ -2,11 +2,13 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
|
||||||
import '../../mih_components/mih_layout/mih_action.dart';
|
import '../../mih_components/mih_layout/mih_action.dart';
|
||||||
import '../../mih_components/mih_layout/mih_body.dart';
|
import '../../mih_components/mih_layout/mih_body.dart';
|
||||||
import '../../mih_components/mih_layout/mih_header.dart';
|
import '../../mih_components/mih_layout/mih_header.dart';
|
||||||
@@ -25,6 +27,7 @@ class ForgotPassword extends StatefulWidget {
|
|||||||
|
|
||||||
class _ForgotPasswordState extends State<ForgotPassword> {
|
class _ForgotPasswordState extends State<ForgotPassword> {
|
||||||
final emailController = TextEditingController();
|
final emailController = TextEditingController();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
//bool _obscureText = true;
|
//bool _obscureText = true;
|
||||||
bool successfulForgotPassword = false;
|
bool successfulForgotPassword = false;
|
||||||
@@ -244,40 +247,53 @@ class _ForgotPasswordState extends State<ForgotPassword> {
|
|||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
|
MihForm(
|
||||||
//email input
|
formKey: _formKey,
|
||||||
SizedBox(
|
formFields: [
|
||||||
width: 500.0,
|
MihTextFormField(
|
||||||
child: MIHTextField(
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
controller: emailController,
|
.theme
|
||||||
hintText: 'Email',
|
.secondaryColor(),
|
||||||
editable: true,
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 25),
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
prePassResteWarning();
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Reset Password",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.primaryColor(),
|
||||||
fontSize: 20,
|
controller: emailController,
|
||||||
fontWeight: FontWeight.bold,
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Email",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validateEmail(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
//spacer
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
prePassResteWarning();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Reset Password",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
//import '../objects/sessionST.dart';
|
|
||||||
//import 'package:supertokens_flutter/supertokens.dart';
|
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
|
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart';
|
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
|
||||||
import '../../mih_components/mih_layout/mih_action.dart';
|
import '../../mih_components/mih_layout/mih_action.dart';
|
||||||
import '../../mih_components/mih_layout/mih_body.dart';
|
import '../../mih_components/mih_layout/mih_body.dart';
|
||||||
import '../../mih_components/mih_layout/mih_header.dart';
|
import '../../mih_components/mih_layout/mih_header.dart';
|
||||||
@@ -37,6 +35,7 @@ class _RegisterState extends State<Register> {
|
|||||||
final officeID = TextEditingController();
|
final officeID = TextEditingController();
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
bool _obscureText = true;
|
bool _obscureText = true;
|
||||||
|
|
||||||
bool successfulSignUp = false;
|
bool successfulSignUp = false;
|
||||||
@@ -218,19 +217,8 @@ class _RegisterState extends State<Register> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateInput() async {
|
void submitFormInput() async {
|
||||||
if (emailController.text.isEmpty ||
|
await signUserUp();
|
||||||
passwordController.text.isEmpty ||
|
|
||||||
confirmPasswordController.text.isEmpty) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(errorType: "Input Error");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await signUserUp();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void toggle() {
|
void toggle() {
|
||||||
@@ -325,7 +313,9 @@ class _RegisterState extends State<Register> {
|
|||||||
onKeyEvent: (event) async {
|
onKeyEvent: (event) async {
|
||||||
if (event is KeyDownEvent &&
|
if (event is KeyDownEvent &&
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitFormInput();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
@@ -360,92 +350,128 @@ class _RegisterState extends State<Register> {
|
|||||||
),
|
),
|
||||||
//spacer
|
//spacer
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
//email input
|
MihForm(
|
||||||
SizedBox(
|
formKey: _formKey,
|
||||||
width: 500.0,
|
formFields: [
|
||||||
child: MIHTextField(
|
//email input
|
||||||
controller: emailController,
|
MihTextFormField(
|
||||||
hintText: 'Email',
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
editable: true,
|
.theme
|
||||||
required: true,
|
.secondaryColor(),
|
||||||
),
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
//password input
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
child: MIHPassField(
|
|
||||||
controller: passwordController,
|
|
||||||
hintText: 'Password',
|
|
||||||
required: true,
|
|
||||||
signIn: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
//password input
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
child: MIHPassField(
|
|
||||||
controller: confirmPasswordController,
|
|
||||||
hintText: 'Confirm Password',
|
|
||||||
required: true,
|
|
||||||
signIn: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 25),
|
|
||||||
// sign up button
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
validateInput();
|
|
||||||
},
|
|
||||||
buttonColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.successColor(),
|
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Create New Account",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.primaryColor(),
|
||||||
fontSize: 20,
|
controller: emailController,
|
||||||
fontWeight: FontWeight.bold,
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Email",
|
||||||
|
autofillHints: const [AutofillHints.email],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().validateEmail(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
//spacer
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
|
//password input
|
||||||
const SizedBox(height: 10),
|
MihTextFormField(
|
||||||
//register text
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
SizedBox(
|
.theme
|
||||||
width: 500.0,
|
.secondaryColor(),
|
||||||
//height: 100.0,
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
child: Row(
|
.theme
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
.primaryColor(),
|
||||||
children: [
|
controller: passwordController,
|
||||||
const Text(
|
multiLineInput: false,
|
||||||
'Already a User?',
|
requiredText: true,
|
||||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
hintText: "Password",
|
||||||
),
|
passwordMode: true,
|
||||||
const SizedBox(
|
autofillHints: const [AutofillHints.password],
|
||||||
width: 6,
|
validator: (value) {
|
||||||
),
|
return MihValidationServices()
|
||||||
GestureDetector(
|
.validatePassword(value);
|
||||||
onTap: widget.onTap,
|
},
|
||||||
|
),
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: confirmPasswordController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Confirm Password",
|
||||||
|
passwordMode: true,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validatePassword(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
// sign up button
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitFormInput();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.successColor(),
|
||||||
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Sign In',
|
"Create New Account",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
color: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
),
|
||||||
),
|
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
//register text
|
||||||
|
SizedBox(
|
||||||
|
width: 300.0,
|
||||||
|
//height: 100.0,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
'Already a User?',
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 18, color: Colors.grey),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 6,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: widget.onTap,
|
||||||
|
child: Text(
|
||||||
|
'Sign In',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
//here
|
||||||
|
),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart';
|
|
||||||
import '../../mih_components/mih_layout/mih_action.dart';
|
import '../../mih_components/mih_layout/mih_action.dart';
|
||||||
import '../../mih_components/mih_layout/mih_body.dart';
|
import '../../mih_components/mih_layout/mih_body.dart';
|
||||||
import '../../mih_components/mih_layout/mih_header.dart';
|
import '../../mih_components/mih_layout/mih_header.dart';
|
||||||
@@ -35,6 +37,7 @@ class _ResetPasswordState extends State<ResetPassword> {
|
|||||||
bool acceptWarning = false;
|
bool acceptWarning = false;
|
||||||
// focus node to capture keyboard events
|
// focus node to capture keyboard events
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
|
|
||||||
@@ -131,16 +134,8 @@ class _ResetPasswordState extends State<ResetPassword> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateInput() async {
|
void submitFormInput() async {
|
||||||
if (passwordController.text.isEmpty ||
|
if (passwordController.text != confirmPasswordController.text) {
|
||||||
confirmPasswordController.text.isEmpty) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(errorType: "Input Error");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else if (passwordController.text != confirmPasswordController.text) {
|
|
||||||
passwordError();
|
passwordError();
|
||||||
} else {
|
} else {
|
||||||
await submitPasswodReset();
|
await submitPasswodReset();
|
||||||
@@ -195,7 +190,9 @@ class _ResetPasswordState extends State<ResetPassword> {
|
|||||||
onKeyEvent: (event) async {
|
onKeyEvent: (event) async {
|
||||||
if (event is KeyDownEvent &&
|
if (event is KeyDownEvent &&
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitFormInput();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
@@ -229,63 +226,97 @@ class _ResetPasswordState extends State<ResetPassword> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
//spacer
|
//spacer
|
||||||
// const SizedBox(height: 15),
|
|
||||||
// Text(
|
|
||||||
// 'token: ${widget.token}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 15,
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// color: MzanziInnovationHub.of(context)!
|
|
||||||
// .theme
|
|
||||||
// .secondaryColor(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
//email input
|
MihForm(
|
||||||
SizedBox(
|
formKey: _formKey,
|
||||||
width: 500.0,
|
formFields: [
|
||||||
child: MIHPassField(
|
MihTextFormField(
|
||||||
controller: passwordController,
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
hintText: 'New Password',
|
.theme
|
||||||
required: true,
|
.secondaryColor(),
|
||||||
signIn: false,
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
),
|
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
//password input
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
child: MIHPassField(
|
|
||||||
controller: confirmPasswordController,
|
|
||||||
hintText: 'Confirm New Password',
|
|
||||||
required: true,
|
|
||||||
signIn: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 25),
|
|
||||||
// sign in button
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
validateInput();
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Reset Password",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.primaryColor(),
|
||||||
fontSize: 20,
|
controller: passwordController,
|
||||||
fontWeight: FontWeight.bold,
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Password",
|
||||||
|
passwordMode: true,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validatePassword(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
//spacer
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: confirmPasswordController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Confirm Password",
|
||||||
|
passwordMode: true,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validatePassword(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// //email input
|
||||||
|
// SizedBox(
|
||||||
|
// width: 500.0,
|
||||||
|
// child: MIHPassField(
|
||||||
|
// controller: passwordController,
|
||||||
|
// hintText: 'New Password',
|
||||||
|
// required: true,
|
||||||
|
// signIn: false,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// //spacer
|
||||||
|
// const SizedBox(height: 10),
|
||||||
|
// //password input
|
||||||
|
// SizedBox(
|
||||||
|
// width: 500.0,
|
||||||
|
// child: MIHPassField(
|
||||||
|
// controller: confirmPasswordController,
|
||||||
|
// hintText: 'Confirm New Password',
|
||||||
|
// required: true,
|
||||||
|
// signIn: false,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 25),
|
||||||
|
// sign in button
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitFormInput();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Reset Password",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_pass_input.dart';
|
|
||||||
import '../../mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
|
||||||
import '../../mih_components/mih_layout/mih_action.dart';
|
import '../../mih_components/mih_layout/mih_action.dart';
|
||||||
import '../../mih_components/mih_layout/mih_body.dart';
|
import '../../mih_components/mih_layout/mih_body.dart';
|
||||||
import '../../mih_components/mih_layout/mih_header.dart';
|
import '../../mih_components/mih_layout/mih_header.dart';
|
||||||
@@ -34,6 +35,7 @@ class _SignInState extends State<SignIn> {
|
|||||||
|
|
||||||
// focus node to capture keyboard events
|
// focus node to capture keyboard events
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
|
|
||||||
@@ -99,7 +101,9 @@ class _SignInState extends State<SignIn> {
|
|||||||
emailController.text = "testpatient@mzansi-innovation-hub.co.za";
|
emailController.text = "testpatient@mzansi-innovation-hub.co.za";
|
||||||
passwordController.text = "Testprofile@1234";
|
passwordController.text = "Testprofile@1234";
|
||||||
});
|
});
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tileName: "Patient",
|
tileName: "Patient",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
@@ -116,7 +120,9 @@ class _SignInState extends State<SignIn> {
|
|||||||
emailController.text = "testdoctor@mzansi-innovation-hub.co.za";
|
emailController.text = "testdoctor@mzansi-innovation-hub.co.za";
|
||||||
passwordController.text = "Testprofile@1234";
|
passwordController.text = "Testprofile@1234";
|
||||||
});
|
});
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tileName: "Doctor",
|
tileName: "Doctor",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
@@ -134,7 +140,9 @@ class _SignInState extends State<SignIn> {
|
|||||||
emailController.text = "test-business@mzansi-innovation-hub.co.za";
|
emailController.text = "test-business@mzansi-innovation-hub.co.za";
|
||||||
passwordController.text = "Testprofile@1234";
|
passwordController.text = "Testprofile@1234";
|
||||||
});
|
});
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tileName: "Business",
|
tileName: "Business",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
@@ -151,7 +159,9 @@ class _SignInState extends State<SignIn> {
|
|||||||
emailController.text = "test@mzansi-innovation-hub.co.za";
|
emailController.text = "test@mzansi-innovation-hub.co.za";
|
||||||
passwordController.text = "Testprofile@1234";
|
passwordController.text = "Testprofile@1234";
|
||||||
});
|
});
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tileName: "Test",
|
tileName: "Test",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
@@ -174,27 +184,17 @@ class _SignInState extends State<SignIn> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateInput() async {
|
void submitSignInForm() async {
|
||||||
if (emailController.text.isEmpty || passwordController.text.isEmpty) {
|
await signUserIn();
|
||||||
showDialog(
|
if (successfulSignIn) {
|
||||||
context: context,
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||||
builder: (context) {
|
'/',
|
||||||
return const MIHErrorMessage(errorType: "Input Error");
|
(route) => false,
|
||||||
},
|
arguments: AuthArguments(
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
await signUserIn();
|
|
||||||
if (successfulSignIn) {
|
|
||||||
// TextInput.finishAutofillContext();
|
|
||||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
|
||||||
'/',
|
|
||||||
(route) => false,
|
|
||||||
arguments: AuthArguments(
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,9 @@ class _SignInState extends State<SignIn> {
|
|||||||
onKeyEvent: (event) async {
|
onKeyEvent: (event) async {
|
||||||
if (event is KeyDownEvent &&
|
if (event is KeyDownEvent &&
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
validateInput();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
@@ -407,241 +409,213 @@ class _SignInState extends State<SignIn> {
|
|||||||
),
|
),
|
||||||
//spacer
|
//spacer
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
|
MihForm(
|
||||||
// SizedBox(
|
formKey: _formKey,
|
||||||
// width: 500.0,
|
formFields: [
|
||||||
// //height: 100.0,
|
MihTextFormField(
|
||||||
// child: Row(
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
// mainAxisAlignment: MainAxisAlignment.start,
|
.theme
|
||||||
// children: [
|
.secondaryColor(),
|
||||||
// GestureDetector(
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
// onTap: () {
|
|
||||||
// showSandboxProfiles();
|
|
||||||
// },
|
|
||||||
// child: Text(
|
|
||||||
// 'Sandbox Profile',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18,
|
|
||||||
// color: MzanziInnovationHub.of(context)!
|
|
||||||
// .theme
|
|
||||||
// .secondaryColor(),
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 10),
|
|
||||||
//email input
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
child: MIHTextField(
|
|
||||||
controller: emailController,
|
|
||||||
hintText: 'Email',
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
autoFillHintGroup: const [AutofillHints.email],
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
//password input
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
child: MIHPassField(
|
|
||||||
controller: passwordController,
|
|
||||||
hintText: 'Password',
|
|
||||||
required: true,
|
|
||||||
signIn: true,
|
|
||||||
autoFillHintGroup: const [AutofillHints.password],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
//height: 100.0,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
'/forgot-password',
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Forgot Password?',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 30),
|
|
||||||
// sign in button
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
validateInput();
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Sign In",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.primaryColor(),
|
||||||
fontSize: 20,
|
controller: emailController,
|
||||||
fontWeight: FontWeight.bold,
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Email",
|
||||||
|
autofillHints: const [AutofillHints.email],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validateEmail(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
//spacer
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 10),
|
//password input
|
||||||
MihButton(
|
MihTextFormField(
|
||||||
onPressed: widget.onTap,
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
.theme
|
||||||
.theme
|
.secondaryColor(),
|
||||||
.successColor(),
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Create New Account",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.primaryColor(),
|
||||||
fontSize: 20,
|
controller: passwordController,
|
||||||
fontWeight: FontWeight.bold,
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Password",
|
||||||
|
passwordMode: true,
|
||||||
|
autofillHints: const [AutofillHints.password],
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices()
|
||||||
|
.validatePassword(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
SizedBox(
|
||||||
),
|
width: 500.0,
|
||||||
//spacer
|
//height: 100.0,
|
||||||
const SizedBox(height: 10),
|
child: Row(
|
||||||
//register text
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
// SizedBox(
|
children: [
|
||||||
// width: 500.0,
|
GestureDetector(
|
||||||
// //height: 100.0,
|
onTap: () {
|
||||||
// child: Row(
|
Navigator.of(context).pushNamed(
|
||||||
// mainAxisAlignment: MainAxisAlignment.end,
|
'/forgot-password',
|
||||||
// children: [
|
);
|
||||||
// Text(
|
},
|
||||||
// 'New User?',
|
child: Text(
|
||||||
// style: TextStyle(
|
'Forgot Password?',
|
||||||
// fontSize: 18,
|
style: TextStyle(
|
||||||
// color: MzanziInnovationHub.of(context)!
|
|
||||||
// .theme
|
|
||||||
// .messageTextColor()),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 6,
|
|
||||||
// ),
|
|
||||||
// GestureDetector(
|
|
||||||
// onTap: widget.onTap,
|
|
||||||
// child: Text(
|
|
||||||
// 'Register Now',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18,
|
|
||||||
// color: MzanziInnovationHub.of(context)!
|
|
||||||
// .theme
|
|
||||||
// .secondaryColor(),
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 15),
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
//height: 100.0,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
const Flexible(
|
|
||||||
flex: 1,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(right: 10.0),
|
|
||||||
child: Divider(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
flex: 1,
|
|
||||||
child: GestureDetector(
|
|
||||||
child: Text(
|
|
||||||
'Use Sandox Profile',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: MzanziInnovationHub.of(context)!
|
color: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor()),
|
.secondaryColor(),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
],
|
||||||
setState(() {
|
|
||||||
showProfiles = !showProfiles;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const Flexible(
|
|
||||||
flex: 1,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(left: 10.0),
|
|
||||||
child: Divider(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Visibility(
|
|
||||||
visible: showProfiles,
|
|
||||||
child: SizedBox(
|
|
||||||
width: 500,
|
|
||||||
child: Column(
|
|
||||||
//mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
GridView.builder(
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemCount: sandboxProfileList.length,
|
|
||||||
gridDelegate:
|
|
||||||
const SliverGridDelegateWithMaxCrossAxisExtent(
|
|
||||||
mainAxisSpacing: 10,
|
|
||||||
maxCrossAxisExtent: 100),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return sandboxProfileList[index];
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Text(
|
|
||||||
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
fontSize: 15.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
// sign in button
|
||||||
|
Center(
|
||||||
|
child: Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
runAlignment: WrapAlignment.center,
|
||||||
|
spacing: 10,
|
||||||
|
runSpacing: 10,
|
||||||
|
children: [
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitSignInForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor:
|
||||||
|
MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Sign In",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihButton(
|
||||||
|
onPressed: widget.onTap,
|
||||||
|
buttonColor:
|
||||||
|
MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.successColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Create New Account",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
SizedBox(
|
||||||
|
width: 500.0,
|
||||||
|
//height: 100.0,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(right: 10.0),
|
||||||
|
child: Divider(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: GestureDetector(
|
||||||
|
child: Text(
|
||||||
|
'Use Sandox Profile',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 15,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor()),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
showProfiles = !showProfiles;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 10.0),
|
||||||
|
child: Divider(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Visibility(
|
||||||
|
visible: showProfiles,
|
||||||
|
child: SizedBox(
|
||||||
|
width: 500,
|
||||||
|
child: Column(
|
||||||
|
//mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
GridView.builder(
|
||||||
|
physics:
|
||||||
|
const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: sandboxProfileList.length,
|
||||||
|
gridDelegate:
|
||||||
|
const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
mainAxisSpacing: 10,
|
||||||
|
maxCrossAxisExtent: 100),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return sandboxProfileList[index];
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
fontSize: 15.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user