Search

Register Screen in Flutter, Dart, Android Studio || Flutter Side by Fresher Side

Below are the output screenshots & source code.

Just copy this source code in your editor & run the program using any emulator.


Output -

Source Code

import 'package:flutter/material.dart';



void main() {

runApp(MaterialApp( home: MyApp(),));

}


class MyApp extends StatefulWidget {

@override

_State createState() => _State();

}


class _State extends State<MyApp> {

TextEditingController nameController = TextEditingController();

TextEditingController passwordController = TextEditingController();

@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

title: Text('Register Screen - Task 2 || Flutter Training'),

),

body: Padding(

padding: EdgeInsets.all(1),

child: Column(

children: <Widget>[

Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: nameController,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Email Address',

hintText: 'Enter Your Email Address',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Date of Birth',

hintText: 'Enter Your Date of Birth',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Enter You Gender',

hintText: 'Male/Female/Other',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Set Password',

hintText: 'Enter Password',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Choose You Country',

hintText: 'Select Country',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Enter Your State',

hintText: 'Enter State',

),

),

),


Padding(

padding: EdgeInsets.all(1),

child: TextField(

controller: passwordController,

obscureText: true,

decoration: InputDecoration(

border: OutlineInputBorder(),

labelText: 'Enter Your City',

hintText: 'Enter City',

),

),

),





RaisedButton(

textColor: Colors.white,

color: Colors.blue,

child: Text('Register Now'),

onPressed: (){

return showDialog(

context: context,

builder: (context) {

return AlertDialog(

title: Text("Login Successful"),

// Retrieve the text which the user has entered by

// using the TextEditingController.

content: Text(nameController.text),

actions: <Widget>[

new FlatButton(

child: new Text('OK'),

onPressed: () {

Navigator.of(context).pop();

},

)

],

);

},

);

},

),


RaisedButton(

textColor: Colors.white,

color: Colors.blue,

child: Text('Forgot Password'),

onPressed: (){

return showDialog(

context: context,

builder: (context) {

return AlertDialog(

title: Text("This feature will be available soon."),


actions: <Widget>[

new FlatButton(

child: new Text('OK'),

onPressed: () {

Navigator.of(context).pop();

},

)

],

);

},

);

},

),





RaisedButton(

textColor: Colors.white,

color: Colors.blue,

child: Text('Already a member ? Log In Now'),

onPressed: (){


},

)

],


)

)

);

}

}



17 views0 comments

Related Posts

See All

1st Day at Corporate Sector || IT Industry

Hello All, In this blog post we are going to see the journey of 1st day in IT Industry. So, Let's Start with our Article. Before starting, I want to let you know that there are some tips at the end, M

Resume Building for Freshers, IT Companies

Hello Freshers, Hope you are great. In this blog post, we are going to see how to make resume for IT Companies (Service based or Product Based) - Both. So, Let's start with our article. Very first thi

Info © Copyright 2020-21 Fresher Side. All rights reserved. Contact us