import 'package:flutter/material.dart';
import 'package:flutter_/style.dart';
class Registration extends StatefulWidget {
@override
State<Registration> createState() => _Registration();
}
class _Registration extends State<Registration> {
Widget button(text, linc) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: s.buttonColor, minimumSize: Size(2500, 70)),
onPressed: () {
Navigator.pushNamed(context, linc);
submitForm();
},
child: Text("${text}", style: TextStyle(color: Colors.white)),
);
}
@override
Widget build(BuildContext context) {
final _nameController = TextEditingController();
final _passwordController = TextEditingController();
return Scaffold(
backgroundColor: s.backgroundColor,
appBar: AppBar(
centerTitle: true,
backgroundColor: s.appBarColor,
title: Text("Регистрация", style: TextStyle(color: Colors.white)),
),
body: Center(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 100, vertical: 100),
child: Column(
children: [
Icon(
Icons.watch_later,
color: s.buttonColor,
size: 150,
),
SizedBox(
height: 50,
),
TextFormField(
controller: _nameController,
decoration: InputDecoration(labelText: "Имя пользователя"),
),
TextFormField(
controller: _passwordController,
decoration: InputDecoration(labelText: "Пароль"),
),
SizedBox(
height: 50,
),
button("Зарегистрироваться", "/home_page_schedule")
],
)),
));
}
void submitForm() {
print("Name ${_nameController.text}");
}
}
import 'package:flutter/material.dart';
import 'package:flutter_/style.dart';
class Registration extends StatefulWidget {
@override
State<Registration> createState() => _Registration();
}
class _Registration extends State<Registration> {
final _nameController = TextEditingController();
final _passwordController = TextEditingController();
Widget button(text, linc) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: s.buttonColor, minimumSize: Size(2500, 70)),
onPressed: () {
Navigator.pushNamed(context, linc);
submitForm();
},
child: Text("${text}", style: TextStyle(color: Colors.white)),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: s.backgroundColor,
appBar: AppBar(
centerTitle: true,
backgroundColor: s.appBarColor,
title: Text("Регистрация", style: TextStyle(color: Colors.white)),
),
body: Center(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 100, vertical: 100),
child: Column(
children: [
Icon(
Icons.watch_later,
color: s.buttonColor,
size: 150,
),
SizedBox(
height: 50,
),
TextFormField(
controller: _nameController,
decoration: InputDecoration(labelText: "Имя пользователя"),
),
TextFormField(
controller: _passwordController,
decoration: InputDecoration(labelText: "Пароль"),
),
SizedBox(
height: 50,
),
button("Зарегистрироваться", "/home_page_schedule")
],
)),
));
}
void submitForm() {
print("Name ${_nameController.text}");
}
}