dashboard added

master
Sneha 4 days ago
parent c63731734e
commit 753893cd56

@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="supplier_new"
android:name="${applicationName}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:supplier_new/common/settings.dart';
class DashboardScreen extends StatefulWidget {
const DashboardScreen({super.key});
@override
State<DashboardScreen> createState() => _DashboardScreenState();
}
class _DashboardScreenState extends State<DashboardScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppSettings.appBar('Dashboard'),
);
}
}

@ -305,4 +305,43 @@ class AppSettings{
textColor: Colors.white,
fontSize: 16.0);
}
static appBar(String title) {
title = title ?? '';
return AppBar(
backgroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
title: Text(title,style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w500),),
iconTheme: IconThemeData(color: Color(0XFF2A2A2A)),
actions: [
Row(
children: [
Padding(padding: EdgeInsets.fromLTRB(10,10,0,10),
child: IconButton(
icon: Image(
image: AssetImage('images/customercare_appbar.png')
),
onPressed: (){
},
),
),
Padding(padding: EdgeInsets.fromLTRB(0,10,10,10),
child: IconButton(
icon: Image.asset(
'images/notification_appbar.png', // Example URL image
),
onPressed: (){
},
),
)
],
)
],
);
}
}

@ -1,11 +1,15 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:supplier_new/common/dashboard.dart';
import 'package:supplier_new/common/settings.dart';
import 'package:supplier_new/login/login.dart';
import 'package:supplier_new/login/starting_screen.dart';
void main() async{
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
await Firebase.initializeApp();
//FirebaseMessaging.onBackgroundMessage(_messageHandler);
runApp(new Splash());
}
@ -17,7 +21,7 @@ class Splash extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Water Management',
title: 'Aquick Supplier',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
@ -35,36 +39,31 @@ class SplashScreen extends StatefulWidget {
class _SplashScreenState extends State<SplashScreen> {
Widget _defaultHome = new StartingScreen();
/*void loginCheck()async{
bool _result = await AppSettings.isSigIn();
*//*store device information in firebase*//*
try{
if(Platform.isIOS){
await FireBaseCore.init();
}
//await FireBaseCore.init();
await FireBaseCore.checkFcmTokenInFireStoreDbWithdeviceId();
// AppSettings.fcmId=await AppSettings.getData('FCM_TOKEN', 'STRING');
}
catch(e){
print(e);
}
if (_result) {
final storage = FlutterSecureStorage(
aOptions: AndroidOptions(
resetOnError: true,
encryptedSharedPreferences: true,
),
);
Future<void> _checkLoginStatus() async {
await Future.delayed(Duration(seconds: 2)); // Simulate splash delay
String? authToken = await storage.read(key: 'authToken');
if (authToken != null) {
await AppSettings.loadDataFromMemory();
AppSettings.fcmId=await AppSettings.getData('FCM_TOKEN', 'STRING');
// await AppSettings.getProfile();
_defaultHome = new DashboardScreen();
//AppSettings.fcmId=await AppSettings.getData('FCM_TOKEN', 'STRING');
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => DashboardScreen()),
);
} else {
// Navigate to Login Screen otherwise
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => StartingScreen()),
);
}
}*/
}
@ -73,12 +72,13 @@ class _SplashScreenState extends State<SplashScreen> {
//loginCheck();
super.initState();
Future.delayed(
_checkLoginStatus();
/* Future.delayed(
const Duration(seconds: 3),
() => Navigator.push(
context,
MaterialPageRoute(builder: (context) => _defaultHome),
));
));*/
}
@override
Widget build(BuildContext context) {

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:supplier_new/common/dashboard.dart';
import 'package:supplier_new/common/settings.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
@ -219,11 +220,11 @@ class _LoginState extends State<Login> {
await storage.write(key: 'authToken', value: token);
print('Token saved: $token');
/*await Navigator.push(
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DashboardScreen()),
);*/
);
AppSettings.longSuccessToast("Logged in Successfully");
mobileNumberController.text='';
passwordController.text='';

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:supplier_new/common/settings.dart';
import 'package:supplier_new/login/login.dart';
import 'package:supplier_new/login/signup.dart';
class LoginSignUpScreen extends StatefulWidget {
const LoginSignUpScreen({super.key});
@ -79,7 +80,11 @@ class _LoginSignUpScreenState extends State<LoginSignUpScreen> {
),
),
onPressed: () async {
// Your onPressed logic
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SignUp()),
);
},
child: Text(
'Sign up',

@ -0,0 +1,150 @@
import 'package:flutter/material.dart';
import '../common/settings.dart';
class SignUp extends StatefulWidget {
const SignUp({super.key});
@override
State<SignUp> createState() => _SignUpState();
}
class _SignUpState extends State<SignUp> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
),
backgroundColor: Colors.white,
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Top image
Container(
width: 24,
height: 24,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('images/business.png'),
fit: BoxFit.contain, // Optional: can also use BoxFit.cover
),
),
),
const SizedBox(height: 12),
Text(
'Tell us about your water tanker business',
style: fontTextStyle(12, Color(0xFF2D2E30),FontWeight.w400),
),
const SizedBox(height: 24),
Text(
"BUSINESS REGISTRATION",
style: fontTextStyle(10, Color(0xFF2D2E30),FontWeight.w600),
),
const SizedBox(height: 10),
_buildTextField('Business Name *', 'Enter your Business Name'),
_buildTextField('Registration Number *', 'Business Registration Number'),
_buildTextField('Years in Business *', 'Years of operation'),
const SizedBox(height: 24),
Text(
"CONTACT INFORMATION",
style: fontTextStyle(10, Color(0xFF2D2E30),FontWeight.w600),
),
const SizedBox(height: 10),
_buildTextField('Primary Contact Name *', 'Full Name'),
_buildTextField('Position/Title *', 'Job title'),
_buildTextField('Mobile Number *', 'Mobile Number'),
_buildTextField('Additional Mobile Number', 'Alternate Number'),
_buildTextField('Email Address', 'Email Address'),
const SizedBox(height: 24),
Text(
"BUSINESS ADDRESS",
style: fontTextStyle(10, Color(0xFF2D2E30),FontWeight.w600),
),
const SizedBox(height: 10),
_buildTextField('Address Line 1 *', '123 Main St'),
_buildTextField('Address Line 2(Optional)', 'Area'),
_buildTextField('City *', 'City'),
_buildTextField('State/Province *', 'State'),
_buildTextField('ZIP/Postal Code ', '12345'),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(left: 45.0), // Add space on the left
child: Row(
children: [
Image.asset(
'images/Maps.png',
width: 20,
height: 20,
),
const SizedBox(width: 8),
Text(
"Add Location from Maps",
style: fontTextStyle(14, Color(0xFF2D2E30),FontWeight.w500),
),
],
),
),
const SizedBox(height: 20),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () {
// Submit logic goes here
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueAccent,
padding: const EdgeInsets.symmetric(vertical: 16),
),
child: Text(
'Submit',
style: fontTextStyle(16, Colors.white, FontWeight.w600),
),
),
),
],
),
),
);
}
Widget _buildTextField(String label, String hint) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: fontTextStyle(12, Color(0xFF2D2E30),FontWeight.w500),
),
const SizedBox(height: 6),
TextField(
decoration: InputDecoration(
hintText: hint,
hintStyle: fontTextStyle(13, Colors.grey.shade600, FontWeight.normal),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
),
),
const SizedBox(height: 16),
],
);
}
}
Loading…
Cancel
Save