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, height: 32.0,
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width / 2, width: MediaQuery.of(context).size.width * 0.7,
child: Form( child: Form(
key: formKey, key: formKey,
child: Padding( child: Padding(
@ -73,17 +73,18 @@ class _RegisterPageState extends State<RegisterPage> {
), ),
child: Column( child: Column(
children: [ children: [
NCFormField( Row(
children: [
Expanded(
child: NCFormField(
label: 'Nome', label: 'Nome',
controller: name, controller: name,
validator: Validatorless.required('Nome é obrigatório'), 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', label: 'Email',
controller: email, controller: email,
validator: Validatorless.multiple( 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', label: 'CPF/CNPJ',
controller: cpfCnpj, controller: cpfCnpj,
inputFormatters: [ inputFormatters: [
@ -109,18 +124,39 @@ class _RegisterPageState extends State<RegisterPage> {
return 'CPF ou CNPJ inválido'; return 'CPF ou CNPJ inválido';
}, },
), ),
),
],
),
NCFormField( NCFormField(
label: 'Site', label: 'Site',
controller: url, 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', label: 'Senha',
controller: password, controller: password,
obscureText: true, obscureText: true,
validator: Validatorless.required('Senha é obrigatória'), validator: Validatorless.required('Senha é obrigatória'),
), ),
NCFormField( ),
const SizedBox(width: 16.0),
Expanded(
child: NCFormField(
label: 'Confirme Senha', label: 'Confirme Senha',
controller: password2, controller: password2,
obscureText: true, obscureText: true,
@ -129,8 +165,11 @@ class _RegisterPageState extends State<RegisterPage> {
Validatorless.compare(password, 'Senhas não conferem'), Validatorless.compare(password, 'Senhas não conferem'),
]), ]),
), ),
),
],
),
NCFormField( NCFormField(
label: 'Canal', label: 'Nome do canal desejado (sem espaços)',
controller: channel, controller: channel,
validator: Validatorless.multiple([ validator: Validatorless.multiple([
Validatorless.required('Nome do canal é obrigatório'), Validatorless.required('Nome do canal é obrigatório'),

View File

@ -1,20 +1,31 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pcastlivetv/components/nc_base_page.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}); const UserPage({super.key});
@override
State<UserPage> createState() => _UserPageState();
}
class _UserPageState extends State<UserPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const NcBasePage( return NcBasePage(
body: Center( body: Center(
child: Padding(
padding: const EdgeInsets.all(60.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ 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(),
], ],
), ),
), ),
),
); );
} }
} }