Device info package eltávolítva, google megszorítás miatt.
Helyette UUID használva.
This commit is contained in:
parent
8ea1190b4c
commit
af41592029
|
|
@ -22,6 +22,7 @@ import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
import 'package:lite_rolling_switch/lite_rolling_switch.dart';
|
import 'package:lite_rolling_switch/lite_rolling_switch.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
//AutoUpdateApk aua = new AutoUpdateApk(getApplicationContext(), UPDATE_URL);
|
//AutoUpdateApk aua = new AutoUpdateApk(getApplicationContext(), UPDATE_URL);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -68,8 +69,9 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
String currentWorkState="";
|
String currentWorkState="";
|
||||||
QRCodeModel currentQRcode=QRCodeModel();
|
QRCodeModel currentQRcode=QRCodeModel();
|
||||||
WorkStateModel workState=WorkStateModel();
|
WorkStateModel workState=WorkStateModel();
|
||||||
late EmployeeArguments ea;
|
EmployeeArguments? ea;
|
||||||
EmployeePageArguments employeePageArgs = EmployeePageArguments();
|
EmployeePageArguments employeePageArgs = EmployeePageArguments();
|
||||||
|
|
||||||
//device_info.DeviceInfo di=device_info.DeviceInfo();
|
//device_info.DeviceInfo di=device_info.DeviceInfo();
|
||||||
//late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
|
//late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
|
||||||
//var deviceData = <String, dynamic>{};
|
//var deviceData = <String, dynamic>{};
|
||||||
|
|
@ -148,19 +150,19 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
setState(() {
|
setState(() {
|
||||||
_reportButtonDisabled = false;
|
_reportButtonDisabled = false;
|
||||||
});
|
});
|
||||||
if (ea.mobilePortalAccessEnabled == false) {
|
if (ea?.mobilePortalAccessEnabled == false) {
|
||||||
_showAccessDeniedDialog();
|
_showAccessDeniedDialog();
|
||||||
}
|
}
|
||||||
employeePageArgs = EmployeePageArguments(
|
employeePageArgs = EmployeePageArguments(
|
||||||
name: ea.name,
|
name: ea?.name,
|
||||||
id: ea.id,
|
id: ea?.id,
|
||||||
apiKey: userApiKey,
|
apiKey: userApiKey,
|
||||||
isForeman: ea.isForeman,
|
isForeman: ea?.isForeman,
|
||||||
mobilePortalAccessEnabled: ea.mobilePortalAccessEnabled);
|
mobilePortalAccessEnabled: ea?.mobilePortalAccessEnabled);
|
||||||
setState(() {
|
setState(() {
|
||||||
_reportButtonDisabled = !ea.isForeman!;
|
_reportButtonDisabled = employeePageArgs.isForeman!;
|
||||||
});
|
});
|
||||||
if (ea.id!.isNotEmpty) {
|
if (employeePageArgs.id!.isNotEmpty) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -186,6 +188,7 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
}
|
}
|
||||||
Future<bool> getDeviceUUID() async{
|
Future<bool> getDeviceUUID() async{
|
||||||
storage.SecureStorage sc= storage.SecureStorage();
|
storage.SecureStorage sc= storage.SecureStorage();
|
||||||
|
|
||||||
deviceUUID1= await sc.readSecureData('UUID1');
|
deviceUUID1= await sc.readSecureData('UUID1');
|
||||||
deviceUUID2= await sc.readSecureData('UUID2');
|
deviceUUID2= await sc.readSecureData('UUID2');
|
||||||
if (deviceUUID1!.startsWith("No data found!") || deviceUUID2!.startsWith("No data found!")) {
|
if (deviceUUID1!.startsWith("No data found!") || deviceUUID2!.startsWith("No data found!")) {
|
||||||
|
|
@ -195,6 +198,21 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> _checkUUIDS() async {
|
||||||
|
storage.SecureStorage sc= storage.SecureStorage();
|
||||||
|
//sc.deleteSecureData('API');
|
||||||
|
bool resAPI= await storage.SecureStorage().checkContainsKey('API');// sc.checkContainsKey('API');
|
||||||
|
bool resUUID1= await storage.SecureStorage().checkContainsKey('UUID1') ;
|
||||||
|
bool resUUID2= await storage.SecureStorage().checkContainsKey('UUID2') ;
|
||||||
|
if (resAPI==false || resUUID1==false || resUUID2==false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Future<void> _registerDevicePage() async {
|
||||||
|
|
||||||
|
}
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initStateA
|
// TODO: implement initStateA
|
||||||
|
|
@ -204,49 +222,40 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
DeviceOrientation.portraitDown,
|
DeviceOrientation.portraitDown,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
getDeviceUUID().then((value)
|
|
||||||
//di.initPlatformState().then((value)
|
|
||||||
{
|
|
||||||
// deviceData = value;
|
|
||||||
if (value==false) {
|
|
||||||
Navigator.pushNamed(context, '/register', arguments: DeviceArguments(
|
|
||||||
//deviceData['id'], deviceData['device'], deviceData['brand'])).then((value)
|
|
||||||
"", "", ""));
|
|
||||||
}
|
|
||||||
//checkApiKey();
|
|
||||||
//saveApiKey();
|
|
||||||
storage.SecureStorage sc= storage.SecureStorage();
|
storage.SecureStorage sc= storage.SecureStorage();
|
||||||
//sc.deleteSecureData('API');
|
//sc.deleteSecureData('API');
|
||||||
Future<bool> res= storage.SecureStorage().checkContainsKey('API');// sc.checkContainsKey('API');
|
//Future<bool> resAPI= storage.SecureStorage().checkContainsKey('API');// sc.checkContainsKey('API');
|
||||||
res.then((value) {
|
//Future<bool> resUUID1= storage.SecureStorage().checkContainsKey('UUID1') ;
|
||||||
|
//Future<bool> resUUID2= storage.SecureStorage().checkContainsKey('UUID2') ;
|
||||||
|
|
||||||
//_isApiKeyValid=value;
|
//_isApiKeyValid=value;
|
||||||
//apiKeyValid=value;
|
//apiKeyValid=value;
|
||||||
if (value==false)
|
_checkUUIDS().then((val){
|
||||||
|
if (val==false)
|
||||||
{
|
{
|
||||||
Navigator.pushNamed(context, '/register', arguments: DeviceArguments(
|
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, '/register', arguments: DeviceArguments(
|
||||||
//deviceData['id'], deviceData['device'], deviceData['brand'])).then((value)
|
//deviceData['id'], deviceData['device'], deviceData['brand'])).then((value)
|
||||||
deviceUUID1!, deviceUUID2!, deviceBrand!)).then((value)
|
//deviceUUID1!, deviceUUID2!, deviceBrand!)).then((value) {
|
||||||
{
|
"", "", "")).then((value) {
|
||||||
Future<String> userApiKey = sc.readSecureData("API");
|
Future<String> userApiKey = sc.readSecureData("API");
|
||||||
userApiKey.then((apiKey) => checkApiKeyValidity(apiKey).then((apiKeyState) {
|
userApiKey.then((apiKey) =>
|
||||||
|
checkApiKeyValidity(apiKey).then((apiKeyState) {
|
||||||
// print("API key State: $apiKeyState");
|
// print("API key State: $apiKeyState");
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isApiKeyValid = apiKeyState;
|
_isApiKeyValid = apiKeyState;
|
||||||
if (ea.isForeman==true)
|
if (ea?.isForeman == true) {
|
||||||
{
|
|
||||||
_reportButtonDisabled = false;
|
_reportButtonDisabled = false;
|
||||||
}
|
}
|
||||||
if (ea.mobilePortalAccessEnabled==true)
|
if (ea?.mobilePortalAccessEnabled == true) {
|
||||||
{
|
|
||||||
NfcManager.instance.isAvailable().then((nfcState) {
|
NfcManager.instance.isAvailable().then((nfcState) {
|
||||||
if (_isApiKeyValid && !_isLocationMocked)
|
if (_isApiKeyValid && !_isLocationMocked) {
|
||||||
{
|
|
||||||
_showNFClogo = true;
|
_showNFClogo = true;
|
||||||
_tagRead();
|
_tagRead();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
_showNFClogo = false;
|
_showNFClogo = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -261,21 +270,23 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
getDeviceUUID();
|
||||||
Future<String> userApiKey=sc.readSecureData("API");
|
Future<String> userApiKey=sc.readSecureData("API");
|
||||||
userApiKey.then((apiKey) => checkApiKeyValidity(apiKey).then((apiKeyState) {
|
userApiKey.then((apiKey) => checkApiKeyValidity(apiKey).then((apiKeyState) {
|
||||||
// print("API key State: $apiKeyState");
|
// print("API key State: $apiKeyState");
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isApiKeyValid = apiKeyState;
|
_isApiKeyValid = apiKeyState;
|
||||||
if (ea.isForeman==true)
|
if (ea == null) return;
|
||||||
|
if (ea?.isForeman==true)
|
||||||
{
|
{
|
||||||
_reportButtonDisabled=false;
|
_reportButtonDisabled=false;
|
||||||
}
|
}
|
||||||
if (ea.mobilePortalAccessEnabled==true)
|
if (ea?.mobilePortalAccessEnabled==true)
|
||||||
{
|
{
|
||||||
NfcManager.instance.isAvailable().then((nfcState){
|
NfcManager.instance.isAvailable().then((nfcState){
|
||||||
if (_isApiKeyValid && !_isLocationMocked)
|
if (_isApiKeyValid && !_isLocationMocked)
|
||||||
|
|
@ -300,12 +311,12 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
|
});
|
||||||
//sc.writeSecureData("API", deviceData['id']);
|
//sc.writeSecureData("API", deviceData['id']);
|
||||||
//sc.checkContainsKey('API');
|
//sc.checkContainsKey('API');
|
||||||
//sc.readSecureData("API");
|
//sc.readSecureData("API");
|
||||||
});
|
//);
|
||||||
|
|
||||||
_getLocation();
|
_getLocation();
|
||||||
PackageInfo.fromPlatform().then((value) => {
|
PackageInfo.fromPlatform().then((value) => {
|
||||||
|
|
@ -355,6 +366,34 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Future<void> _showMyDialog(String message1) async {
|
||||||
|
return showDialog<void>(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: false, // user must tap button!
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Figyelmeztetés'),
|
||||||
|
content: const SingleChildScrollView(
|
||||||
|
child: ListBody(
|
||||||
|
children: <Widget>[
|
||||||
|
Text(message1 as String),
|
||||||
|
Text('Would you like to approve of this message?'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
child: const Text('Bezár'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
Widget nfcLogo() {
|
Widget nfcLogo() {
|
||||||
if (_location?.isMock==true) {
|
if (_location?.isMock==true) {
|
||||||
|
|
@ -380,48 +419,17 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Future _scanQR() async {
|
|
||||||
/*try {
|
|
||||||
String qrResult = await BarcodeScanner.scan();
|
|
||||||
setState(() {
|
|
||||||
_login(qrResult);
|
|
||||||
/* result = qrResult;
|
|
||||||
TcpClient a = new TcpClient(socket, 'iotechnic.eu', 8080);
|
|
||||||
|
|
||||||
_getId();
|
_loginQR(qrCode) async {
|
||||||
a.sendAccess(
|
|
||||||
deviceId,
|
|
||||||
result,
|
|
||||||
_currentAddress,
|
|
||||||
_currentPosition.latitude.toString(),
|
|
||||||
_currentPosition.longitude.toString());*/
|
|
||||||
});
|
|
||||||
} on PlatformException catch (ex) {
|
|
||||||
if (ex.code == BarcodeScanner.CameraAccessDenied) {
|
|
||||||
setState(() {
|
|
||||||
result = "Camera permission was denied";
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
result = "Unknown Error $ex";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} on FormatException {
|
|
||||||
setState(() {
|
|
||||||
result = "You pressed the back button before scanning anything";
|
|
||||||
});
|
|
||||||
} catch (ex) {
|
|
||||||
setState(() {
|
|
||||||
result = "Unknown Error $ex";
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
_loginQR(qrCode) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_showNFClogo = false;
|
_showNFClogo = false;
|
||||||
});
|
});
|
||||||
//DeviceInfo devInfo = _getDeviceInfo() as DeviceInfo;
|
|
||||||
|
|
||||||
|
bool r=await getDeviceUUID();
|
||||||
|
if (!r) return;
|
||||||
|
// _showMyDialog();
|
||||||
|
//DeviceInfo devInfo = _getDeviceInfo() as DeviceInfo;
|
||||||
|
_getLocation();
|
||||||
String indexRequest = '{'
|
String indexRequest = '{'
|
||||||
'"cmd":"ACCESSNOGEOQR",'
|
'"cmd":"ACCESSNOGEOQR",'
|
||||||
'"CID1":"$deviceUUID1",' //$"{deviceData['id']}",'
|
'"CID1":"$deviceUUID1",' //$"{deviceData['id']}",'
|
||||||
|
|
@ -497,12 +505,13 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
socket.flush();
|
socket.flush();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_login(rfid) {
|
_login(rfid) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_showNFClogo = false;
|
_showNFClogo = false;
|
||||||
});
|
});
|
||||||
//DeviceInfo devInfo = _getDeviceInfo() as DeviceInfo;
|
//DeviceInfo devInfo = _getDeviceInfo() as DeviceInfo;
|
||||||
|
bool r=await getDeviceUUID();
|
||||||
|
if (!r) return;
|
||||||
String indexRequest = '{'
|
String indexRequest = '{'
|
||||||
'"cmd":"ACCESSNOGEO",'
|
'"cmd":"ACCESSNOGEO",'
|
||||||
// '"CID1":"${deviceData['id']}",'
|
// '"CID1":"${deviceData['id']}",'
|
||||||
|
|
@ -581,30 +590,6 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Future<void> _showNotification() async {
|
|
||||||
var dateTime = DateTime(DateTime.now().year, DateTime.now().month,
|
|
||||||
DateTime.now().day, 10, 46, 0);
|
|
||||||
const AndroidNotificationDetails androidNotificationDetails =
|
|
||||||
AndroidNotificationDetails('your channel id', 'your channel name',
|
|
||||||
channelDescription: 'your channel description',
|
|
||||||
importance: Importance.max,
|
|
||||||
priority: Priority.high,
|
|
||||||
ticker: 'ticker');
|
|
||||||
const NotificationDetails notificationDetails =
|
|
||||||
NotificationDetails(android: androidNotificationDetails);
|
|
||||||
/*await flutterLocalNotificationsPlugin.show(
|
|
||||||
1234, 'plain title', 'plain body', notificationDetails,
|
|
||||||
payload: 'item x');*/
|
|
||||||
await flutterLocalNotificationsPlugin.zonedSchedule(
|
|
||||||
0,
|
|
||||||
'title',
|
|
||||||
'body',
|
|
||||||
tz.TZDateTime.from(dateTime, tz.local),
|
|
||||||
notificationDetails,
|
|
||||||
uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime,
|
|
||||||
matchDateTimeComponents: DateTimeComponents.time);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
_getAddressFromLatLng(lat,lon) async {
|
_getAddressFromLatLng(lat,lon) async {
|
||||||
try {
|
try {
|
||||||
List<geocoding.Placemark> placemarks = await geocoding.placemarkFromCoordinates(
|
List<geocoding.Placemark> placemarks = await geocoding.placemarkFromCoordinates(
|
||||||
|
|
@ -694,9 +679,7 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
style: const TextStyle(fontSize: 24.0),
|
style: const TextStyle(fontSize: 24.0),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
content: Container(
|
content: SingleChildScrollView(
|
||||||
//height: 400,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
@ -764,7 +747,6 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -858,7 +840,7 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(14.0),
|
padding: const EdgeInsets.all(14.0),
|
||||||
child: _initOK
|
child: _initOK || _loading
|
||||||
? Column(
|
? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
@ -875,7 +857,7 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(currentWorkState ?? ""),
|
Text(currentWorkState),
|
||||||
Text(currentQRcode.name ?? "",
|
Text(currentQRcode.name ?? "",
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
|
@ -1055,7 +1037,8 @@ class _MainPageState extends State<MainPage> with TickerProviderStateMixin{
|
||||||
fontWeight: FontWeight.bold),
|
fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
result,
|
'Location: ${_error ?? result}',
|
||||||
|
// result,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 30.0,
|
fontSize: 30.0,
|
||||||
|
|
|
||||||
|
|
@ -109,24 +109,24 @@ class _reportCreateState extends State<reportCreate> {
|
||||||
|
|
||||||
Container gridList(BuildContext context) {
|
Container gridList(BuildContext context) {
|
||||||
//List<ModelReportList> _reportList = [];
|
//List<ModelReportList> _reportList = [];
|
||||||
List<WorkListModel> workList = [];
|
List<WorkListModel> workList2 = [];
|
||||||
if (_showFaworites) {
|
if (_showFaworites) {
|
||||||
workList = workList
|
workList2 = workList
|
||||||
.where((element) => favoriteWorks.contains(element.sId))
|
.where((element) => favoriteWorks.contains(element.sId))
|
||||||
.toList();
|
.toList();
|
||||||
} else {
|
} else {
|
||||||
workList = workList;
|
workList2 = workList;
|
||||||
}
|
}
|
||||||
return Container(
|
return Container(
|
||||||
color: const Color(0xffECF0F1),
|
color: const Color(0xffECF0F1),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: workList.length, // The length Of the array
|
itemCount: workList2.length, // The length Of the array
|
||||||
|
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|
||||||
itemBuilder: (context, index) => Container(
|
itemBuilder: (context, index) => Container(
|
||||||
child: reportCard(context, workList[index]),
|
child: reportCard(context, workList2[index]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
/*import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
|
@ -180,4 +180,4 @@ class DeviceInfo{
|
||||||
'deviceId': data.deviceId,
|
'deviceId': data.deviceId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,9 @@ class _dailyReportListState extends State<dailyReportList> {
|
||||||
for (var item in data) {
|
for (var item in data) {
|
||||||
reportList.add(ModelReportList.fromJson(item));
|
reportList.add(ModelReportList.fromJson(item));
|
||||||
}
|
}
|
||||||
_isData = true;
|
|
||||||
setState(() {
|
setState(() {
|
||||||
|
_isData = true;
|
||||||
debugPrint('Fetch ok.');
|
debugPrint('Fetch ok.');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -210,25 +211,25 @@ Container page(BuildContext context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Container gridList(BuildContext context) {
|
Container gridList(BuildContext context) {
|
||||||
List<ModelReportList> reportList = [];
|
List<ModelReportList> reportList2 = [];
|
||||||
if (_showFaworites) {
|
if (_showFaworites) {
|
||||||
reportList = reportList
|
reportList2 = reportList
|
||||||
.where((element) => favoriteWorks.contains(element.sId))
|
.where((element) => favoriteWorks.contains(element.sId))
|
||||||
.toList();
|
.toList();
|
||||||
} else {
|
} else {
|
||||||
reportList = reportList;
|
reportList2 = reportList;
|
||||||
}
|
}
|
||||||
return Container(
|
return Container(
|
||||||
color: const Color(0xffECF0F1),
|
color: const Color(0xffECF0F1),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: reportList.length, // The length Of the array
|
itemCount: reportList2.length, // The length Of the array
|
||||||
|
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|
||||||
itemBuilder: (context, index) => Container(
|
itemBuilder: (context, index) => Container(
|
||||||
child: reportCardWidget(
|
child: reportCardWidget(
|
||||||
reportList[index]) //reportCard(context, _reportList[index]),
|
reportList2[index]) //reportCard(context, _reportList[index]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.3+1
|
version: 1.0.4+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.2.0 <4.0.0'
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
|
|
@ -56,6 +56,8 @@ dependencies:
|
||||||
lite_rolling_switch: ^1.0.1
|
lite_rolling_switch: ^1.0.1
|
||||||
permission_handler: ^11.3.1
|
permission_handler: ^11.3.1
|
||||||
uuid: ^4.4.2
|
uuid: ^4.4.2
|
||||||
|
fluttertoast: ^8.1.1
|
||||||
|
|
||||||
#flutter_local_notifications: ^17.1.2
|
#flutter_local_notifications: ^17.1.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue