From a749d36967c99d814e9b537c08532de5321d214e Mon Sep 17 00:00:00 2001 From: vignesh Date: Sat, 28 May 2022 12:30:42 +0530 Subject: [PATCH] business profile form design continue --- openclosenew/lib/15_addbusinessdetails.dart | 97 ++++++++++++++++----- openclosenew/lib/pages/page_1.dart | 40 +++++++++ 2 files changed, 113 insertions(+), 24 deletions(-) create mode 100644 openclosenew/lib/pages/page_1.dart diff --git a/openclosenew/lib/15_addbusinessdetails.dart b/openclosenew/lib/15_addbusinessdetails.dart index 7202162..eefd593 100644 --- a/openclosenew/lib/15_addbusinessdetails.dart +++ b/openclosenew/lib/15_addbusinessdetails.dart @@ -10,9 +10,28 @@ class addbusinessdetails extends StatefulWidget { class _addbusinessdetailsState extends State { final List items = ['All Days', 'Specific days & timing']; String selectedItem = 'All Days'; + bool isVisibile = true; + List> listDrop = []; + String? selected = null; + void loadData() { + listDrop = []; + listDrop.add(new DropdownMenuItem( + child: new Text('Item No.1'), + value: 'val-1', + )); + listDrop.add(new DropdownMenuItem( + child: new Text('Item No.2'), + value: 'val-2', + )); + listDrop.add(new DropdownMenuItem( + child: new Text('Item No.3'), + value: 'val-3', + )); + } @override Widget build(BuildContext context) { + loadData(); return Scaffold( body: SafeArea( child: Column( @@ -53,7 +72,7 @@ class _addbusinessdetailsState extends State { fontFamily: "Manrope", fontStyle: FontStyle.normal, fontWeight: FontWeight.w300, - fontSize: 14, + fontSize: 15, color: Color(0xFF333333)), ), SizedBox( @@ -74,42 +93,72 @@ class _addbusinessdetailsState extends State { fontFamily: "Manrope", fontStyle: FontStyle.normal, fontWeight: FontWeight.w300, - fontSize: 14, + fontSize: 15, color: Color(0xFF333333), ), ), + SizedBox( + height: 15, + ), Row( children: [ Expanded( - child: Container( - padding: EdgeInsets.all(10), - child: DropdownButtonHideUnderline( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: DropdownButton( - icon: Icon(Icons.keyboard_arrow_down_rounded), - iconSize: 30, - value: selectedItem, - onChanged: (String? string) => - setState(() => selectedItem = string!), - selectedItemBuilder: (BuildContext context) { - return items.map((String item) { - return Text(item); - }).toList(); - }, - items: items.map((String item) { - return DropdownMenuItem( - value: item, - child: Text('$item'), - ); - }).toList(), + child: InputDecorator( + decoration: InputDecoration( + contentPadding: EdgeInsets.only( + left: 10, top: 1, bottom: 1, right: 5), + border: OutlineInputBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(5), + bottomLeft: Radius.circular(5), ), ), ), + child: DropdownButtonHideUnderline( + child: new DropdownButton( + borderRadius: BorderRadius.circular(10), + value: selected, + items: listDrop, + icon: Icon(Icons.keyboard_arrow_down, size: 24), + hint: new Text('Choose...'), + onChanged: (value) { + selected = value as String?; + setState(() => isVisibile = !isVisibile); + }, + ), + ), ), ), ], ), + Visibility( + visible: isVisibile, + child: Row( + children: [ + Text( + "From", + style: TextStyle( + fontFamily: "Manrope", + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w300, + fontSize: 15, + ), + ), + SizedBox( + width: 120, + ), + Text( + "To", + style: TextStyle( + fontFamily: "Manrope", + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w300, + fontSize: 15, + ), + ), + ], + ), + ), ], ), ), diff --git a/openclosenew/lib/pages/page_1.dart b/openclosenew/lib/pages/page_1.dart new file mode 100644 index 0000000..a616389 --- /dev/null +++ b/openclosenew/lib/pages/page_1.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; + +class page1 extends StatelessWidget { + const page1({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.transparent, + body: Container( + height: 400, + child: Row( + children: [ + Text( + "From", + style: TextStyle( + fontFamily: "Manrope", + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w300, + fontSize: 15, + ), + ), + SizedBox( + width: 120, + ), + Text( + "To", + style: TextStyle( + fontFamily: "Manrope", + fontStyle: FontStyle.normal, + fontWeight: FontWeight.w300, + fontSize: 15, + ), + ), + ], + ), + ), + ); + } +}