You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					75 lines
				
				3.1 KiB
			
		
		
			
		
	
	
					75 lines
				
				3.1 KiB
			| 
								 
											2 years ago
										 
									 | 
							
								import 'package:flutter/material.dart';
							 | 
						||
| 
								 | 
							
								import 'package:healthcare_user/common/settings.dart';
							 | 
						||
| 
								 | 
							
								import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class Invitations extends StatefulWidget {
							 | 
						||
| 
								 | 
							
								  const Invitations({Key? key}) : super(key: key);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  @override
							 | 
						||
| 
								 | 
							
								  State<Invitations> createState() => _InvitationsState();
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class _InvitationsState extends State<Invitations> {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  TextEditingController mobileNumberController = TextEditingController();
							 | 
						||
| 
								 | 
							
								  TextEditingController nameController = TextEditingController();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  final FlutterContactPicker _contactPicker = new FlutterContactPicker();
							 | 
						||
| 
								 | 
							
								  Contact? _contact;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  @override
							 | 
						||
| 
								 | 
							
								  Widget build(BuildContext context) {
							 | 
						||
| 
								 | 
							
								    return Scaffold(
							 | 
						||
| 
								 | 
							
								        appBar: AppSettings.appBar('Invitations'),
							 | 
						||
| 
								 | 
							
								        body: GestureDetector(
							 | 
						||
| 
								 | 
							
								            onTap: () {
							 | 
						||
| 
								 | 
							
								              FocusManager.instance.primaryFocus?.unfocus();
							 | 
						||
| 
								 | 
							
								            },
							 | 
						||
| 
								 | 
							
								            child: SafeArea(
							 | 
						||
| 
								 | 
							
								                child: SingleChildScrollView(
							 | 
						||
| 
								 | 
							
								                    child: Padding(
							 | 
						||
| 
								 | 
							
								                        padding: const EdgeInsets.all(10),
							 | 
						||
| 
								 | 
							
								                        child: Column(
							 | 
						||
| 
								 | 
							
								                          children: [
							 | 
						||
| 
								 | 
							
								                            Container(
							 | 
						||
| 
								 | 
							
								                              child: TextFormField(
							 | 
						||
| 
								 | 
							
								                                cursorColor: greyColor,
							 | 
						||
| 
								 | 
							
								                                controller: nameController,
							 | 
						||
| 
								 | 
							
								                                decoration: textFormFieldDecoration(Icons.phone,'Enter Name'),
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                              ),
							 | 
						||
| 
								 | 
							
								                            ),
							 | 
						||
| 
								 | 
							
								                            SizedBox(height:MediaQuery.of(context).size.height * .02,),
							 | 
						||
| 
								 | 
							
								                            Container(
							 | 
						||
| 
								 | 
							
								                              child: TextFormField(
							 | 
						||
| 
								 | 
							
								                                cursorColor: greyColor,
							 | 
						||
| 
								 | 
							
								                                controller: mobileNumberController,
							 | 
						||
| 
								 | 
							
								                                keyboardType: TextInputType.number,
							 | 
						||
| 
								 | 
							
								                                decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'),
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                              ),
							 | 
						||
| 
								 | 
							
								                            ),
							 | 
						||
| 
								 | 
							
								                            SizedBox(height:MediaQuery.of(context).size.height * .02,),
							 | 
						||
| 
								 | 
							
								                            Container(
							 | 
						||
| 
								 | 
							
								                              child: Text('Or',style: TextStyle(color: primaryColor,fontWeight: FontWeight.bold,fontSize: 20),),
							 | 
						||
| 
								 | 
							
								                            ),
							 | 
						||
| 
								 | 
							
								                            SizedBox(height:MediaQuery.of(context).size.height * .02,),
							 | 
						||
| 
								 | 
							
								                            TextButton(
							 | 
						||
| 
								 | 
							
								                              child: const Text(
							 | 
						||
| 
								 | 
							
								                                'Select from contacts',
							 | 
						||
| 
								 | 
							
								                                style: TextStyle(decoration: TextDecoration.underline,color: primaryColor,fontSize: 20),
							 | 
						||
| 
								 | 
							
								                              ),
							 | 
						||
| 
								 | 
							
								                              onPressed: () async{
							 | 
						||
| 
								 | 
							
								                                Contact? contact = await _contactPicker.selectContact();
							 | 
						||
| 
								 | 
							
								                                setState(() {
							 | 
						||
| 
								 | 
							
								                                  _contact = contact;
							 | 
						||
| 
								 | 
							
								                                });
							 | 
						||
| 
								 | 
							
								                              },
							 | 
						||
| 
								 | 
							
								                            )
							 | 
						||
| 
								 | 
							
								                          ],
							 | 
						||
| 
								 | 
							
								                        )
							 | 
						||
| 
								 | 
							
								                    )))));
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								}
							 |