resourcesmain screen added

master
gitadmin 2 months ago
parent 8dbe16261b
commit b0fcf7d149

@ -17,6 +17,8 @@ import 'package:supplier_new/resources/fleet.dart';
import 'package:supplier_new/set_rates/set_rates.dart';
import '../login/login.dart';
import '../resources/resources_fleet.dart';
import '../resources/resources_main.dart';
class DashboardScreen extends StatefulWidget {
const DashboardScreen({super.key});
@ -44,7 +46,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
HomeScreen(),
AllOrders(navigationFrom: 'bottombar',),
AllPlans(navigationFrom: 'bottombar',),
FleetStep1Page(),
ResourcesMainScreen(),
FinancialMainScreen(),
];
// List of bottom navigation bar items

@ -3,6 +3,8 @@ import 'package:supplier_new/common/settings.dart';
import 'package:supplier_new/resources/resources_fleet.dart';
import 'package:supplier_new/resources/source_location2.dart';
import 'fleet.dart';
void main() => runApp(const MaterialApp(home: AvailabilityScreen()));
class AvailabilityScreen extends StatefulWidget {
@ -335,7 +337,7 @@ class _AvailabilityScreenState extends State<AvailabilityScreen> {
),
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const ResourcesFleetScreen()));
Navigator.push(context, MaterialPageRoute(builder: (_) => const FleetStep1Page()));
},
child: Text(

@ -311,11 +311,11 @@ class _FleetEmployeesState extends State<FleetEmployees> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
),
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation()));
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// );
// // TODO: Navigate to the next step/screen
// Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation()));
// // ScaffoldMessenger.of(context).showSnackBar(
// // SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// // );
},
child: Text(
"Continue",

@ -385,10 +385,10 @@ class _FleetStep1PageState extends State<FleetStep1Page> {
borderRadius: BorderRadius.circular(24)),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (_) => const FleetStep2Page()),
);
// Navigator.push(
// context,
// MaterialPageRoute(builder: (_) => const FleetStep2Page()),
// );
},
child: Text(
"Continue",

@ -144,10 +144,10 @@ class _FleetStep2PageState extends State<FleetStep2Page> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (_) => const FleetEmployees()),
);
// Navigator.push(
// context,
// MaterialPageRoute(builder: (_) => const FleetEmployees()),
// );
},
child: Text(
"Continue",

@ -42,67 +42,8 @@ class _ResourcesDriverScreenState extends State<ResourcesDriverScreen> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.7,
leading: IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.black87),
onPressed: () => Navigator.of(context).maybePop(),
),
title: Text(
'Resources',
style: fontTextStyle(16, Color(0xFF2A2A2A), FontWeight.w600),
),
actions: [
TextButton(
onPressed: () {},
child: Text(
'HELP',
style: fontTextStyle(12, Color(0xFF8270DB), FontWeight.w600),
),
),
],
),
body: Column(
children: [
// Segmented pill
Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: List.generate(3, (i) {
final labels = ['Fleet', 'Drivers', 'Sources'];
final isSelected = selectedTab == i;
return Expanded(
child: GestureDetector(
onTap: () => setState(() => selectedTab = i),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 8),
margin: const EdgeInsets.symmetric(horizontal: 4),
decoration: BoxDecoration(
color: isSelected
? const Color(0xFFF1F1F1)
: Colors.transparent,
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Text(
labels[i],
style: TextStyle(
color: isSelected
? const Color(0xFF101214)
: const Color(0xFF646464),
fontWeight:
isSelected ? FontWeight.w600 : FontWeight.w500,
),
),
),
),
);
}),
),
),
// Total Drivers card
Container(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.all(14),
@ -252,7 +193,7 @@ class _ResourcesDriverScreenState extends State<ResourcesDriverScreen> {
floatingActionButton: FloatingActionButton(
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => FleetEmployees()));
// Navigator.push(context, MaterialPageRoute(builder: (_) => FleetEmployees()));
},
backgroundColor: Colors.black,

