HomeMobile DevelopmentExample code and video Flutter Form - Create form register on flutter Example code and video Flutter Form - Create form register on flutter Makarablue June 24, 2022 0 Code :import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: RegisterForm(), )); } class RegisterForm extends StatefulWidget { RegisterForm({Key? key}) : super(key: key); @override State createState() => _RegisterFormState(); } class _RegisterFormState extends State { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: buildForm(), )); } Container buildForm() { return Container( width: MediaQuery.of(context).size.width * 0.9, height: MediaQuery.of(context).size.height * 0.5, decoration: BoxDecoration( color: const Color.fromARGB(255, 196, 190, 190), borderRadius: BorderRadius.circular(15)), child: Padding( padding: const EdgeInsets.all(40), child: Column( children: [ const Text( "Register Form", style: TextStyle( color: Colors.lightBlue, fontWeight: FontWeight.bold), ), TextFormField( keyboardType: TextInputType.emailAddress, decoration: const InputDecoration(hintText: "Email"), ), TextFormField( keyboardType: TextInputType.text, obscureText: true, decoration: const InputDecoration(hintText: "Password"), ), const SizedBox( height: 10, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( onPressed: () => {}, child: const Text( "Register", style: TextStyle(color: Colors.white), )), const SizedBox( width: 10, ), ElevatedButton( onPressed: () => {}, child: const Text( "Cancel", style: TextStyle(color: Color.fromARGB(255, 238, 34, 34)), )), ], ) ], ), ), ); } } Tags Coding Flutter Mobile Development Newer Older