diff --git a/lib/screens/Contact.dart b/lib/screens/Contact.dart new file mode 100644 index 0000000..00c250a --- /dev/null +++ b/lib/screens/Contact.dart @@ -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 createState() => _ContactState(); +} + +class _ContactState extends State { + + + @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, + ) + + ], + ), + ), + + ); + } +} + diff --git a/lib/screens/HomePage.dart b/lib/screens/HomePage.dart index 5266eb5..096e362 100644 --- a/lib/screens/HomePage.dart +++ b/lib/screens/HomePage.dart @@ -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}); @@ -155,6 +157,16 @@ class _HomePageState extends State { ); })), ); + }), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return NewContact(); })); + }, + tooltip: 'Increment', + child: Icon(Icons.add), + ), + ); } } diff --git a/lib/screens/NewContact.dart b/lib/screens/NewContact.dart new file mode 100644 index 0000000..cebcee0 --- /dev/null +++ b/lib/screens/NewContact.dart @@ -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 createState() => _NewContactState(); +} + +class _NewContactState extends State { + + @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(); + })), + + ); + }, + ) + ); + } +} + + +