manage user and mail issue fix
This commit is contained in:
parent
9512791494
commit
ebb16d6f36
BIN
assets/icons/drawer/logout.png
Normal file
BIN
assets/icons/drawer/logout.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@ -302,6 +302,7 @@ import '../presentation/Screens/auth_verification/changepassword.dart';
|
|||||||
import '../presentation/Screens/auth_verification/confirm_password.dart';
|
import '../presentation/Screens/auth_verification/confirm_password.dart';
|
||||||
import '../presentation/Screens/auth_verification/create_new_pw.dart';
|
import '../presentation/Screens/auth_verification/create_new_pw.dart';
|
||||||
import '../presentation/Screens/auth_verification/otp_verification.dart';
|
import '../presentation/Screens/auth_verification/otp_verification.dart';
|
||||||
|
import '../presentation/Screens/demo_home.dart';
|
||||||
import '../presentation/Screens/profilepage.dart';
|
import '../presentation/Screens/profilepage.dart';
|
||||||
import '../presentation/routes/auth_routes/login_route.dart';
|
import '../presentation/routes/auth_routes/login_route.dart';
|
||||||
import '../presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
|
import '../presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
|
||||||
@ -324,6 +325,10 @@ final GoRouter router = GoRouter(
|
|||||||
path: '/register',
|
path: '/register',
|
||||||
builder: (context, state) => RegisterScreen(),
|
builder: (context, state) => RegisterScreen(),
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/DemoHome',
|
||||||
|
builder: (context, state) => ChartPage(),
|
||||||
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/mailverification',
|
path: '/mailverification',
|
||||||
builder: (context, state) => EmailVerificationScreen(
|
builder: (context, state) => EmailVerificationScreen(
|
||||||
|
|||||||
@ -233,30 +233,6 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
if (_formKey.currentState?.validate() ?? false) {
|
if (_formKey.currentState?.validate() ?? false) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
try {
|
try {
|
||||||
final existingUsers = await pb.collection('users').getList(
|
|
||||||
filter: 'email="${_emailController.text}"',
|
|
||||||
);
|
|
||||||
|
|
||||||
if (existingUsers.items.isNotEmpty) {
|
|
||||||
// Email already exists
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('Email Exists'),
|
|
||||||
content: Text(
|
|
||||||
'Email ID already exists. Please use a different email.'),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
child: Text('OK'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return; // Stop registration process
|
|
||||||
}
|
|
||||||
final adminAuth = await pb.admins
|
final adminAuth = await pb.admins
|
||||||
.authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
|
.authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
|
||||||
|
|
||||||
@ -287,11 +263,34 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
throw Exception('User registration failed: missing user ID');
|
throw Exception('User registration failed: missing user ID');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// Check if the error is due to an invalid or already used email
|
||||||
|
if (e
|
||||||
|
.toString()
|
||||||
|
.contains('The email is invalid or already in use.')) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('Email Exists'),
|
||||||
|
content: Text(
|
||||||
|
'Email ID already exists. Please use a different email.'),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
child: Text('OK'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Handle other types of errors
|
||||||
setState(() {
|
setState(() {
|
||||||
registrationFailed = true;
|
registrationFailed = true;
|
||||||
registrationSuccess = false;
|
registrationSuccess = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
showError = true; // Show error if checkbox is not checked
|
showError = true; // Show error if checkbox is not checked
|
||||||
@ -452,7 +451,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: screenheight / 6),
|
SizedBox(height: screenheight / 15),
|
||||||
Text(
|
Text(
|
||||||
'Register',
|
'Register',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -662,7 +661,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
width: screenwidth / 1.3,
|
width: screenwidth / 1.3,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Add your login logic here
|
context.go('/');
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Color(
|
backgroundColor: Color(
|
||||||
@ -671,44 +670,41 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// child: Row(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// "Login",
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 16, color: Colors.white
|
|
||||||
// ),
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 8),
|
|
||||||
// Icon(Icons.arrow_forward,
|
|
||||||
// color: Colors.white),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
// Navigate to LoginRoute
|
|
||||||
context.go('/');
|
|
||||||
},
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Login",
|
"Login",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16, color: Colors.white),
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Icon(Icons.arrow_forward,
|
Icon(Icons.arrow_forward,
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () {
|
||||||
|
// // Navigate to LoginRoute
|
||||||
|
// context.go('/');
|
||||||
|
// },
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "Login",
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 16,
|
||||||
|
// color: Colors.white,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(width: 8),
|
||||||
|
// Icon(Icons.arrow_forward,
|
||||||
|
// color: Colors.white),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -1,29 +1,262 @@
|
|||||||
|
import 'dart:convert';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:async';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:syncfusion_flutter_charts/charts.dart'; // Import Syncfusion charts package
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
void main() {
|
||||||
|
runApp(MyApp());
|
||||||
import '../components/my_drawer.dart';
|
|
||||||
|
|
||||||
class DemoHome extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
State<DemoHome> createState() => _DemoHomeState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DemoHomeState extends State<DemoHome> {
|
class MyApp extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return MaterialApp(
|
||||||
drawer: const MyDrawer(),
|
home: ChartPage(),
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: const Color(0xFFf8f9ff),
|
|
||||||
title: Text(context.translate('Home', 'نموذج الملاحظات')),
|
|
||||||
),
|
|
||||||
body: Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Center(
|
|
||||||
child: Text('Home Page'),
|
|
||||||
)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ChartPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
ChartPageState createState() => ChartPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChartPageState extends State<ChartPage> {
|
||||||
|
List<dynamic> chartsData = [];
|
||||||
|
bool isLoading = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
fetchChartData();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> fetchChartData() async {
|
||||||
|
const baseUrl =
|
||||||
|
'https://pb.venbait.in/api/custom/apicall'; // Replace with your server URL
|
||||||
|
final url = Uri.parse('$baseUrl?dataset=hotels');
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await http.get(url);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
setState(() {
|
||||||
|
chartsData = jsonDecode(response.body);
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw Exception('Failed to load data');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
|
print('Error fetching data: $error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChartData> parseLineChartData(List<dynamic> response) {
|
||||||
|
return response.map((entry) {
|
||||||
|
// Attempt to fetch the TIMEPERIOD
|
||||||
|
final rawTimePeriod =
|
||||||
|
entry['ObsKey']?['Year'] ?? entry['ObsKey']?['TIME_PERIOD'];
|
||||||
|
final formattedTimePeriod = rawTimePeriod != null
|
||||||
|
? rawTimePeriod.toString() // Use as-is if valid
|
||||||
|
: 'Unknown'; // Fallback value if null
|
||||||
|
|
||||||
|
// Parse the value or fallback to 0.0
|
||||||
|
final value =
|
||||||
|
double.tryParse(entry['ObsValue']?['Value']?.toString() ?? '0.0') ??
|
||||||
|
0.0;
|
||||||
|
|
||||||
|
return ChartData(
|
||||||
|
timePeriod: formattedTimePeriod,
|
||||||
|
value: value,
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChartData> parseBarChartData(List<dynamic> response) {
|
||||||
|
return response
|
||||||
|
.asMap()
|
||||||
|
.entries
|
||||||
|
.map((entry) => ChartData(
|
||||||
|
timePeriod: entry.value['ObsKey']['TIME_PERIOD'] ??
|
||||||
|
'Unknown', // Fallback to 'Unknown' if null
|
||||||
|
value: double.tryParse(
|
||||||
|
entry.value['ObsValue']['Value'].toString()) ??
|
||||||
|
0.0, // Handle null/invalid value
|
||||||
|
))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildChart(dynamic chartData) {
|
||||||
|
print('chartData $chartData');
|
||||||
|
switch (chartData['chart_type']) {
|
||||||
|
case 'line':
|
||||||
|
return SfCartesianChart(
|
||||||
|
primaryXAxis: CategoryAxis(
|
||||||
|
title: AxisTitle(text: 'Year'),
|
||||||
|
labelRotation: 45, // Rotate labels if they overlap
|
||||||
|
),
|
||||||
|
title: ChartTitle(text: 'Hotel Estabhlishments'),
|
||||||
|
legend: Legend(isVisible: true),
|
||||||
|
tooltipBehavior: TooltipBehavior(
|
||||||
|
enable: true,
|
||||||
|
builder: (dynamic data, dynamic point, dynamic series,
|
||||||
|
int pointIndex, int seriesIndex) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${data.timePeriod}: ${formatNumber(data.value)}',
|
||||||
|
style: const TextStyle(color: Colors.black),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
series: <CartesianSeries<ChartData, String>>[
|
||||||
|
LineSeries<ChartData, String>(
|
||||||
|
dataSource: parseLineChartData(chartData['response']),
|
||||||
|
xValueMapper: (ChartData data, _) => data.timePeriod,
|
||||||
|
yValueMapper: (ChartData data, _) => data.value,
|
||||||
|
name: chartData['dataset'],
|
||||||
|
color: Colors.red,
|
||||||
|
dataLabelSettings: DataLabelSettings(
|
||||||
|
isVisible: true,
|
||||||
|
builder: (dynamic data, dynamic point, dynamic series,
|
||||||
|
int pointIndex, int seriesIndex) {
|
||||||
|
return Text(
|
||||||
|
formatNumber(data.value),
|
||||||
|
style: const TextStyle(fontSize: 12, color: Colors.black),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
case 'bar':
|
||||||
|
return SfCartesianChart(
|
||||||
|
primaryXAxis: CategoryAxis(),
|
||||||
|
title: ChartTitle(text: 'Hotel Occupancy Rate'),
|
||||||
|
tooltipBehavior: TooltipBehavior(
|
||||||
|
enable: true,
|
||||||
|
builder: (dynamic data, dynamic point, dynamic series,
|
||||||
|
int pointIndex, int seriesIndex) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${data.timePeriod}: ${formatNumber(data.value)}',
|
||||||
|
style: const TextStyle(color: Colors.black),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
series: <CartesianSeries<ChartData, String>>[
|
||||||
|
BarSeries<ChartData, String>(
|
||||||
|
dataSource: parseBarChartData(chartData['response']),
|
||||||
|
xValueMapper: (ChartData data, _) => data.timePeriod,
|
||||||
|
yValueMapper: (ChartData data, _) => data.value,
|
||||||
|
name: chartData['dataset'],
|
||||||
|
color: Colors.red,
|
||||||
|
dataLabelSettings: DataLabelSettings(
|
||||||
|
isVisible: true,
|
||||||
|
builder: (dynamic data, dynamic point, dynamic series,
|
||||||
|
int pointIndex, int seriesIndex) {
|
||||||
|
return Text(
|
||||||
|
formatNumber(data.value),
|
||||||
|
style: const TextStyle(fontSize: 12, color: Colors.black),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// isTrackVisible: true,
|
||||||
|
// trackColor: Colors.red
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return Center(child: Text('Unknown chart type'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: const Color(0xFF7DAFBC),
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Color(0xFF7DAFBC),
|
||||||
|
elevation: 0,
|
||||||
|
leading: IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back_ios_new, color: Colors.white),
|
||||||
|
onPressed: () {
|
||||||
|
context.go('/myhomepage');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Charts',
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: isLoading
|
||||||
|
? Center(child: CircularProgressIndicator())
|
||||||
|
: ListView.builder(
|
||||||
|
itemCount: chartsData.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Card(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Text(
|
||||||
|
// 'Chart: ${chartsData[index]['chart_type']}',
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 10),
|
||||||
|
Container(
|
||||||
|
height: 300,
|
||||||
|
child: buildChart(chartsData[index]),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChartData {
|
||||||
|
final String timePeriod;
|
||||||
|
final double value;
|
||||||
|
final String formattedValue;
|
||||||
|
|
||||||
|
ChartData({required this.timePeriod, required this.value})
|
||||||
|
: formattedValue = formatNumber(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
String formatNumber(double value) {
|
||||||
|
if (value >= 1e12) {
|
||||||
|
return '${(value / 1e12).toStringAsFixed(2)} T'; // Trillions
|
||||||
|
} else if (value >= 1e9) {
|
||||||
|
return '${(value / 1e9).toStringAsFixed(2)} B'; // Billions
|
||||||
|
} else if (value >= 1e6) {
|
||||||
|
return '${(value / 1e6).toStringAsFixed(2)} M'; // Millions
|
||||||
|
} else if (value >= 1e5) {
|
||||||
|
return '${(value / 1e5).toStringAsFixed(2)} L'; // Lakhs
|
||||||
|
} else if (value >= 1e3) {
|
||||||
|
return '${(value / 1e3).toStringAsFixed(2)} K'; // Thousands
|
||||||
|
}
|
||||||
|
return value.toStringAsFixed(2); // Default to two decimal places
|
||||||
|
}
|
||||||
|
|||||||
@ -156,17 +156,39 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void _pickImage() async {
|
||||||
|
// final XFile? pickedFile =
|
||||||
|
// await _picker.pickImage(source: ImageSource.gallery);
|
||||||
|
// if (pickedFile != null) {
|
||||||
|
// setState(() {
|
||||||
|
// _profileImage = File(pickedFile.path);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Function to open the date picker
|
||||||
|
|
||||||
void _pickImage() async {
|
void _pickImage() async {
|
||||||
final XFile? pickedFile =
|
final XFile? pickedFile =
|
||||||
await _picker.pickImage(source: ImageSource.gallery);
|
await _picker.pickImage(source: ImageSource.gallery);
|
||||||
if (pickedFile != null) {
|
if (pickedFile != null) {
|
||||||
|
final String fileExtension =
|
||||||
|
pickedFile.path.split('.').last.toLowerCase();
|
||||||
|
if (fileExtension == 'jpg' ||
|
||||||
|
fileExtension == 'jpeg' ||
|
||||||
|
fileExtension == 'png' ||
|
||||||
|
fileExtension == "heic") {
|
||||||
setState(() {
|
setState(() {
|
||||||
_profileImage = File(pickedFile.path);
|
_profileImage = File(pickedFile.path);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text('Please select a JPG, JPEG, or PNG file.')),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to open the date picker
|
|
||||||
Future<void> _pickDate() async {
|
Future<void> _pickDate() async {
|
||||||
final DateTime today = DateTime.now();
|
final DateTime today = DateTime.now();
|
||||||
final DateTime initialDate = _selectedDate ??
|
final DateTime initialDate = _selectedDate ??
|
||||||
@ -273,11 +295,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
_resetFormFields();
|
_resetFormFields();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text("Profile updated successfully!")));
|
SnackBar(content: Text("Profile updated successfully!")));
|
||||||
if (role == 'admin') {
|
// if (role == 'admin') {
|
||||||
context.go('/manageuser');
|
// context.go('/manageuser');
|
||||||
} else {
|
// } else {
|
||||||
|
// context.go('/myhomepage');
|
||||||
|
// }
|
||||||
context.go('/myhomepage');
|
context.go('/myhomepage');
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text("Failed to update profile: $error")));
|
SnackBar(content: Text("Failed to update profile: $error")));
|
||||||
@ -370,8 +393,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"User Name",
|
"User Name",
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -380,7 +405,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
controller: _usernameController,
|
controller: _usernameController,
|
||||||
focusNode: _focusNodes[0],
|
focusNode: _focusNodes[0],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _showHints[0] ? 'Mohammad Hassan' : null,
|
hintText: _showHints[0] ? 'Enter the User Name' : null,
|
||||||
hintStyle: TextStyle(color: Colors.grey),
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@ -393,9 +418,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"E-mail",
|
"Email ID",
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -418,7 +445,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Full Name",
|
"Full Name*",
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
@ -444,7 +471,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
controller: _fullNameController,
|
controller: _fullNameController,
|
||||||
focusNode: _focusNodes[2],
|
focusNode: _focusNodes[2],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _showHints[2] ? 'Enter the Full Name' : null,
|
hintText: _showHints[2] ? 'Enter the name' : null,
|
||||||
hintStyle: TextStyle(color: Colors.grey),
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@ -473,9 +500,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
hintText:
|
hintText: _showHints[3] ? 'DD/MM/YYYY' : null,
|
||||||
_showHints[3] ? 'Select your Date of Birth' : null,
|
//_showHints[3] ? 'Select your Date of Birth' : null,
|
||||||
//hintText: 'Select your Date of Birth',
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
suffixIcon: const Icon(Icons.arrow_drop_down_sharp),
|
suffixIcon: const Icon(Icons.arrow_drop_down_sharp),
|
||||||
),
|
),
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
|
|||||||
@ -256,12 +256,12 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
print(isProfileComplete);
|
print(isProfileComplete);
|
||||||
if (isProfileComplete) {
|
if (isProfileComplete) {
|
||||||
print('home');
|
print('home');
|
||||||
if (role == 'admin') {
|
// if (role == 'admin') {
|
||||||
context.go('/manageuser');
|
|
||||||
} else {
|
|
||||||
context.go('/myhomepage');
|
|
||||||
}
|
|
||||||
// context.go('/myhomepage');
|
// context.go('/myhomepage');
|
||||||
|
// } else {
|
||||||
|
// context.go('/myhomepage');
|
||||||
|
// }
|
||||||
|
context.go('/myhomepage');
|
||||||
} else {
|
} else {
|
||||||
print('profile');
|
print('profile');
|
||||||
if (userId != null && userId.isNotEmpty) {
|
if (userId != null && userId.isNotEmpty) {
|
||||||
|
|||||||
@ -161,6 +161,7 @@
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import '../../drawer_routes/custom_drawer_routes.dart';
|
import '../../drawer_routes/custom_drawer_routes.dart';
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
class MyHomePage extends StatefulWidget {
|
||||||
@ -176,16 +177,16 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
return BaseScaffold(
|
return BaseScaffold(
|
||||||
title: Center(child: SizedBox(height : myheight/5, width : mywidth/3,child: Image(image: AssetImage('assets/logos/uae_stat.png')))),
|
title: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
height: myheight / 5,
|
||||||
|
width: mywidth / 3,
|
||||||
|
child: Image(image: AssetImage('assets/logos/uae_stat.png')))),
|
||||||
body: EconomyStats(),
|
body: EconomyStats(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EconomyStats extends StatelessWidget {
|
class EconomyStats extends StatelessWidget {
|
||||||
const EconomyStats({Key? key}) : super(key: key);
|
const EconomyStats({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -210,7 +211,9 @@ class EconomyStats extends StatelessWidget {
|
|||||||
|
|
||||||
// ECONOMY DETAILS
|
// ECONOMY DETAILS
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10,),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// First Row
|
// First Row
|
||||||
@ -228,7 +231,8 @@ class EconomyStats extends StatelessWidget {
|
|||||||
title: 'Inflation Rate',
|
title: 'Inflation Rate',
|
||||||
subtitle: '(2022)',
|
subtitle: '(2022)',
|
||||||
value: '4.82%',
|
value: '4.82%',
|
||||||
bordercolor: Color(0xFF7DAFBC), textcolor: Color(0xFF7DAFBC),
|
bordercolor: Color(0xFF7DAFBC),
|
||||||
|
textcolor: Color(0xFF7DAFBC),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -241,13 +245,15 @@ class EconomyStats extends StatelessWidget {
|
|||||||
title: 'Trade Value',
|
title: 'Trade Value',
|
||||||
subtitle: '(Jan - Jan 2024) - AED',
|
subtitle: '(Jan - Jan 2024) - AED',
|
||||||
value: '215.4B',
|
value: '215.4B',
|
||||||
bordercolor: Color(0xFF7DAFBC), textcolor: Color(0xFF7DAFBC),
|
bordercolor: Color(0xFF7DAFBC),
|
||||||
|
textcolor: Color(0xFF7DAFBC),
|
||||||
),
|
),
|
||||||
InfoCard(
|
InfoCard(
|
||||||
title: 'Hotel Guests',
|
title: 'Hotel Guests',
|
||||||
subtitle: '(2022)',
|
subtitle: '(2022)',
|
||||||
value: '25.21M',
|
value: '25.21M',
|
||||||
bordercolor: Color(0xFF7DAFBC), textcolor: Color(0xFF7DAFBC),
|
bordercolor: Color(0xFF7DAFBC),
|
||||||
|
textcolor: Color(0xFF7DAFBC),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -264,7 +270,9 @@ class EconomyStats extends StatelessWidget {
|
|||||||
|
|
||||||
// SOCIAL DETAILS
|
// SOCIAL DETAILS
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10,),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// First Row
|
// First Row
|
||||||
@ -321,12 +329,15 @@ class EconomyStats extends StatelessWidget {
|
|||||||
|
|
||||||
// ENVIRONMENT DETAILS
|
// ENVIRONMENT DETAILS
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10,),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// First Row
|
// First Row
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
InfoCard(
|
InfoCard(
|
||||||
title: 'Electricity',
|
title: 'Electricity',
|
||||||
@ -347,7 +358,8 @@ class EconomyStats extends StatelessWidget {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
// Second Row
|
// Second Row
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
InfoCard(
|
InfoCard(
|
||||||
title: 'Export of oil',
|
title: 'Export of oil',
|
||||||
@ -386,13 +398,11 @@ class RoundedCornerContainer extends StatelessWidget {
|
|||||||
final Color backgroundColor;
|
final Color backgroundColor;
|
||||||
final TextStyle? textStyle;
|
final TextStyle? textStyle;
|
||||||
|
|
||||||
|
|
||||||
const RoundedCornerContainer({
|
const RoundedCornerContainer({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.text,
|
required this.text,
|
||||||
this.backgroundColor = Colors.blue,
|
this.backgroundColor = Colors.blue,
|
||||||
this.textStyle,
|
this.textStyle,
|
||||||
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -417,7 +427,6 @@ class RoundedCornerContainer extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class InfoCard extends StatelessWidget {
|
class InfoCard extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
final String subtitle;
|
final String subtitle;
|
||||||
@ -429,16 +438,22 @@ class InfoCard extends StatelessWidget {
|
|||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.subtitle,
|
required this.subtitle,
|
||||||
required this.value, required this.bordercolor,this.textcolor,
|
required this.value,
|
||||||
|
required this.bordercolor,
|
||||||
|
this.textcolor,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double myheight = MediaQuery.of(context).size.height;
|
double myheight = MediaQuery.of(context).size.height;
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child:
|
child: GestureDetector(
|
||||||
Container(
|
onTap: () {
|
||||||
|
context.go('/DemoHome');
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
height: myheight / 9,
|
height: myheight / 9,
|
||||||
width: mywidth / 4,
|
width: mywidth / 4,
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
@ -452,7 +467,6 @@ class InfoCard extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
//textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@ -475,12 +489,13 @@ class InfoCard extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: textcolor ?? Colors.black
|
color: textcolor ?? Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,17 +194,39 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void _pickImage() async {
|
||||||
|
// final XFile? pickedFile =
|
||||||
|
// await _picker.pickImage(source: ImageSource.gallery);
|
||||||
|
// if (pickedFile != null) {
|
||||||
|
// setState(() {
|
||||||
|
// _profileImage = File(pickedFile.path);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Function to open the date picker
|
||||||
|
|
||||||
void _pickImage() async {
|
void _pickImage() async {
|
||||||
final XFile? pickedFile =
|
final XFile? pickedFile =
|
||||||
await _picker.pickImage(source: ImageSource.gallery);
|
await _picker.pickImage(source: ImageSource.gallery);
|
||||||
if (pickedFile != null) {
|
if (pickedFile != null) {
|
||||||
|
final String fileExtension =
|
||||||
|
pickedFile.path.split('.').last.toLowerCase();
|
||||||
|
if (fileExtension == 'jpg' ||
|
||||||
|
fileExtension == 'jpeg' ||
|
||||||
|
fileExtension == 'png' ||
|
||||||
|
fileExtension == "heic") {
|
||||||
setState(() {
|
setState(() {
|
||||||
_profileImage = File(pickedFile.path);
|
_profileImage = File(pickedFile.path);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text('Please select a JPG, JPEG, or PNG file.')),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to open the date picker
|
|
||||||
Future<void> _pickDate() async {
|
Future<void> _pickDate() async {
|
||||||
final DateTime today = DateTime.now();
|
final DateTime today = DateTime.now();
|
||||||
final DateTime initialDate = _selectedDate ??
|
final DateTime initialDate = _selectedDate ??
|
||||||
@ -398,7 +420,9 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
Text(
|
Text(
|
||||||
"User Name",
|
"User Name",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -407,7 +431,7 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
controller: _usernameController,
|
controller: _usernameController,
|
||||||
focusNode: _focusNodes[0],
|
focusNode: _focusNodes[0],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _showHints[0] ? 'Mohammad Hassan' : null,
|
// hintText: _showHints[0] ? 'Mohammad Hassan' : null,
|
||||||
hintStyle: TextStyle(color: Colors.grey),
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@ -420,9 +444,11 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"E-mail",
|
"Email ID",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -431,10 +457,7 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
controller: _emailController,
|
controller: _emailController,
|
||||||
focusNode: _focusNodes[1],
|
focusNode: _focusNodes[1],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _showHints[1]
|
// hintText: _showHints[1]? 'mohammad.hassan@fcsc.gov.ae': null,
|
||||||
? 'mohammad.hassan@fcsc.gov.ae'
|
|
||||||
: null,
|
|
||||||
hintStyle: TextStyle(color: Colors.grey),
|
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
@ -446,9 +469,11 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Full Name",
|
"Full Name*",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -471,7 +496,7 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
controller: _fullNameController,
|
controller: _fullNameController,
|
||||||
focusNode: _focusNodes[2],
|
focusNode: _focusNodes[2],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: _showHints[2] ? 'Mohammad' : null,
|
// hintText: _showHints[2] ? 'Mohammad' : null,
|
||||||
hintStyle: TextStyle(color: Colors.grey),
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@ -490,7 +515,9 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
Text(
|
Text(
|
||||||
"Date of Birth*",
|
"Date of Birth*",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16, fontWeight: FontWeight.w500),
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -502,10 +529,8 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
hintText: _showHints[3]
|
// hintText: _showHints[3] ? 'Select your Date of Birth' : null,
|
||||||
? 'Select your Date of Birth'
|
hintStyle: TextStyle(color: Colors.grey),
|
||||||
: null,
|
|
||||||
//hintText: 'Select your Date of Birth',
|
|
||||||
suffixIcon: const Icon(Icons.arrow_drop_down_sharp),
|
suffixIcon: const Icon(Icons.arrow_drop_down_sharp),
|
||||||
enabled: !_isProfileCompleted,
|
enabled: !_isProfileCompleted,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -43,7 +43,9 @@ class _ManageUserRouterState extends State<ManageUserRouter> {
|
|||||||
try {
|
try {
|
||||||
await _pb.admins
|
await _pb.admins
|
||||||
.authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
|
.authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com');
|
||||||
final result = await _pb.collection('users').getFullList();
|
final result = await _pb.collection('users').getFullList(
|
||||||
|
filter: 'role="user"',
|
||||||
|
);
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
userData = result.map((record) {
|
userData = result.map((record) {
|
||||||
|
|||||||
@ -199,6 +199,15 @@ class _BaseScaffoldState extends State<BaseScaffold> {
|
|||||||
title: Text('Manage User'),
|
title: Text('Manage User'),
|
||||||
onTap: () => context.go('/manageuser'),
|
onTap: () => context.go('/manageuser'),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: SizedBox(
|
||||||
|
height: myheight / 15,
|
||||||
|
width: mywidth / 15,
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage('assets/icons/drawer/logout.png'))),
|
||||||
|
title: Text('Logout'),
|
||||||
|
onTap: () => context.go('/'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
10
pubspec.lock
10
pubspec.lock
@ -841,6 +841,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.16+1"
|
version: "0.12.16+1"
|
||||||
|
material_charts:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: material_charts
|
||||||
|
sha256: "3950a910eeb8f5dca7040a68d526a086a9512f87da5c2b172495a5fcab0f6dc3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.23"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1501,5 +1509,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.5.0 <4.0.0"
|
dart: ">=3.5.2 <4.0.0"
|
||||||
flutter: ">=3.24.0"
|
flutter: ">=3.24.0"
|
||||||
|
|||||||
@ -55,6 +55,7 @@ dependencies:
|
|||||||
mailer: ^6.2.0
|
mailer: ^6.2.0
|
||||||
image_picker: ^1.1.2
|
image_picker: ^1.1.2
|
||||||
syncfusion_flutter_charts: ^28.1.33
|
syncfusion_flutter_charts: ^28.1.33
|
||||||
|
material_charts: ^0.0.23
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
fading_edge_scrollview: ^4.1.1
|
fading_edge_scrollview: ^4.1.1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user