Code changes by azmat

This commit is contained in:
risnaman
2026-09-30 09:13:45 +05:30
parent c95a3f1581
commit 63ecc3e7e6
316 changed files with 28050 additions and 27216 deletions
@@ -1,54 +1,54 @@
import 'package:flutter/material.dart';
class CustomizedFooter extends StatelessWidget {
final IconData homeIcon;
final IconData squareIcon;
final IconData addIcon;
final List<String> labels;
final List<Function()> onTapActions;
CustomizedFooter({
required this.homeIcon,
required this.squareIcon,
required this.addIcon,
required this.labels,
required this.onTapActions,
});
@override
Widget build(BuildContext context) {
assert(labels.length == 3 && onTapActions.length == 3);
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: const Offset(0, 3),
),
],
),
child: BottomNavigationBar(
onTap: (index) {
onTapActions[index]();
},
items: [
BottomNavigationBarItem(
icon: Icon(homeIcon),
label: labels[0],
),
BottomNavigationBarItem(
icon: Icon(squareIcon),
label: labels[1],
),
BottomNavigationBarItem(
icon: Icon(addIcon),
label: labels[2],
),
],
),
);
}
}
import 'package:flutter/material.dart';
class CustomizedFooter extends StatelessWidget {
final IconData homeIcon;
final IconData squareIcon;
final IconData addIcon;
final List<String> labels;
final List<Function()> onTapActions;
CustomizedFooter({
required this.homeIcon,
required this.squareIcon,
required this.addIcon,
required this.labels,
required this.onTapActions,
});
@override
Widget build(BuildContext context) {
assert(labels.length == 3 && onTapActions.length == 3);
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: const Offset(0, 3),
),
],
),
child: BottomNavigationBar(
onTap: (index) {
onTapActions[index]();
},
items: [
BottomNavigationBarItem(
icon: Icon(homeIcon),
label: labels[0],
),
BottomNavigationBarItem(
icon: Icon(squareIcon),
label: labels[1],
),
BottomNavigationBarItem(
icon: Icon(addIcon),
label: labels[2],
),
],
),
);
}
}
+339 -339
View File
@@ -1,339 +1,339 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg_provider/flutter_svg_provider.dart' as fs;
import '../../Utils/color_constants.dart';
import '../../Utils/image_constant.dart';
import '../../Utils/size_utils.dart';
import '../../providers/token_manager.dart';
import '../../resources/api_constants.dart';
import '../../theme/app_style.dart';
import '../LogoutService/Logoutservice.dart';
import 'package:http/http.dart' as http;
class Listgroup524ItemWidget extends StatefulWidget {
final Map<String, dynamic> userData;
Listgroup524ItemWidget({required this.userData});
@override
State<Listgroup524ItemWidget> createState() => _Listgroup524ItemWidgetState();
}
class _Listgroup524ItemWidgetState extends State<Listgroup524ItemWidget> {
int myProjectcount = 0;
int sharedWithMeCount = 0;
int allprojectCount = 0;
@override
void initState() {
super.initState();
fetchData();
}
Future<void> fetchData() async {
print("working");
final token = await TokenManager.getToken();
print(token);
String baseUrl = ApiConstants.baseUrl;
var myProjectcountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_myproject'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
var sharedWithMeCountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_sharedwithme'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
var allProjectsCountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_allproject'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
if (myProjectcountres.statusCode == 401) {
LogoutService.logout();
}
print(myProjectcountres.statusCode);
if (myProjectcountres.statusCode <= 209 &&
sharedWithMeCountres.statusCode <= 209) {
final myProjectData = jsonDecode(myProjectcountres.body);
final sharedData = jsonDecode(sharedWithMeCountres.body);
final allData = jsonDecode(allProjectsCountres.body);
setState(() {
myProjectcount = myProjectData;
sharedWithMeCount = sharedData;
allprojectCount = allData;
});
} else {
// Handle errors
print('Failed to fetch data');
}
}
@override
Widget build(BuildContext context) {
return Center(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "myproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
myProjectcount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'My Projects',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "sharedproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
sharedWithMeCount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'Shared with me',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "allproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
allprojectCount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'All Projects',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
],
),
),
);
}
}
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg_provider/flutter_svg_provider.dart' as fs;
import '../../Utils/color_constants.dart';
import '../../Utils/image_constant.dart';
import '../../Utils/size_utils.dart';
import '../../providers/token_manager.dart';
import '../../resources/api_constants.dart';
import '../../theme/app_style.dart';
import '../LogoutService/Logoutservice.dart';
import 'package:http/http.dart' as http;
class Listgroup524ItemWidget extends StatefulWidget {
final Map<String, dynamic> userData;
Listgroup524ItemWidget({required this.userData});
@override
State<Listgroup524ItemWidget> createState() => _Listgroup524ItemWidgetState();
}
class _Listgroup524ItemWidgetState extends State<Listgroup524ItemWidget> {
int myProjectcount = 0;
int sharedWithMeCount = 0;
int allprojectCount = 0;
@override
void initState() {
super.initState();
fetchData();
}
Future<void> fetchData() async {
print("working");
final token = await TokenManager.getToken();
print(token);
String baseUrl = ApiConstants.baseUrl;
var myProjectcountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_myproject'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
var sharedWithMeCountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_sharedwithme'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
var allProjectsCountres = await http.get(
Uri.parse('$baseUrl/workspace/secworkspaceuser/count_allproject'),
headers: {
'Authorization': 'Bearer $token',
'Content-Type':
'application/json', // You may need to adjust the content type as needed
},
);
if (myProjectcountres.statusCode == 401) {
LogoutService.logout();
}
print(myProjectcountres.statusCode);
if (myProjectcountres.statusCode <= 209 &&
sharedWithMeCountres.statusCode <= 209) {
final myProjectData = jsonDecode(myProjectcountres.body);
final sharedData = jsonDecode(sharedWithMeCountres.body);
final allData = jsonDecode(allProjectsCountres.body);
setState(() {
myProjectcount = myProjectData;
sharedWithMeCount = sharedData;
allprojectCount = allData;
});
} else {
// Handle errors
print('Failed to fetch data');
}
}
@override
Widget build(BuildContext context) {
return Center(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "myproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
myProjectcount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'My Projects',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "sharedproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
sharedWithMeCount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'Shared with me',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
GestureDetector(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ProjectListScreen(
// userData: widget.userData,
// type: "allproject"), // Get all projects
// ),
// );
},
child: Card(
color: Colors.white,
elevation: 0.0,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: getSize(
55,
),
width: getSize(
55,
),
margin: getMargin(
top: 2,
),
child: Stack(
alignment: Alignment.center,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: getSize(
55,
),
width: getSize(
55,
),
child: CircularProgressIndicator(
value: 0.5,
backgroundColor: ColorConstant.gray30099,
color: ColorConstant.blueA700,
),
),
),
Align(
alignment: Alignment.center,
child: Text(
allprojectCount.toString(),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyBold18,
),
),
],
),
),
// Text(
// myProjectcount.toString(),
// style: const TextStyle(
// color: Colors.black,
// fontSize: 12,
// ),
// ),
const SizedBox(
height: 3,
),
const Text(
'All Projects',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
),
],
),
),
),
),
],
),
),
);
}
}
+53 -53
View File
@@ -1,54 +1,54 @@
import 'package:flutter/material.dart';
import '../../Utils/size_utils.dart';
import '../../theme/app_style.dart';
// ignore: must_be_immutable
class ListtextItemWidget extends StatelessWidget {
ListtextItemWidget();
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Lorem ipsum",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold16,
),
Padding(
padding: getPadding(
top: 10,
),
child: Text(
"Lorem ipsum",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyRegular14,
),
),
],
),
Padding(
padding: getPadding(
top: 11,
bottom: 13,
),
child: Text(
"7.5",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold18,
),
),
],
);
}
import 'package:flutter/material.dart';
import '../../Utils/size_utils.dart';
import '../../theme/app_style.dart';
// ignore: must_be_immutable
class ListtextItemWidget extends StatelessWidget {
ListtextItemWidget();
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Lorem ipsum",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold16,
),
Padding(
padding: getPadding(
top: 10,
),
child: Text(
"Lorem ipsum",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyRegular14,
),
),
],
),
Padding(
padding: getPadding(
top: 11,
bottom: 13,
),
child: Text(
"7.5",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold18,
),
),
],
);
}
}
@@ -1,21 +1,21 @@
import 'package:flutter/material.dart';
class LocalSplashScreenComponent extends StatelessWidget {
const LocalSplashScreenComponent({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: Color(0xff2f73b9),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/hadwin_system/hadwin-splash-screen-logo.png',
height: 128.0,
),
],
),
);
}
}
import 'package:flutter/material.dart';
class LocalSplashScreenComponent extends StatelessWidget {
const LocalSplashScreenComponent({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: Color(0xff2f73b9),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/hadwin_system/hadwin-splash-screen-logo.png',
height: 128.0,
),
],
),
);
}
}
File diff suppressed because it is too large Load Diff
@@ -1,88 +1,88 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../Utils/size_utils.dart';
import '../../theme/app_style.dart';
class NotificationItem extends StatelessWidget {
final Map<String, dynamic> notification;
const NotificationItem({required this.notification});
@override
Widget build(BuildContext context) {
final notificationText = notification['notification'] as String;
final time = notification['time'] as String;
final timeDifference = calculateTimeDifference(time);
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// Text(
// notificationText,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.left,
// style: AppStyle.txtGilroySemiBold16,
// ),
Padding(
padding: getPadding(
top: 10,
),
child: Text(
notificationText,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyRegular14,
),
),
],
),
Padding(
padding: getPadding(
top: 11,
bottom: 13,
),
child: Text(
timeDifference,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold18,
),
),
],
);
ListTile(
title: Text(notificationText),
subtitle: Text(timeDifference),
);
}
String calculateTimeDifference(String time) {
final currentTime = DateTime.now();
final notificationTime = DateTime.parse(time);
final difference = currentTime.difference(notificationTime);
if (difference.inDays >= 365) {
final years = (difference.inDays / 365).floor();
return '${years} ${years == 1 ? 'year' : 'years'} ago';
} else if (difference.inDays >= 30) {
final months = (difference.inDays / 30).floor();
return '${months} ${months == 1 ? 'month' : 'months'} ago';
} else if (difference.inDays > 0) {
return '${difference.inDays} ${difference.inDays == 1 ? 'day' : 'days'} ago';
} else if (difference.inHours > 0) {
return '${difference.inHours} ${difference.inHours == 1 ? 'hour' : 'hours'} ago';
} else {
return 'Just now';
}
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../Utils/size_utils.dart';
import '../../theme/app_style.dart';
class NotificationItem extends StatelessWidget {
final Map<String, dynamic> notification;
const NotificationItem({required this.notification});
@override
Widget build(BuildContext context) {
final notificationText = notification['notification'] as String;
final time = notification['time'] as String;
final timeDifference = calculateTimeDifference(time);
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// Text(
// notificationText,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.left,
// style: AppStyle.txtGilroySemiBold16,
// ),
Padding(
padding: getPadding(
top: 10,
),
child: Text(
notificationText,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyRegular14,
),
),
],
),
Padding(
padding: getPadding(
top: 11,
bottom: 13,
),
child: Text(
timeDifference,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold18,
),
),
],
);
ListTile(
title: Text(notificationText),
subtitle: Text(timeDifference),
);
}
String calculateTimeDifference(String time) {
final currentTime = DateTime.now();
final notificationTime = DateTime.parse(time);
final difference = currentTime.difference(notificationTime);
if (difference.inDays >= 365) {
final years = (difference.inDays / 365).floor();
return '${years} ${years == 1 ? 'year' : 'years'} ago';
} else if (difference.inDays >= 30) {
final months = (difference.inDays / 30).floor();
return '${months} ${months == 1 ? 'month' : 'months'} ago';
} else if (difference.inDays > 0) {
return '${difference.inDays} ${difference.inDays == 1 ? 'day' : 'days'} ago';
} else if (difference.inHours > 0) {
return '${difference.inHours} ${difference.inHours == 1 ? 'hour' : 'hours'} ago';
} else {
return 'Just now';
}
}
}
File diff suppressed because it is too large Load Diff