import 'package:flutter_login/flutter_login.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; // //Still to add: // Email verification, that the input has "@" and "." // Send email and password to database // // // class RegisterPage extends StatefulWidget{ RegisterPage({Key key, this.title}) : super(key: key); final String title; @override _RegisterPageState createState() => _RegisterPageState(); } class _RegisterPageState extends State { TextEditingController email; TextEditingController password; TextEditingController confirmpass; // Future send_data() async { // final data = await // } String _SamePass(){ if(password == confirmpass){ return "Same password"; } else{ return "Different passwords"; } } Widget _BackButton(BuildContext context){ return InkWell( onTap: (){ Navigator.pop(context); }, child: Row( children: [ Container( padding: EdgeInsets.only(left: 0, top: 10, bottom: 10), child: Icon(Icons.arrow_back_ios, color: Colors.black), ), Text("Back", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500)) ] ), ); } Widget _SubmitButton(BuildContext context){ return InkWell( onTap: (){ }, child: Container( padding: EdgeInsets.symmetric(vertical: 10), width: 250, alignment: Alignment.center, decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(30), ), child: Text( "Submit", style: TextStyle(fontSize: 22, color: Colors.white), ), ), ); } Widget _EntryField(String title, TextEditingController controller, {bool pass = false}){ return Container( padding: EdgeInsets.only(left: 0, top: 10, bottom: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), ), SizedBox( height: 30 ), TextField( controller: controller, obscureText: pass, decoration: InputDecoration( border: ( UnderlineInputBorder() ), ), ) ] ), ); } Widget _Fills(){ return Column( children: [ _EntryField("Email", email), _EntryField("Password", password, pass: true), _EntryField("Confirm Password", confirmpass, pass: true) ] ); } //add column or stack @override Widget build(BuildContext context) { final height = MediaQuery.of(context).size.height; return Scaffold( body: Container( height: height, child: Stack( children: [ Container( padding: EdgeInsets.symmetric(horizontal: 20), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( height: 200, ), _Fills(), //Add code to verify if password and confirm password match SizedBox( height: 20, ), _SubmitButton(context), ], ), ) ), Positioned( top: 12, left: 20, child: _BackButton(context), ), ], ), ) ); } }