From 033df91288229c717af3e96026ca931a84746f15 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Wed, 5 Nov 2025 15:37:19 +0530 Subject: [PATCH] edit profile changes --- lib/profile/employees.dart | 5 +- lib/profile/service_location.dart | 347 ++++++++++++++++++++++++++++++ lib/profile/source_location.dart | 37 +++- lib/profile/source_location1.dart | 314 --------------------------- 4 files changed, 381 insertions(+), 322 deletions(-) create mode 100644 lib/profile/service_location.dart delete mode 100644 lib/profile/source_location1.dart diff --git a/lib/profile/employees.dart b/lib/profile/employees.dart index 9f880f8..99c7d2d 100644 --- a/lib/profile/employees.dart +++ b/lib/profile/employees.dart @@ -169,8 +169,9 @@ class _FleetEmployeesState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("Step $currentStep/5",), - + Text("Step $currentStep/5", style: + fontTextStyle(16, const Color(0xFFC3C4C4), FontWeight.w500)), + const SizedBox(height: 16), Row( children: List.generate(5, (index) { final isFilled = index < currentStep; diff --git a/lib/profile/service_location.dart b/lib/profile/service_location.dart new file mode 100644 index 0000000..c232d51 --- /dev/null +++ b/lib/profile/service_location.dart @@ -0,0 +1,347 @@ +import 'package:flutter/material.dart'; +import 'package:supplier_new/common/settings.dart'; + +void main() => runApp(const MaterialApp(home: ServiceLocation())); + +class ServiceLocation extends StatefulWidget { + const ServiceLocation({super.key}); + + @override + State createState() => _ServiceLocationState(); +} + +class _ServiceLocationState extends State { + final _formKey = GlobalKey(); + String _deliveryFrom = 'business'; + final TextEditingController _radiusController = + TextEditingController(text: "10"); + bool _customizeEachSource = false; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + backgroundColor: Colors.white, + surfaceTintColor: Colors.transparent, + elevation: 0, + scrolledUnderElevation: 0, + title: const Text("Complete Profile"), + actions: [ + IconButton( + splashRadius: 20, + icon: const Image( + image: AssetImage('images/calendar_appbar.png'), + width: 22, + height: 22, + ), + onPressed: () {}, + ), + IconButton( + splashRadius: 20, + icon: Image.asset('images/notification_appbar.png', + width: 22, height: 22), + onPressed: () {}, + ), + ], + ), + body: SafeArea( + child: Form( + key: _formKey, + child: ListView( + padding: const EdgeInsets.fromLTRB(20, 10, 20, 24), + children: [ + // Step indicator + Text("Step 3/5", + style: + fontTextStyle(16, const Color(0xFFC3C4C4), FontWeight.w500)), + const SizedBox(height: 16), + Row( + children: List.generate(5, (index) { + final isFilled = index < 3; + return Expanded( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 2), + height: 5, + decoration: BoxDecoration( + color: isFilled + ? const Color(0xFF0D3771) + : const Color(0xFFE6E6E6), + borderRadius: BorderRadius.circular(2), + ), + ), + ); + }), + ), + + const SizedBox(height: 16), + Text("SOURCE LOCATION", + style: + fontTextStyle(20, const Color(0xFF515253), FontWeight.w600)), + const SizedBox(height: 8), + Align( + alignment: Alignment.centerLeft, + child: Image.asset('images/marker-pin.png', width: 24, height: 24), + ), + const SizedBox(height: 12), + Text( + "Define where you want to provide delivery services", + style: + fontTextStyle(14, const Color(0xFF939495), FontWeight.w500), + ), + const SizedBox(height: 6), + + // Radio Buttons + RadioListTile( + value: 'business', + groupValue: _deliveryFrom, + onChanged: (value) => + setState(() => _deliveryFrom = value ?? 'business'), + title: Text("From Business Location", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500)), + dense: true, + contentPadding: EdgeInsets.zero, + visualDensity: + const VisualDensity(horizontal: 0, vertical: -3), + ), + RadioListTile( + value: 'source', + groupValue: _deliveryFrom, + onChanged: (value) => + setState(() => _deliveryFrom = value ?? 'source'), + title: Text("From Source Locations", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500)), + dense: true, + contentPadding: EdgeInsets.zero, + visualDensity: + const VisualDensity(horizontal: 0, vertical: -3), + ), + + const SizedBox(height: 12), + + // ✅ Business Location Section + Visibility( + visible: _deliveryFrom == 'business', + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Delivery Radius (in Kms) *", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500)), + const SizedBox(height: 6), + TextFormField( + controller: _radiusController, + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: "Enter radius in kms", + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + contentPadding: const EdgeInsets.symmetric( + horizontal: 12, vertical: 12), + ), + ), + + const SizedBox(height: 12), + Container( + width: double.infinity, + height: 160, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('images/google_maps.png'), + fit: BoxFit.contain, + ), + ), + ), + ], + ), + ), + + // ✅ Source Location Customization Section + Visibility( + visible: _deliveryFrom == 'source', + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 12), + + // 🔹 Checkbox toggle + Row( + children: [ + Checkbox( + value: _customizeEachSource, + onChanged: (val) => + setState(() => _customizeEachSource = val ?? false), + ), + const SizedBox(width: 6), + Expanded( + child: Text( + "Customize for each source location", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500), + ), + ), + ], + ), + + const SizedBox(height: 12), + + // 🔹 Only the list hides/shows + Visibility( + visible: _customizeEachSource, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _SectionHeaderBar(title: "SOURCE LOCATION #1"), + const SizedBox(height: 12), + Text( + "Delivery Radius (in Kms) *", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500), + ), + const SizedBox(height: 6), + TextFormField( + controller: TextEditingController(text: "10"), + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: "Enter radius in kms", + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + contentPadding: + const EdgeInsets.symmetric(horizontal: 12, vertical: 12), + ), + ), + const SizedBox(height: 12), + _SectionHeaderBar(title: "SOURCE LOCATION #2"), + const SizedBox(height: 12), + Text( + "Delivery Radius (in Kms) *", + style: fontTextStyle( + 14, const Color(0xFF2D2E30), FontWeight.w500), + ), + const SizedBox(height: 6), + TextFormField( + controller: TextEditingController(text: "8"), + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: "Enter radius in kms", + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + contentPadding: + const EdgeInsets.symmetric(horizontal: 12, vertical: 12), + ), + ), + const SizedBox(height: 12), + ], + ), + ), + + // 🔹 Map always visible + Container( + width: double.infinity, + height: 160, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('images/google_maps.png'), + fit: BoxFit.contain, + ), + ), + ), + ], + ), + ), + + + + const SizedBox(height: 24), + Text("Types of Services", + style: fontTextStyle( + 16, const Color(0xFF2D2E30), FontWeight.w600)), + const SizedBox(height: 12), + Text("Define what type of services you would wish to provide", + style: + fontTextStyle(14, const Color(0xFF939495), FontWeight.w500)), + const SizedBox(height: 20), + + _serviceItem("24/7 Emergency services"), + _serviceItem("Scheduled water deliveries"), + _serviceItem("Bulk water deliveries"), + _serviceItem("Long-term water delivery plans"), + _serviceItem("Industrial/Commercial water deliveries"), + + const SizedBox(height: 24), + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF8270DB), + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24)), + ), + onPressed: () { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + "Saved successfully for ${_deliveryFrom == 'business' ? 'Business Location' : 'Source Locations'}"), + ), + ); + }, + child: Text("Save & Continue", + style: fontTextStyle(14, Colors.white, FontWeight.w400)), + ), + ), + ], + ), + ), + ), + ); + } + + Widget _serviceItem(String label) => Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Row( + children: [ + const Icon(Icons.check_box_outline_blank, + size: 20, color: Color(0xFF939495)), + const SizedBox(width: 8), + Text(label, + style: + fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400)), + ], + ), + ); +} + +class _SectionHeaderBar extends StatelessWidget { + final String title; + + const _SectionHeaderBar({required this.title, super.key}); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: const Color(0xFFEEEEEE), + border: Border.all(color: const Color(0xFFE5E7EB), width: 1), + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.04), + blurRadius: 6, + offset: const Offset(0, 2), + ), + ], + ), + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10), + child: Text(title, + style: + fontTextStyle(10, const Color(0xFF2D2E30), FontWeight.w600)), + ); + } +} diff --git a/lib/profile/source_location.dart b/lib/profile/source_location.dart index 143739f..059850b 100644 --- a/lib/profile/source_location.dart +++ b/lib/profile/source_location.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:supplier_new/common/settings.dart'; +import 'package:supplier_new/profile/service_location.dart'; import '../common/keys.dart'; import '../google_maps_place_picker_mb/src/models/pick_result.dart'; import '../google_maps_place_picker_mb/src/place_picker.dart'; @@ -403,10 +404,31 @@ class _SourceLocationState extends State { style: fontTextStyle( 16, const Color(0xFFC3C4C4), FontWeight.w500)), const SizedBox(height: 16), + Row( + children: List.generate(5, (index) { + final isFilled = index < currentStep; + return Expanded( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 2), + height: 5, + decoration: BoxDecoration( + color: isFilled ? const Color(0xFF0D3771) : const Color(0xFFE6E6E6), + borderRadius: BorderRadius.circular(2), + ), + ), + ); + }), + ), + const SizedBox(height: 16), Text("SOURCE LOCATION", style: fontTextStyle( 20, const Color(0xFF515253), FontWeight.w600)), - const SizedBox(height: 6), + const SizedBox(height: 16), + Align( + alignment: Alignment.centerLeft, + child: Image.asset('images/truck.png', width: 24, height: 24), + ), + const SizedBox(height: 16), Text("Add your source location", style: fontTextStyle( 14, const Color(0xFF939495), FontWeight.w500)), @@ -428,11 +450,12 @@ class _SourceLocationState extends State { return Container( margin: const EdgeInsets.only(bottom: 8), padding: const EdgeInsets.symmetric( - horizontal: 12, vertical: 6), + horizontal: 12, vertical: 0), decoration: BoxDecoration( - color: const Color(0xFFF1F1F1), - border: Border.all(color: const Color(0xFFE5E5E5)), - borderRadius: BorderRadius.circular(12), + color: Color(0xFFF1F1F1), // background color + border: Border.all(color: Color(0xFFE5E5E5)), + borderRadius: BorderRadius.circular(29), + ), child: Column( children: [ @@ -504,7 +527,9 @@ class _SourceLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(24)), ), - onPressed: () {}, + onPressed: () { + Navigator.push(context, MaterialPageRoute(builder: (_) => const ServiceLocation())); + }, child: Text("Continue", style: fontTextStyle( 14, Colors.white, FontWeight.w400)), diff --git a/lib/profile/source_location1.dart b/lib/profile/source_location1.dart deleted file mode 100644 index 15af600..0000000 --- a/lib/profile/source_location1.dart +++ /dev/null @@ -1,314 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:supplier_new/common/settings.dart'; - -void main() => runApp(const MaterialApp(home: SourceLocation1())); - -class SourceLocation1 extends StatefulWidget { - const SourceLocation1({super.key}); - - @override - State createState() => _SourceLocation1State(); -} - -class _SourceLocation1State extends State { - final _formKey = GlobalKey(); - - String _deliveryFrom = 'business'; - final TextEditingController _radiusController = - TextEditingController(text: "10"); - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - backgroundColor: Colors.white, - surfaceTintColor: Colors.transparent, - elevation: 0, - scrolledUnderElevation: 0, - title: const Text("Complete Profile"), - actions: [ - Padding( - padding: const EdgeInsets.fromLTRB(10, 10, 0, 10), - child: IconButton( - splashRadius: 20, - padding: EdgeInsets.zero, - icon: const Image( - image: AssetImage('images/calendar_appbar.png'), - width: 22, - height: 22), - onPressed: () {}, - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 10, 10, 10), - child: IconButton( - splashRadius: 20, - padding: EdgeInsets.zero, - icon: Image.asset('images/notification_appbar.png', - width: 22, height: 22), - onPressed: () {}, - ), - ), - ], - ), - body: SafeArea( - child: Form( - key: _formKey, - child: ListView( - padding: const EdgeInsets.fromLTRB(20, 10, 20, 24), - children: [ - // Step indicator - Text( - "Step 1/5", - style: - fontTextStyle(16, const Color(0xFFC3C4C4), FontWeight.w500), - ), - const SizedBox(height: 16), - Row( - children: List.generate(4, (index) { - return Expanded( - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 2), - height: 5, - decoration: BoxDecoration( - color: index < 4 ? const Color(0xFFC3C4C4) : Colors.grey, - borderRadius: BorderRadius.circular(2), - ), - ), - ); - }), - ), - const SizedBox(height: 16), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("SORURCE LOCATION", - style: fontTextStyle( - 20, const Color(0xFF515253), FontWeight.w600)), - const SizedBox(height: 8), - Container( - width: 24, - height: 24, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('images/marker-pin.png'), - fit: BoxFit.contain), - ), - ), - ], - ), - const SizedBox(height: 12), - Text( - "Define where you want to provide delivery services", - style: - fontTextStyle(14, const Color(0xFF939495), FontWeight.w500), - maxLines: 1, - softWrap: false, - ), - const SizedBox(height: 6), - // Radio ListTiles (vertical) - Column( - mainAxisSize: MainAxisSize.min, - children: [ - RadioListTile( - value: 'business', - groupValue: _deliveryFrom, - onChanged: (value) { - if (value == null) return; - setState(() => _deliveryFrom = value); - }, - title: Text( - "From Business Location", - style: fontTextStyle( - 14, const Color(0xFF2D2E30), FontWeight.w500), - ), - dense: true, - contentPadding: EdgeInsets.zero, - visualDensity: - const VisualDensity(horizontal: 0, vertical: -3), - ), - RadioListTile( - value: 'source', - groupValue: _deliveryFrom, - onChanged: (value) { - if (value == null) return; - setState(() => _deliveryFrom = value); - }, - title: Text( - "From Source Locations", - style: fontTextStyle( - 14, const Color(0xFF2D2E30), FontWeight.w500), - ), - dense: true, - contentPadding: EdgeInsets.zero, - visualDensity: - const VisualDensity(horizontal: 0, vertical: -3), - ), - ], - ), - - const SizedBox(height: 12), - Text( - "Delivery Radius (in Kms) *", - style: - fontTextStyle(14, const Color(0xFF2D2E30), FontWeight.w500), - ), - const SizedBox(height: 6), - TextFormField( - controller: _radiusController, - keyboardType: TextInputType.number, - decoration: InputDecoration( - hintText: "Enter radius in kms", - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 12, vertical: 12), - ), - ), - const SizedBox(height: 12), - InkWell( - onTap: () => setState( - () => _customizeEachSource = !_customizeEachSource), - child: Padding( - padding: EdgeInsets.zero, - - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - - children: [ - - Checkbox( - value: _customizeEachSource, - onChanged: (val) => - setState(() => _customizeEachSource = val ?? false), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - ), - - const SizedBox(width: 2), - Expanded( - child: Text( - "Customize for every each source location", - style: fontTextStyle( - 14, const Color(0xFF2D2E30), FontWeight.w500), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - - ], - ), - ), - ), - const SizedBox(height: 12), - Container( - width: 343, - height: 166, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('images/google_maps.png'), - fit: BoxFit.contain), - ), - ), - const SizedBox(height: 20), - Text( - "Types of Services", - style: - fontTextStyle(16, const Color(0xFF2D2E30), FontWeight.w600), - ), - const SizedBox(height: 12), - Text( - "Define what type of services you would wish to provide", - style: - fontTextStyle(14, const Color(0xFF939495), FontWeight.w500), - ), - const SizedBox(height: 20), - Row( - children: [ - const Icon(Icons.check_box_outline_blank, size: 20, color: Color(0xFF939495)), - const SizedBox(width: 8), - Text( - "24/7 Emergency services", - style: fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400), - ), - ], - ), - const SizedBox(height: 12), - Row( - children: [ - const Icon(Icons.check_box_outline_blank, size: 20, color: Color(0xFF939495)), - const SizedBox(width: 8), - Text( - "Scheduled water deliveries", - style: fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400), - ), - ], - ), - const SizedBox(height: 12), - Row( - children: [ - const Icon(Icons.check_box_outline_blank, size: 20, color: Color(0xFF939495)), - const SizedBox(width: 8), - Text( - "Bulk water deliveries", - style: fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400), - ), - ], - ), - const SizedBox(height: 12), - Row( - children: [ - const Icon(Icons.check_box_outline_blank, size: 20, color: Color(0xFF939495)), - const SizedBox(width: 8), - Text( - "Long-term water delivery planes", - style: fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400), - ), - ], - ), - const SizedBox(height: 12), - Row( - children: [ - const Icon(Icons.check_box_outline_blank, size: 20, color: Color(0xFF939495)), - const SizedBox(width: 8), - Text( - "Industrial/Commercial water deliveries", - style: fontTextStyle(12, const Color(0xFF2D2E30), FontWeight.w400), - ), - ], - ), - const SizedBox(height: 16), - SizedBox( - width: double.infinity, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF8270DB), - foregroundColor: Colors.white, - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)), - ), - onPressed: () { - // TODO: Navigate to the next step/screen - // Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation2())); - // ScaffoldMessenger.of(context).showSnackBar( - // SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")), - // ); - }, - child: Text( - "Continue", - style: fontTextStyle(14, Colors.white, FontWeight.w400), - ), - ), - ), - ], - ), - ), - ), - ); - } - - bool _customizeEachSource = false; -} - -