From 3299bc421755edb3691511dd1ab8d8416e291903 Mon Sep 17 00:00:00 2001 From: vignesh Date: Tue, 17 May 2022 12:30:55 +0530 Subject: [PATCH] business details screen started --- openclosenew/lib/11_busiesshome.dart | 16 ++++- openclosenew/lib/businessdetail.dart | 88 ++++++++++++++++++++++++++++ openclosenew/pubspec.lock | 18 +++--- 3 files changed, 111 insertions(+), 11 deletions(-) create mode 100644 openclosenew/lib/businessdetail.dart diff --git a/openclosenew/lib/11_busiesshome.dart b/openclosenew/lib/11_busiesshome.dart index 887560d..7523dbc 100644 --- a/openclosenew/lib/11_busiesshome.dart +++ b/openclosenew/lib/11_busiesshome.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:openclosenew/businessempty.dart'; import 'package:flutter_switch/flutter_switch.dart'; import '07_addbusiness.dart'; +import 'businessdetail.dart'; class businesshome extends StatefulWidget { const businesshome({Key? key}) : super(key: key); @@ -15,6 +15,7 @@ class _businesshomeState extends State { bool status = false; bool status1 = false; bool status2 = false; + Color _imageColor = Color.fromRGBO(2989, 5870, 1140, 1); int _selectedIndex = 0; static const TextStyle optionStyle = TextStyle( @@ -354,7 +355,10 @@ class _businesshomeState extends State { Padding( padding: const EdgeInsets.only(left: 15), child: InkWell( - onTap: () {}, + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (_) => businessdetail())); + }, child: Container( width: 170, height: 200, @@ -364,6 +368,7 @@ class _businesshomeState extends State { image: AssetImage('assets/images/bg.png'), fit: BoxFit.fitHeight, ), + color: _imageColor, borderRadius: BorderRadius.all( Radius.circular(5), ), @@ -427,6 +432,13 @@ class _businesshomeState extends State { onToggle: (val) { setState(() { status = val; + if (val) { + _imageColor = + Color.fromRGBO(22, 27, 34, 1); + } else { + _imageColor = + Color.fromRGBO(36, 41, 46, 1); + } }); }, activeText: "OPEN", diff --git a/openclosenew/lib/businessdetail.dart b/openclosenew/lib/businessdetail.dart new file mode 100644 index 0000000..6dd4424 --- /dev/null +++ b/openclosenew/lib/businessdetail.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_switch/flutter_switch.dart'; + +class businessdetail extends StatefulWidget { + const businessdetail({Key? key}) : super(key: key); + + @override + State createState() => _businessdetailState(); +} + +class _businessdetailState extends State { + bool status = false; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Column( + children: [ + Spacer(), + SafeArea( + child: Center( + child: Container( + height: 200, + width: 320, + decoration: BoxDecoration( + image: const DecorationImage( + image: AssetImage('assets/images/bg.png'), + fit: BoxFit.fitHeight, + ), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + child: Padding( + padding: const EdgeInsets.only(left: 24, top: 10, right: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + FloatingActionButton( + child: Icon( + Icons.arrow_back, + size: 24, + color: Color(0xFF3D3D3D), + ), + backgroundColor: Colors.white, + onPressed: () {}, + ), + Spacer(), + FlutterSwitch( + width: 110, + height: 60, + valueFontSize: 15, + toggleSize: 25, + value: status, + borderRadius: 30.0, + padding: 8.0, + showOnOff: true, + onToggle: (val) { + setState(() { + status = val; + }); + }, + activeText: "OPEN", + activeSwitchBorder: + Border.all(color: Colors.white, width: 12), + inactiveSwitchBorder: + Border.all(color: Colors.white, width: 12), + activeTextColor: Colors.white, + activeTextFontWeight: FontWeight.w600, + activeColor: Color(0xFF09CD99), + inactiveText: "CLOSED", + inactiveTextColor: Colors.white, + inactiveTextFontWeight: FontWeight.w600, + inactiveColor: Color(0xFFFF4B4C), + ), + ], + ), + ), + ), + ), + ), + Spacer(), + ], + ), + ); + } +} diff --git a/openclosenew/pubspec.lock b/openclosenew/pubspec.lock index 1907adc..00bfdae 100644 --- a/openclosenew/pubspec.lock +++ b/openclosenew/pubspec.lock @@ -56,7 +56,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.16.0" + version: "1.15.0" cross_file: dependency: transitive description: @@ -98,7 +98,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.2.0" ffi: dependency: transitive description: @@ -239,7 +239,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.4" + version: "0.6.3" libphonenumber: dependency: transitive description: @@ -288,7 +288,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.1.3" meta: dependency: transitive description: @@ -302,7 +302,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0" path_drawing: dependency: transitive description: @@ -468,7 +468,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.8.1" stack_trace: dependency: transitive description: @@ -503,7 +503,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.8" typed_data: dependency: transitive description: @@ -524,7 +524,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.1" win32: dependency: transitive description: @@ -554,5 +554,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.17.0-0 <3.0.0" + dart: ">=2.16.2 <3.0.0" flutter: ">=2.10.0-0"