changes on login and user pages

main
Nilo Roberto C Paim 2023-10-06 08:21:57 -03:00
parent 1d70c21edc
commit 275a351985
2 changed files with 109 additions and 59 deletions

View File

@ -62,7 +62,7 @@ class _RegisterPageState extends State<RegisterPage> {
height: 32.0,
),
SizedBox(
width: MediaQuery.of(context).size.width / 2,
width: MediaQuery.of(context).size.width * 0.7,
child: Form(
key: formKey,
child: Padding(
@ -73,17 +73,18 @@ class _RegisterPageState extends State<RegisterPage> {
),
child: Column(
children: [
NCFormField(
Row(
children: [
Expanded(
child: NCFormField(
label: 'Nome',
controller: name,
validator: Validatorless.required('Nome é obrigatório'),
),
NCFormField(
label: 'Empresa',
controller: companyname,
validator: Validatorless.required('Nome da empresa é obrigatório'),
),
NCFormField(
const SizedBox(width: 16.0),
Expanded(
child: NCFormField(
label: 'Email',
controller: email,
validator: Validatorless.multiple(
@ -93,7 +94,21 @@ class _RegisterPageState extends State<RegisterPage> {
],
),
),
NCFormField(
),
],
),
Row(
children: [
Expanded(
child: NCFormField(
label: 'Empresa',
controller: companyname,
validator: Validatorless.required('Nome da empresa é obrigatório'),
),
),
const SizedBox(width: 16.0),
Expanded(
child: NCFormField(
label: 'CPF/CNPJ',
controller: cpfCnpj,
inputFormatters: [
@ -109,18 +124,39 @@ class _RegisterPageState extends State<RegisterPage> {
return 'CPF ou CNPJ inválido';
},
),
),
],
),
NCFormField(
label: 'Site',
controller: url,
validator: Validatorless.required('Endereço do site é obrigatório'),
// validator: Validatorless.required('Endereço do site é obrigatório'),
validator: (value) {
if (value!.isEmpty) {
return 'Endereço do site é obrigatório';
} else {
final regex = RegExp(
r'(([\w]+:)?//)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,63}(:[\d]+)?(/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?');
if (regex.hasMatch(value)) {
return null;
}
}
return 'Endereço do site inválido';
},
),
NCFormField(
Row(
children: [
Expanded(
child: NCFormField(
label: 'Senha',
controller: password,
obscureText: true,
validator: Validatorless.required('Senha é obrigatória'),
),
NCFormField(
),
const SizedBox(width: 16.0),
Expanded(
child: NCFormField(
label: 'Confirme Senha',
controller: password2,
obscureText: true,
@ -129,8 +165,11 @@ class _RegisterPageState extends State<RegisterPage> {
Validatorless.compare(password, 'Senhas não conferem'),
]),
),
),
],
),
NCFormField(
label: 'Canal',
label: 'Nome do canal desejado (sem espaços)',
controller: channel,
validator: Validatorless.multiple([
Validatorless.required('Nome do canal é obrigatório'),

View File

@ -1,20 +1,31 @@
import 'package:flutter/material.dart';
import 'package:pcastlivetv/components/nc_base_page.dart';
import 'package:velocity_x/velocity_x.dart';
class UserPage extends StatelessWidget {
class UserPage extends StatefulWidget {
const UserPage({super.key});
@override
State<UserPage> createState() => _UserPageState();
}
class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return const NcBasePage(
return NcBasePage(
body: Center(
child: Padding(
padding: const EdgeInsets.all(60.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("User Page"),
"Em breve todos os recursos da plataforma estarão disponíveis".text.bold.white.xl4.make(),
const SizedBox(height: 20),
"Estamos trabalhando para proporcionar a melhor experiência para você".text.bold.white.xl4.make(),
],
),
),
),
);
}
}