@ -72,27 +72,6 @@ class _ResourcesFleetScreenState extends State<ResourcesFleetScreen> {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.7,
leading: IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.black87),
onPressed: () => Navigator.of(context).maybePop(),
),
title: Text(
'Resources',
style: fontTextStyle(16, const Color(0xFF2A2A2A), FontWeight.w600),
),
centerTitle: false,
actions: [
TextButton(
onPressed: () {},
child: Text('HELP',
style: fontTextStyle(
12, const Color(0xFF8270DB), FontWeight.w600)),
),
],
),
body: Column(
children: [
Container(
@ -100,44 +79,6 @@ class _ResourcesFleetScreenState extends State<ResourcesFleetScreen> {
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
child: Column(
children: [
// Segmented pill
Container(
padding: const EdgeInsets.all(6),
child: Row(
children: List.generate(3, (i) {
final labels = ['Fleet', 'Drivers', 'Sources'];
final isSelected = selectedTab == i;
return Expanded(
child: GestureDetector(
onTap: () => setState(() => selectedTab = i),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 8),
margin: const EdgeInsets.symmetric(horizontal: 4),
decoration: BoxDecoration(
color: isSelected
? const Color(0xFFF1F1F1)
: Colors.transparent,
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Text(
labels[i],
style: TextStyle(
color: isSelected
? const Color(0xFF101214)
: const Color(0xFF646464),
fontWeight: isSelected
? FontWeight.w600
: FontWeight.w500,
),
),
),
),
);
}),
),
),
const SizedBox(height: 12),
Container(
width: double.infinity,
@ -319,7 +260,7 @@ class _ResourcesFleetScreenState extends State<ResourcesFleetScreen> {
floatingActionButton: FloatingActionButton(
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const FleetStep1Page()));
// Navigator.push(context, MaterialPageRoute(builder: (_) => const FleetStep1Page()));
},
backgroundColor: const Color(0xFF000000),

@ -0,0 +1,175 @@
import 'package:flutter/material.dart';
import 'package:supplier_new/resources/resources_fleet.dart';
import 'package:supplier_new/resources/resources_drivers.dart';
import 'package:supplier_new/resources/resources_sources.dart';
import 'package:supplier_new/resources/source_location.dart';
import '../common/settings.dart';
import 'employees.dart';
import 'fleet.dart';
void main() => runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: ResourcesMainScreen(),
));
class ResourcesMainScreen extends StatefulWidget {
const ResourcesMainScreen({super.key});
@override
State<ResourcesMainScreen> createState() => _ResourcesMainScreenState();
}
class _ResourcesMainScreenState extends State<ResourcesMainScreen>
with SingleTickerProviderStateMixin {
late TabController _tabController;
final List<String> _labels = const ['Fleet', 'Drivers', 'Sources'];
@override
void initState() {
super.initState();
_tabController = TabController(length: _labels.length, vsync: this);
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
// FAB per tab
Widget? _buildFAB(int index) {
switch (index) {
case 0: // Fleet
return FloatingActionButton(
heroTag: null,
backgroundColor: Colors.black,
child: const Icon(Icons.add, color: Colors.white),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const HeroMode(
enabled: false,
child: FleetStep1Page(),
),
),
);
},
);
case 1: // Drivers
return FloatingActionButton(
heroTag: null,
backgroundColor: Colors.black,
child: const Icon(Icons.add, color: Colors.white),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const HeroMode(
enabled: false,
child: FleetEmployees(),
),
),
);
},
);
case 2: // Sources
return FloatingActionButton(
heroTag: null,
backgroundColor: Colors.black,
child: const Icon(Icons.add, color: Colors.white),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const HeroMode(
enabled: false,
child: SourceLocation(),
),
),
);
},
);
default:
return null;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
// keep entire screen white
backgroundColor: Colors.white,
body: SafeArea(
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: AnimatedBuilder(
animation: _tabController,
builder: (context, _) {
return Row(
children: List.generate(_labels.length, (index) {
final isSelected = _tabController.index == index;
return Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
setState(() => _tabController.index = index),
child: AnimatedContainer(
duration: const Duration(milliseconds: 180),
curve: Curves.easeInOut,
margin: const EdgeInsets.symmetric(horizontal: 6),
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: isSelected
? const Color(0xFFF1F1F1)
: Colors.white,
borderRadius:
BorderRadius.circular(16), // radius 16 always
),
alignment: Alignment.center,
child: Text(
_labels[index],
style: fontTextStyle(
12,
isSelected ? const Color(0xFF101214) : const Color(0xFF646464),
isSelected ? FontWeight.w700 : FontWeight.w400,
),
),
),
),
);
}),
);
},
),
),
const SizedBox(height: 8),
Expanded(
child: HeroMode(
enabled: false,
child: TabBarView(
controller: _tabController,
children: const [
ResourcesFleetScreen(),
ResourcesDriverScreen(),
ResourcesSourceScreen(),
],
),
),
),
],
),
),
floatingActionButton: AnimatedBuilder(
animation: _tabController.animation!,
builder: (context, _) =>
_buildFAB(_tabController.index) ?? const SizedBox.shrink(),
),
);
}
}

