Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions lib/screens/Contact.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';

import 'ChatPage.dart';
import 'NewContact.dart';
class Contact extends StatefulWidget {
const Contact({super.key});

// @override
@override
State<Contact> createState() => _ContactState();
}

class _ContactState extends State<Contact> {


@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(" New Contact"),
])

),
body:Form(
child: Column(
children: [
TextFormField(
keyboardType: TextInputType.name,
decoration: InputDecoration(
labelText: 'Name',
hintText: 'enter name',
prefixIcon:Icon(Icons.person),
border: OutlineInputBorder(),
),
onChanged: (String value){
},

),
TextFormField(
keyboardType: TextInputType.phone,
decoration: InputDecoration(
labelText: 'Phone Number',
hintText: 'enter phone number',
prefixIcon:Icon(Icons.phone),
border: OutlineInputBorder(),
),
onChanged: (String value){
},

),
SizedBox(height:30),
MaterialButton(
minWidth: double.infinity ,
onPressed: () {},
child: Text('SAVE'),
color: Colors.teal,
textColor: Colors.white,
)

],
),
),

);
}
}

12 changes: 12 additions & 0 deletions lib/screens/HomePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import 'package:flutter/material.dart';
import 'package:test_app/screens/ChatPage.dart';
import 'package:test_app/screens/NewContact.dart';


class HomePage extends StatefulWidget {
const HomePage({super.key});
Expand Down Expand Up @@ -155,6 +157,16 @@ class _HomePageState extends State<HomePage> {
);
})),
);
}),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return NewContact();
}));
},
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}
59 changes: 59 additions & 0 deletions lib/screens/NewContact.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';

import 'ChatPage.dart';
import 'Contact.dart';
class NewContact extends StatefulWidget {
const NewContact({super.key});

// @override
@override
State<NewContact> createState() => _NewContactState();
}

class _NewContactState extends State<NewContact> {

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme
.of(context)
.colorScheme
.inversePrimary,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Select Contact"),

Row(
children: [
Icon(Icons.search),
])
]

)

),
body: ListView.builder(
itemCount: 1,
itemBuilder: (context, index) {
return ListTile(
leading:CircleAvatar(child: Icon(Icons.person_add),
),

title: Text("New Contact",
style: TextStyle(fontSize:15,fontWeight: FontWeight.bold)),
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) {
return Contact();
})),

);
},
)
);
}
}