From e3f66ffa424c4971d96eedcf9cd29aaa2227bbf7 Mon Sep 17 00:00:00 2001 From: niloysikdar Date: Sun, 2 May 2021 02:58:50 +0530 Subject: [PATCH] OxygenForm UI --- lib/screens/addoxygen.dart | 112 ++++++++++++++++++++++++++++++++++++ lib/screens/plasmaform.dart | 8 +++ lib/screens/signup.dart | 2 + lib/widgets/inputfield.dart | 2 + 4 files changed, 124 insertions(+) diff --git a/lib/screens/addoxygen.dart b/lib/screens/addoxygen.dart index d404d56..16741b8 100644 --- a/lib/screens/addoxygen.dart +++ b/lib/screens/addoxygen.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:plaso_connect/constants/colors.dart'; import 'package:plaso_connect/widgets/formbanner.dart'; +import 'package:plaso_connect/widgets/inputfield.dart'; class AddOxygenDetails extends StatefulWidget { @override @@ -47,9 +49,119 @@ class _AddOxygenDetailsState extends State { size: size, svgPath: "assets/images/medicine.svg", ), + SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: size.height * 0.35, + left: 20, + right: 20, + ), + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + color: kbackgroundLight, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + blurRadius: 10.0, + spreadRadius: 5.0, + offset: Offset(0.0, 0.0), + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "*$headerstring", + style: TextStyle( + color: Colors.red, + fontSize: 15, + ), + ), + SizedBox(height: 10), + inputforOxygen( + controller: titlecontroller, + prefixIcon: Icons.title_rounded, + hintText: "Title of the post", + textInputType: TextInputType.text, + maxLines: 1, + ), + inputforOxygen( + controller: descriptioncontroller, + prefixIcon: Icons.description_rounded, + hintText: "Full Information", + textInputType: TextInputType.text, + maxLines: 3, + ), + inputforOxygen( + controller: pincontroller, + prefixIcon: Icons.location_on_rounded, + hintText: "Area PIN code", + textInputType: TextInputType.number, + maxLines: 1, + ), + SizedBox(height: 30), + GestureDetector( + onTap: () { + print("Posted"); + }, + child: doneBtn(), + ), + ], + ), + ), + ), ], ), ), ); } + + Widget doneBtn() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 30), + child: Material( + elevation: 5, + borderRadius: BorderRadius.circular(15), + color: kelectronBlue[700], + child: Container( + padding: EdgeInsets.symmetric(vertical: 12), + child: Center( + child: Text( + "Post", + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ), + ); + } + + Widget inputforOxygen({ + required TextEditingController controller, + required IconData prefixIcon, + required String hintText, + required TextInputType textInputType, + required int maxLines, + }) { + return Container( + margin: EdgeInsets.symmetric(vertical: 10), + child: inputField( + controller: controller, + prefixIcon: prefixIcon, + hintText: hintText, + textInputType: textInputType, + maxLines: maxLines, + ), + ); + } } diff --git a/lib/screens/plasmaform.dart b/lib/screens/plasmaform.dart index 9b8da89..5819d86 100644 --- a/lib/screens/plasmaform.dart +++ b/lib/screens/plasmaform.dart @@ -125,30 +125,35 @@ class _PlasmaDonateState extends State { prefixIcon: Icons.account_circle_rounded, hintText: "Full Name", textInputType: TextInputType.name, + maxLines: 1, ), inputforPlasma( controller: phonecontroller, prefixIcon: Icons.phone_rounded, hintText: "Phone Number", textInputType: TextInputType.phone, + maxLines: 1, ), inputforPlasma( controller: agecontroller, prefixIcon: Icons.add_rounded, hintText: "Age", textInputType: TextInputType.number, + maxLines: 1, ), inputforPlasma( controller: addresscontroller, prefixIcon: Icons.location_on_rounded, hintText: "Full Address", textInputType: TextInputType.name, + maxLines: 3, ), inputforPlasma( controller: pincontroller, prefixIcon: Icons.location_on_rounded, hintText: "Address PIN code", textInputType: TextInputType.number, + maxLines: 1, ), Padding( padding: const EdgeInsets.symmetric(vertical: 5), @@ -292,6 +297,7 @@ class _PlasmaDonateState extends State { prefixIcon: Icons.date_range_rounded, hintText: "Date of Recovery", textInputType: TextInputType.datetime, + maxLines: 1, ) : Container(height: 0), Row( @@ -408,6 +414,7 @@ class _PlasmaDonateState extends State { required IconData prefixIcon, required String hintText, required TextInputType textInputType, + required int maxLines, }) { return Container( margin: EdgeInsets.symmetric(vertical: 10), @@ -416,6 +423,7 @@ class _PlasmaDonateState extends State { prefixIcon: prefixIcon, hintText: hintText, textInputType: textInputType, + maxLines: maxLines, ), ); } diff --git a/lib/screens/signup.dart b/lib/screens/signup.dart index fa8a283..6292673 100644 --- a/lib/screens/signup.dart +++ b/lib/screens/signup.dart @@ -45,6 +45,7 @@ class _SignUpPageState extends State { prefixIcon: Icons.account_circle_rounded, hintText: "Full Name", textInputType: TextInputType.name, + maxLines: 1, ), SizedBox(height: 25), inputField( @@ -52,6 +53,7 @@ class _SignUpPageState extends State { prefixIcon: Icons.phone, hintText: "Phone Number", textInputType: TextInputType.phone, + maxLines: 1, ), SizedBox(height: 35), loginButton( diff --git a/lib/widgets/inputfield.dart b/lib/widgets/inputfield.dart index ccf3499..3ad01c2 100644 --- a/lib/widgets/inputfield.dart +++ b/lib/widgets/inputfield.dart @@ -7,6 +7,7 @@ Widget inputField({ required IconData prefixIcon, required String hintText, required TextInputType textInputType, + required int maxLines, }) { return Container( decoration: newboxDecoration(), @@ -17,6 +18,7 @@ Widget inputField({ fontSize: 22, color: Colors.grey[700], ), + maxLines: maxLines, decoration: InputDecoration( filled: true, fillColor: Color(0xFFEFEEEE),