@ -54,27 +54,7 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.7,
leading: IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.black87),
onPressed: () => Navigator.of(context).maybePop(),
),
title: Text(
'Resources',
style: fontTextStyle(16, const Color(0xFF2A2A2A), FontWeight.w600),
),
centerTitle: false,
actions: [
TextButton(
onPressed: () {},
child: Text('HELP',
style: fontTextStyle(
12, const Color(0xFF8270DB), FontWeight.w600)),
),
],
),
body: Column(
children: [
// Top card section
@ -83,44 +63,6 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
child: Column(
children: [
// Segmented pill
Container(
padding: const EdgeInsets.all(6),
child: Row(
children: List.generate(3, (i) {
final labels = ['Fleet', 'Drivers', 'Sources'];
final isSelected = selectedTab == i;
return Expanded(
child: GestureDetector(
onTap: () => setState(() => selectedTab = i),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 8),
margin: const EdgeInsets.symmetric(horizontal: 4),
decoration: BoxDecoration(
color: isSelected
? const Color(0xFFF1F1F1)
: Colors.transparent,
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Text(
labels[i],
style: TextStyle(
color: isSelected
? const Color(0xFF101214)
: const Color(0xFF646464),
fontWeight: isSelected
? FontWeight.w600
: FontWeight.w500,
),
),
),
),
);
}),
),
),
const SizedBox(height: 12),
// Total Source Locations card
Container(
@ -293,7 +235,7 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
floatingActionButton: FloatingActionButton(
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation()));
// Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation()));
},
backgroundColor: const Color(0xFF000000),

@ -320,11 +320,11 @@ class _SourceLocationState extends State<SourceLocation> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
),
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation1()));
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// );
// // TODO: Navigate to the next step/screen
// Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation1()));
// // ScaffoldMessenger.of(context).showSnackBar(
// // SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// // );
},
child: Text(
"Continue",

@ -291,7 +291,7 @@ class _SourceLocation1State extends State<SourceLocation1> {
),
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation2()));
// Navigator.push(context, MaterialPageRoute(builder: (_) => const SourceLocation2()));
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// );

@ -344,7 +344,7 @@ class _SourceLocation2State extends State<SourceLocation2> {
),
onPressed: () {
// TODO: Navigate to the next step/screen
Navigator.push(context, MaterialPageRoute(builder: (_) => const AvailabilityScreen()));
// Navigator.push(context, MaterialPageRoute(builder: (_) => const AvailabilityScreen()));
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text("Saved ${_drivers.length} driver(s). Proceeding…")),
// );

Loading…
Cancel
Save