Commit 6a5b04a9 authored by pongsanart's avatar pongsanart

pj

parent c4f5c886
.DS_Store
.dart_tool/
.packages
.pub/
.idea/
.vagrant/
.sconsign.dblite
.svn/
*.swp
profile
DerivedData/
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
build/
.android/
.ios/
.flutter-plugins
.flutter-plugins-dependencies
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 097d3313d8e2c7f901932d63e537c1acefb87800
channel: stable
project_type: module
{
"python.terminal.activateEnvironment": false
}
\ No newline at end of file
# flutter_application
A new flutter module project.
## Getting Started
For help getting started with Flutter, view our online
[documentation](https://flutter.dev/).
For instructions integrating Flutter modules to your existing applications,
see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app).
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/.android/gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/.android/gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/.android/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/.android/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/.android/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/.android/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/.android/proguard_logs" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/.android">
<sourceFolder url="file://$MODULE_DIR$/.android/Flutter/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/.android/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
</module>
import 'dart:developer';
import 'package:flutter_application/MongoDB/Address/AddressDBModel.dart';
import 'package:flutter_application/MongoDB/constant.dart';
import 'package:mongo_dart/mongo_dart.dart';
class AddressDatabase {
static var Addressdb, Addresscollection;
static connect() async {
Addressdb = await Db.create(MONGO_CONN_URL);
await Addressdb.open();
inspect(Addressdb);
Addresscollection = Addressdb.collection(ADDRESS_COLLECTION);
}
////////////list users/////////////
static Future<List<Map<String, dynamic>>> getData() async {
final arrData = await Addresscollection.find().toList();
return arrData;
}
///////////Update User///////////
static Future<void> update(AddressDbModel data) async {
var result = await Addresscollection.findOne({"_id": data.id});
result['ID_Seat'] = data.ID_desk;
result['Picture_floor'] = data.picture_floor;
result['Picture_room'] = data.Picture_room;
result['floor'] = data.floor;
result['room'] = data.room;
var response = await Addresscollection.save(result);
inspect(response);
}
/*
ID_desk
picture_floor
Picture_room
floor
room
ID_Device
User
*/
///////////delete////////////
static delete(AddressDbModel user) async {
await Addresscollection.remove(where.id(user.id));
}
//////////////Query //////////
///////////////////////////////////////////////////////
static Future<String>insert(AddressDbModel data) async {
try {
var result = await Addresscollection.insertOne(data.tojson());
if (result.isSuccess) {
return "data Inserted";
} else {
return "something wrong while inserting data.";
}
} catch (e) {
print(e.toString());
return e.toString();
}
}
}
/*
*/
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:mongo_dart/mongo_dart.dart';
AddressDbModel DeviceDbModelFromJson(String str)=> AddressDbModel.fromJson(json.decode(str));
String AddressDbModelToJson(AddressDbModel data )=> json.encode(data.tojson());
class AddressDbModel {
AddressDbModel({
required this.id,
required this.ID_desk,
required this.picture_floor,
required this.Picture_room,
required this.floor,
required this.room,
/*
ID_desk
picture_floor
Picture_room
floor
room
ID_Device
User
*/
});
ObjectId id;
String ID_desk;
String picture_floor;
String Picture_room;
String floor;
String room;
factory AddressDbModel.fromJson(Map<String,dynamic>json)=> AddressDbModel(
id: json["_id"],
ID_desk:json["ID_desk"],
picture_floor:json["picture_floor"],
Picture_room: json["Picture_room"],
floor: json["floor"],
room:json["room"],
);
Map<String,dynamic>tojson()=>{
"_id":id,
"ID_desk":ID_desk,
"picture_floor":picture_floor,
"Picture_room":Picture_room,
"floor":floor,
"room":room,
};
}
import 'dart:developer';
import 'package:flutter_application/MongoDB/Device/DeviceDBModel.dart';
import 'package:flutter_application/MongoDB/constant.dart';
import 'package:mongo_dart/mongo_dart.dart';
class DeviceDatabase {
static var Devicedb, devicecollection;
static connect() async {
Devicedb = await Db.create(MONGO_CONN_URL);
await Devicedb.open();
inspect(Devicedb);
devicecollection = Devicedb.collection(DEVICE_COLLECTION);
}
///////////Update User///////////
static Future<void> update(DeviceDbModel data) async {
var result = await devicecollection.findOne({"_id": data.id});
result['ID_Device'] = data.ID_Device ;
result['inventory'] = data.inventory;
result['type'] = data.type;
result['price'] = data.price;
result['year'] = data.year;
result['brand'] = data.brand;
result['model'] = data.model;
result['quality'] = data.quality;
var response = await devicecollection.save(result);
inspect(response);
}
////////////get GPS/////////////
static Future<List<Map<String, dynamic>>> getGPS(data) async {
final arrData = await devicecollection.find(where.eq('ID_Device', data)).toList();
return arrData;
}
////////////get Equipment/////////////
static Future<List<Map<String, dynamic>>> getEquipment() async {
final arrData = await devicecollection.find(where.eq('quality', 'Equipment')).toList();
return arrData;
}
//////////////////////////////////get Maintain////////////////////////////////////////////////////////
static Future<List<Map<String, dynamic>>> getMaintain() async {
final arrData = await devicecollection.find(where.eq('quality', 'Maintain')).toList();
return arrData;
}
//////////////////////////////get Expired()////////////////////////////////////////////
static Future<List<Map<String, dynamic>>> getExpired() async {
final arrData = await devicecollection.find(where.eq('quality', 'Expired')).toList();
return arrData;
}
/////////////////////////////////getdata////////////////////////////////////////////////
static Future<List<Map<String, dynamic>>> getdata() async {
final arrData = await devicecollection.find().toList();
return arrData;
}
/////////////////////// Equipment///////////////////////////////
static Future<void> Equipment(DeviceDbModel user) async {
var result = await devicecollection.findOne({"_id": user.id});
result['quality'] = 'Equipment';
var response = await devicecollection.save(result);
inspect(response);
}
/////////////////////// Maintain///////////////////////////////
static Future<void> Maintain(DeviceDbModel user) async {
var result = await devicecollection.findOne({"_id": user.id});
result['quality'] = 'Maintain';
var response = await devicecollection.save(result);
inspect(response);
}
/////////////////////// Maintain///////////////////////////////
static Future<void> Expired(DeviceDbModel user) async {
var result = await devicecollection.findOne({"_id": user.id});
result['quality'] = 'Expired';
var response = await devicecollection.save(result);
inspect(response);
}
///////////delete////////////
static delete(DeviceDbModel user) async {
await devicecollection.remove(where.id(user.id));
}
///////////////////////////////////////////////////////
static Future<String> insert(DeviceDbModel data) async {
try {
var result = await devicecollection.insertOne(data.tojson());
if (result.isSuccess) {
return "data Inserted";
} else {
return "something wrong while inserting data.";
}
} catch (e) {
print(e.toString());
return e.toString();
}
}
}
/*
ID_Device
inventory numder
type
price
year of use
brand
model
quality
*/
\ No newline at end of file
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:mongo_dart/mongo_dart.dart';
DeviceDbModel DeviceDbModelFromJson(String str)=> DeviceDbModel.fromJson(json.decode(str));
String DeviceDbModelToJson(DeviceDbModel data )=> json.encode(data.tojson());
class DeviceDbModel {
DeviceDbModel({
required this.id,
required this.ID_Device,
required this.inventory,
required this.type,
required this.price,
required this.year,
required this.brand,
required this.model,
required this.ID_Desk,
required this.quality,
});
ObjectId id;
String ID_Device;
String inventory;
String type;
String price;
String year;
String brand;
String model;
String ID_Desk;
String quality;
factory DeviceDbModel.fromJson(Map<String,dynamic>json)=> DeviceDbModel(
id: json["_id"],
ID_Device:json["ID_Device"],
inventory:json["inventory"],
type:json["type"],
price: json["price"],
year: json["year"],
brand:json["brand"],
model:json["model"],
ID_Desk:json["ID_Desk"],
quality:json["quality"],
);
Map<String,dynamic>tojson()=>{
"_id":id,
"ID_Device":ID_Device,
"inventory":inventory,
"type":type,
"price":price,
"year":year,
"brand":brand,
"model":model,
"ID_Desk":ID_Desk,
"quality":quality,
};
}
/*
ID_Device
inventory numder
type
price
year of use
brand
model
ID_Desk
quality
*/
import 'dart:developer';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/constant.dart';
import 'package:mongo_dart/mongo_dart.dart';
class informDatabase {
static var db, informcollection;
static connect() async {
db = await Db.create(MONGO_CONN_URL);
await db.open();
inspect(db);
informcollection = db.collection(INFORM_COLLECTION);
}
////////////////////login///////////////////
static Future<List<Map<String, dynamic>>>getlogin(email,password) async {
final data = await informcollection.find(where.eq("email",email).eq('password',password)).toList();
return data;
}
///////////Update User///////////
static Future<void> update(informDbModel data) async {
var result = await informcollection.findOne({"_id": data.id});
result['ID_Device'] = data.ID_Device;
result['Proble'] = data.Proble;
result['firstName'] = data.firstName;
result['lastName'] = data.lastName;
result['status'] = data.status;
var response = await informcollection.save(result);
inspect(response);
}
///////////delete////////////
static delete(informDbModel user) async {
await informcollection.remove(where.id(user.id));
}
////////////list status/////////////
static Future<List<Map<String, dynamic>>> getstatus() async {
final arrData = await informcollection.find(where.eq('status', 'In progress')).toList();
return arrData;
}
////////////list history/////////////
static Future<List<Map<String, dynamic>>> gethistory() async {
final arrData = await informcollection.find(where.eq('status', 'Done')).toList();
return arrData;
}
////////////// firstName //////////
static Future<List<Map<String, dynamic>>> getfirstName(textdata ) async {
final data = await informcollection.find(where.eq('firstName',textdata )).toList();
return data;
}
static Future<void> Done(informDbModel user) async {
var result = await informcollection.findOne({"_id": user.id});
result['status'] = 'Done';
var response = await informcollection.save(result);
inspect(response);
}
static Future<String> insert(informDbModel data) async {
try {
var result = await informcollection.insertOne(data.tojson());
if (result.isSuccess) {
return "data Inserted";
} else {
return "something wrong while inserting data.";
}
} catch (e) {
print(e.toString());
return e.toString();
}
}
//เพิ่มสิ่งที่อยากได้ where มี3แบบ .gt ค่าตัวเลขที่มากกว่า .lt ค่าตัวเลขที่น้อยกว่า .eq ค้นหาตรงตัวชื่อ
}
/*
1 ID_Device
2 Proble
3 firstName
4 lastName
*/
\ No newline at end of file
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:mongo_dart/mongo_dart.dart';
informDbModel MongoDbModelFromJson(String str)=> informDbModel.fromJson(json.decode(str));
String mongoDbModelToJson(informDbModel data )=> json.encode(data.tojson());
class informDbModel {
informDbModel({
required this.id,
required this.ID_Device,
required this.Proble,
required this.firstName,
required this.lastName,
required this.status,
});
ObjectId id;
String ID_Device;
String Proble;
String firstName;
String lastName;
String status;
factory informDbModel.fromJson(Map<String,dynamic>json)=> informDbModel(
id: json["_id"],
ID_Device:json["ID_Device"],
Proble:json["Proble"],
firstName: json["firstName"],
lastName: json["lastName"],
status: json["status"],
);
Map<String,dynamic>tojson()=>{
"_id":id,
"ID_Device":ID_Device,
"Proble":Proble,
"firstName":firstName,
"lastName":lastName,
"status":status,
};
}
/*
1 ID_Device
2 Proble
3 firstName
4 lastName
5 status
*/
//MongoDB URL
const MONGO_CONN_URL=
"mongodb+srv://MongoDB:zYvxcGech0cYr8bw@cluster0.etp3y.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
////User="MongoDB";
//password="zYvxcGech0cYr8bw"
//OUR COLLECTION NAME IS USER
const USER_COLLECTION="users";
//OUR COLLECTION NAME IS DEVICE
const DEVICE_COLLECTION="equipment";
//OUR COLLECTION NAME IS DESK ADDRESS
const ADDRESS_COLLECTION="desk_address";
//OUR COLLECTION NAME IS LIST_INFORM
const INFORM_COLLECTION="list_inform";
import 'dart:developer';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/constant.dart';
import 'package:mongo_dart/mongo_dart.dart';
class UserDatabase {
static var db, usercollection;
static connect() async {
db = await Db.create(MONGO_CONN_URL);
await db.open();
inspect(db);
usercollection = db.collection(USER_COLLECTION);
}
////////////////////login///////////////////
static Future<List<Map<String, dynamic>>>getlogin(ID_User,password) async {
var data = await usercollection.find(where.eq("ID_User",ID_User).eq('password',password)).toList();
print("getlogin : ${data}");
return data;
}
///////////Update User///////////
static Future<void> update(UserDbModel data) async {
var result = await usercollection.findOne({"_id": data.id});
result['ID_User'] = data.ID_User;
result['password'] = data.password;
result['firstName'] = data.firstName;
result['lastName'] = data.lastName;
result['age'] = data.age;
result['Phone'] = data.Phone;
result['image'] = data.image;
result['seat'] = data.seat;
var response = await usercollection.save(result);
inspect(response);
}
///////////delete////////////
static delete(UserDbModel user) async {
await usercollection.remove(where.id(user.id));
}
////////////list users/////////////
static Future<List<Map<String, dynamic>>> getData() async {
final arrData = await usercollection.find().toList();
return arrData;
}
////////////user one /////////////
static Future<List<Map<String, dynamic>>> getone(ID_User,password) async {
final arrData = await usercollection.find(where.eq("ID_User",ID_User).eq('password',password)).toList();
return arrData;
}
////////////////////////////////inesrt//////////////////////////////////////////////////
static Future<String> inesrt(UserDbModel data) async {
try {
var result = await usercollection.insertOne(data.tojson());
if (result.isSuccess) {
return "data Inserted";
} else {
return "something wrong while inserting data.";
}
}
catch (e) {
print(e.toString());
return e.toString();
}
}
//เพิ่มสิ่งที่อยากได้ where มี3แบบ .gt ค่าตัวเลขที่มากกว่า .lt ค่าตัวเลขที่น้อยกว่า .eq ค้นหาตรงตัวชื่อ
}
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:mongo_dart/mongo_dart.dart';
UserDbModel MongoDbModelFromJson(String str)=> UserDbModel.fromJson(json.decode(str));
String mongoDbModelToJson(UserDbModel data )=> json.encode(data.tojson());
class UserDbModel {
UserDbModel({
required this.id,
required this.ID_User,
required this.password,
required this.firstName,
required this.lastName,
required this.age,
required this.Phone,
required this.image,
required this.seat,
});
ObjectId id;
String ID_User;
String password;
String firstName;
String lastName;
String age;
String Phone;
String image;
String seat;
factory UserDbModel.fromJson(Map<String,dynamic>json)=> UserDbModel(
id: json["_id"],
ID_User:json["ID_User"],
password:json["password"],
firstName: json["firstName"],
lastName: json["lastName"],
age:json["age"],
Phone:json["Phone"],
image:json["image"],
seat:json["seat"],
);
Map<String,dynamic>tojson()=>{
"_id":id,
"ID_User":ID_User,
"password":password,
"firstName":firstName,
"lastName":lastName,
"age":age,
"Phone":Phone,
"image":image,
"seat":seat,
};
}
/*
1 id
2 ID_User
3 password
4 firstName
5 lastName
6 age
7 Phone
8 image
9 seat
*/
// ignore_for_file: deprecated_member_use
import 'package:flutter_application/MongoDB/Address/Address.dart';
import 'package:flutter_application/MongoDB/Address/AddressDBModel.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter/material.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
class add_desk extends StatelessWidget {
var ID_deskController = new TextEditingController();
var picture_floorController = new TextEditingController();
var Picture_roomController = new TextEditingController();
var floorController = new TextEditingController();
var roomController = new TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("Add Desk"),
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
TextFormField(
controller: ID_deskController,
decoration: new InputDecoration(labelText: "ID Desk"),
),
TextFormField(
controller: picture_floorController,
decoration:
new InputDecoration(labelText: " Picture Floor"),
),
TextFormField(
controller: Picture_roomController,
decoration:
new InputDecoration(labelText: "Picture Room"),
),
TextFormField(
controller: floorController,
decoration: new InputDecoration(labelText: "Floor"),
),
TextFormField(
controller: roomController,
decoration: new InputDecoration(labelText: "Room"),
),
SizedBox(
height: 50,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RaisedButton(
onPressed: () {
_inesrDataUser(
ID_deskController.text,
picture_floorController.text,
Picture_roomController.text,
floorController.text,
roomController.text,
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Save Data Device.'), //Messenger Save Data User.
),
);
},
color: Colors.green,
child: Text(
"Insert Data",
style: TextStyle(color: Colors.white),
))
],
)
],
)),
),
),
]));
}
Future<void> _inesrDataUser(
String ID_desk,
String picture_floor,
String Picture_room,
String floor,
String room,
) async {
var _id = M.ObjectId();
final data = AddressDbModel(
id: _id,
ID_desk: ID_desk,
picture_floor: picture_floor,
Picture_room: Picture_room,
floor: floor,
room: room,
);
var result = await AddressDatabase.insert(data);
_clearALL();
}
void _clearALL() {
ID_deskController.text = "";
picture_floorController.text = "";
Picture_roomController.text = "";
floorController.text = "";
roomController.text = "";
}
}
// ignore_for_file: deprecated_member_use
import 'package:flutter_application/MongoDB/Device/Device.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Device/DeviceDBModel.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
class add_device extends StatelessWidget {
var ID_DeviceController = new TextEditingController();
var inventoryController = new TextEditingController();
var typeController = new TextEditingController();
var priceController = new TextEditingController();
var yearController = new TextEditingController();
var brandController = new TextEditingController();
var modelController = new TextEditingController();
var ID_DeskController = new TextEditingController();
var qualityController = "Equipment";
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("เพิ่มบัญชีอุปกรณ์"),
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
Image.network(
"https://png.pngtree.com/png-vector/20191022/ourlarge/pngtree-beautiful-computer-vector-glyph-icon-png-image_1844559.jpg",
height: 200.0,
width: 200.0,
fit: BoxFit.cover,
),
TextFormField(
controller: ID_DeviceController,
decoration: new InputDecoration(labelText: "ID เครื่อง"),
),
TextFormField(
controller: inventoryController,
decoration: new InputDecoration(labelText: "หมายเลยครุภัณฑ์"),
),
TextFormField(
controller: typeController,
decoration: new InputDecoration(labelText: "ปรเภทอุปกรณ์"),
),
TextFormField(
controller: priceController,
decoration: new InputDecoration(labelText: "ราคา"),
),
TextFormField(
controller: yearController,
decoration: new InputDecoration(labelText: "อายุการใช้งาน"),
),
TextFormField(
controller: brandController,
decoration: new InputDecoration(labelText: "ยี้ห้อ"),
),
TextFormField(
controller: modelController,
decoration:new InputDecoration(labelText: "รุ่น"),
),
TextFormField(
controller: ID_DeskController,
decoration:new InputDecoration(labelText: "โต๊ะ"),
),
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RaisedButton(
onPressed: () {
_inesrDataUser(
ID_DeviceController.text,
inventoryController.text,
typeController.text,
priceController.text,
yearController.text,
brandController.text,
modelController.text,
ID_DeskController.text,
qualityController
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Save Data Device.'), //Messenger Save Data User.
),
);
},
color: Colors.green,
child: Text(
"Insert Data",
style: TextStyle(color: Colors.white),
))
],
)
],
)),
),
),
]));
}
Future<void> _inesrDataUser(
String ID_Device,
String inventory,
String type,
String price,
String year,
String brand,
String model,
String ID_Desk,
String quality,
) async {
var _id = M.ObjectId();
final data = DeviceDbModel(
id: _id,
ID_Device: ID_Device,
inventory: inventory,
type: type,
price: price,
year: year,
brand: brand,
model: model,
ID_Desk:ID_Desk,
quality:quality,
);
var result = await DeviceDatabase.insert(data);
_clearALL();
}
void _clearALL() {
ID_DeviceController.text="";
inventoryController.text = "";
typeController.text = "";
priceController.text = "";
yearController.text = "";
brandController.text = "";
modelController.text = "";
ID_DeskController.text="";
qualityController="";
}
}
/*
ID_Device
inventory numder
type
price
year of use
brand
model
ID_Desk
quality
*/
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_application/admin/add_desk.dart';
import 'package:flutter_application/admin/add_device.dart';
import 'package:flutter_application/admin/equipment_inventory.dart';
import 'package:flutter_application/admin/gps.dart';
import 'package:flutter_application/admin/history.dart';
import 'package:flutter_application/admin/map.dart';
import 'package:flutter_application/admin/notifications.dart';
import 'package:flutter_application/admin/user_account.dart';
import 'package:flutter_application/main.dart';
import 'package:flutter_application/user/account.dart';
class admin extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: Column(
children: <Widget>[
AppBar(
backgroundColor: Colors.blueGrey,
automaticallyImplyLeading: false,
leading: Icon(
Icons.home,
size: 30,
color: Colors.white,
),
title: Text("เมนู"),
),
ListTile(
leading:
Icon(Icons.badge_rounded, size: 30, color: Colors.blueGrey),
title: Text("จัดการบัญชีผู้ใช้งาน"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new user_account()),
);
}),
ListTile(
leading: Icon(Icons.engineering_rounded,
size: 30, color: Colors.blueGrey),
title: Text("รายการแจ้งปัญหา "),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new notification_list()),
);
}),
ListTile(
leading:
Icon(Icons.browser_updated, size: 30, color: Colors.blueGrey),
title: Text("เพิ่มอุปกรณ์"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new add_device()),
);
}),
ListTile(
leading: Icon(Icons.corporate_fare_outlined,
size: 30, color: Colors.blueGrey),
title: Text("คลังเก็บอุปกรณ์"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new equipment_inventory()),
);
}),
ListTile(
leading:
Icon(Icons.article_outlined , size: 30, color: Colors.blueGrey),
title: Text("ประวัติรายการแก้ไขปัญหา "),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new History()),
);
}),
ListTile(
leading: Icon(Icons.output, size: 30, color: Colors.blueGrey),
title: Text("ออกจากระบบ"),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return MyApp();
}));
})
],
),
);
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
import 'package:mongo_dart/mongo_dart.dart';
class GPS extends StatelessWidget {
@override
Widget build(BuildContext context) {
informDbModel data =ModalRoute.of(context)!.settings.arguments as informDbModel;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.yellow[800],
title: Text("${data.ID_Device}"),
),
body: ListView(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Center(
child: Column(
children: [
Text( " floor : 1 \n"),
Image.network(
"https://lh3.googleusercontent.com/pw/AM-JKLXMiW0Vq6a6ODO_dewXSLL6tK-KoFlrZ9uFyl-fYhVvXHmO-sGj4eEGqdjhqHGNGfwmp5fKcrZQRY1sIgok-lH42FTHYm_1GJjd2qj35mpYbHt6xUpwQKOn3HmQUe9wbuDskwxKeUdp1sZ4qRbH4nJS=w878-h777-no?authuser=1",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
Text( " room : 1C-15,16 "),
Image.network(
"https://lh3.googleusercontent.com/wN_rAOTXDmY8H_LPNrVEknzmtwTdo5VnWxdmOrqEnCyzt1cWBGDfmq3Pn8xCKoqehQZTb3VVpl0dhXXmk2onKe25SY2h6c02O6dZGZMZeB98ry2yCq-ab-yr6sZcf6jj02_DlRWXa7JPewOqZ3a3xYlruhmFb7i-tMgvcBI5GYw8wyNEr9jmpwk4F49v983UDZrWS8GcE3ZQWX4c0YL-isS0qtTnrD2JHSG8WOH5yTXJNMm_7W_HOxeM2SeYiEShFmC_yMHuAalrCvC5iVTnOsHHFrn9SpwRG_6fdnfE1GpD3Yu6OiWzoib-Oo6XGEo5BW92Rk9_RLuUP_48Iegj5sF-I5K5LWqH-epme2BspHNOk4W8KF6x7y8Ba_Zkub931iJ1-EDa8Jir8W1p22c9dFP2FkbA0Ux4GB4NALxQbL2Fw5vaYLSCOTTYvJwRB6tfOewWGID1YpglCX2UY7_G686XYaqmb-01SKI3Rhl07mMPaA2NL-H3jJTuU-b-fEqJ3PuAWCYkZJcGaWhJQmNywbAuDML3q_OC-9Dqx_RoHa2J3mE6hBmHyJ9qKG0uUM0nq-WEu-G8_93jMwgXXItA4wrjjtO-vjFTflIGxq3J5gNzBBZ--plFRaE6MtK807RIyyV17n2EbbrppdJZYrRZAURJzFTd-ivMJ8YJdlDycztEy2u-2ASIT8L4l1wVDRUcfedibPAzn009_3yxseuFMMt9DWe3eOsS74iQKMFCmPs2I_COthHJQBrIpOo6O1UAvHtIOfho5XtpYC-Wndmn7q7njqy7bsYBFwdsncF8oei4Ia6TgvQuFOX5JKwsvOQX5sVGXZYwk5lKZnSeyY38RGtXNsFBU_1WZ5NSjgHNCEsLJJrgpW6qpNFMQJ2ukcclJVCKhyRy2qG8Fg=w879-h778-no?authuser=1",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
Text(" ID_desk : ${data.ID_Device} \n\n"
),
],
),
)),
),
),
]));
}
}
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Inform/informDB.dart';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter_application/admin/gps.dart';
import 'package:flutter_application/user/user.dart';
class History extends StatefulWidget {
const History({Key? key}) : super(key: key);
@override
State<History> createState() => _HistoryState();
}
class _HistoryState extends State<History> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("ประวัติการแจ้งปัญหา "),
actions: [],
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: FutureBuilder(
future: informDatabase.gethistory(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Row(
children: [
Expanded(
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
return list_Users(informDbModel
.fromJson(snapshot.data[index]));
})),
],
);
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
)),
);
}
Widget list_Users(informDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
" ชื่อผู้แจ้ง : ${data.firstName} ${data.lastName}\n\n"
" ID เครื่อง : ${data.ID_Device} \n\n"
" อาการ : ${data.Proble} \n\n"
" สถานะ : ${data.status}"),
],
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
////////////////////////////////Delete//////////////////////////////
IconButton(
onPressed: () {},
icon: Icon(Icons.check_circle_outline_rounded ,size: 50,),
color: Colors.green,
),
]),
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Address/Address.dart';
import 'package:flutter_application/MongoDB/Address/AddressDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter_application/from_add/from_map.dart';
import 'package:flutter_application/from_add/from_user.dart';
import 'package:flutter_application/from_add/map_update.dart';
import 'package:flutter_application/from_add/sign_up.dart';
import '../from_add/User_update.dart';
class map extends StatefulWidget {
const map({Key? key}) : super(key: key);
@override
State<map> createState() => _mapState();
}
class _mapState extends State<map>{
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("Building Map "),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: FutureBuilder(
future:AddressDatabase.getData() ,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Row(
children: [
Expanded(
child: ListView.builder(
itemCount: snapshot.data.length ,
itemBuilder: (context, index) {
return
list_Users(AddressDbModel.fromJson(
snapshot.data[index ]));
})),
],
);
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
)),
);
}
Widget list_Users(AddressDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.network(
"${data.Picture_room}",
height: 80.0,
width: 80.0,
fit: BoxFit.cover,
),
SizedBox(
height: 5,
),
Text( " ID Desk : ${data.ID_desk} ",
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
color: Colors.blueGrey)
),
],
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
//////////////////////////from_User////////////////////////////////
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return from_map();
},
settings: RouteSettings(arguments: data))
)
.then((value) {
setState(() {});
});
},
icon: Icon(Icons.art_track ,size: 30,),
color: Colors.yellow[800],
),
//////////////////////////User Update////////////////////////////////
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return map_update();
},
settings: RouteSettings(arguments: data))
)
.then((value) {
setState(() {});
});
},
icon: Icon(Icons.edit),
color: Colors.green,
),
////////////////////////////////Delete//////////////////////////////
IconButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Delete?'),
content: Text("Delete : ${data.ID_desk} "),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Cancel'),
),
TextButton(
onPressed: () async {
await AddressDatabase.delete(data);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Delete ${data.ID_desk}"), //Messenger Save Data User.
),
);
Navigator.pop(context, 'OK');
},
child: const Text('OK'),
),
],
),
),
icon: Icon(Icons.delete),
color: Colors.red[400],
),
]),
],
),
),
);
}
}
/*
1 email
2 password
3 firstName
4 lastName
5 age
6 Phone
7 image
8 seat
*/
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Inform/informDB.dart';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter_application/admin/gps.dart';
import 'package:flutter_application/user/user.dart';
class notification_list extends StatefulWidget {
const notification_list({Key? key}) : super(key: key);
@override
State<notification_list> createState() => _notification_listState();
}
class _notification_listState extends State<notification_list> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("รายการแจ้งปัญหา "),
actions: [],
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: FutureBuilder(
future: informDatabase.getstatus(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Row(
children: [
Expanded(
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
return list_Users(informDbModel
.fromJson(snapshot.data[index]));
})),
],
);
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
)),
);
}
Widget list_Users(informDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
" ชื่อผู้แจ้ง: ${data.firstName} ${data.lastName}\n\n"
" ID เครื่อง : ${data.ID_Device} \n\n"
" อาการ : ${data.Proble} \n\n"
" สถานะ : ${data.status}\n"),
],
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
////////////////////////////////Delete//////////////////////////////
IconButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Delete?'),
content: Text(" ID Device : ${data.ID_Device} "),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Cancel'),
),
TextButton(
onPressed: () async {
await informDatabase.delete(data);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Delete ID Device : ${data.ID_Device} \n"), //Messenger Save Data User.
),
);
Navigator.pop(context, 'OK');
},
child: const Text('OK'),
),
],
),
),
icon: Icon(Icons.delete),
color: Colors.red[400],
),
//////////////////////////GPS////////////////////////////////
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return GPS();
},
settings: RouteSettings(arguments: data)))
.then((value) {
setState(() {});
});
},
icon: Icon(Icons.pin_drop),
color: Colors.yellow[800],
),
/////////////////////////////////////Done///////////////////////////////////////////////
IconButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Do you deal with problems? \n'),
content: Text(" ID Device : ${data.ID_Device} \n\n"
"Name informer: ${data.firstName} ${data.lastName}\n"),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Cancel'),
),
TextButton(
onPressed: () async {
await informDatabase.Done(data);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Maintain : \n"), //Messenger Save Data User.
),
);
Navigator.pop(context, 'OK');
},
child: const Text('OK'),
),
],
),
),
icon: Icon(Icons.check_outlined),
color: Colors.green,
),
]),
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:flutter_application/admin/admin.dart';
import 'package:flutter_application/from_add/from_user.dart';
import 'package:flutter_application/from_add/sign_up.dart';
import '../from_add/User_update.dart';
class user_account extends StatefulWidget {
const user_account({Key? key}) : super(key: key);
@override
State<user_account> createState() => _user_accountState();
}
class _user_accountState extends State<user_account>{
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: admin(),
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("บัญชีผู้ใช้งานทั้งหมด"),
actions: [
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return sign_up();
},
));
},
icon: Icon(Icons.add_box_outlined,size: 30,),
color: Colors.white,
),
],
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: FutureBuilder(
future:UserDatabase.getData() ,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Row(
children: [
Expanded(
child: ListView.builder(
itemCount: snapshot.data.length ,
itemBuilder: (context, index) {
return
list_Users(UserDbModel.fromJson(
snapshot.data[index ]));
})),
],
);
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
)),
);
}
Widget list_Users(UserDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipOval(
child: Image.network(
"${data.image}",
height: 80.0,
width: 80.0,
fit: BoxFit.cover,
),
),
SizedBox(
height: 5,
),
Text(" ชื่อ : ${data.firstName} ${data.lastName} \n\n"
" อายุ: ${data.age} \n\n"
" เบอร์โทร : ${data.Phone}\n\n "
" โต๊ะ : ${data.seat}"),
],
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
//////////////////////////from_User////////////////////////////////
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return from_User();
},
settings: RouteSettings(arguments: data))
)
.then((value) {
setState(() {});
});
},
icon: Icon(Icons.art_track ,size: 30,),
color: Colors.yellow[800],
),
//////////////////////////User Update////////////////////////////////
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return User_update();
},
settings: RouteSettings(arguments: data))
)
.then((value) {
setState(() {});
});
},
icon: Icon(Icons.edit),
color: Colors.green,
),
////////////////////////////////Delete//////////////////////////////
IconButton(
onPressed: () => showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Delete?'),
content: Text(" Name : ${data.firstName} ${data.lastName}"),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Cancel'),
),
TextButton(
onPressed: () async {
await UserDatabase.delete(data);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Delete ${data.firstName}${data.lastName}"), //Messenger Save Data User.
),
);
Navigator.pop(context, 'OK');
},
child: const Text('OK'),
),
],
),
),
icon: Icon(Icons.delete),
color: Colors.red[400],
),
]),
],
),
),
);
}
}
/*
1 email
2 password
3 firstName
4 lastName
5 age
6 Phone
7 image
8 seat
*/
\ No newline at end of file
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Device/Device.dart';
import 'package:flutter_application/MongoDB/Device/DeviceDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
import 'package:mongo_dart/mongo_dart.dart';
class Equipment_Update extends StatelessWidget {
var ID_DeviceController = new TextEditingController();
var inventoryController = new TextEditingController();
var typeController = new TextEditingController();
var priceController = new TextEditingController();
var yearController = new TextEditingController();
var brandController = new TextEditingController();
var modelController = new TextEditingController();
var ID_DeskController = new TextEditingController();
var qualityController = new TextEditingController();
/*
ID_Device
inventory numder
type
price
year of use
brand
model
ID_Desk
quality
*/
@override
Widget build(BuildContext context) {
DeviceDbModel data =
ModalRoute.of(context)!.settings.arguments as DeviceDbModel;
if (data != null) {
ID_DeviceController.text = data.ID_Device;
inventoryController.text = data.inventory;
typeController.text = data.type;
priceController.text = data.price;
yearController.text = data.year;
brandController.text = data.brand;
modelController.text = data.model;
ID_DeskController.text = data.ID_Desk;
qualityController.text = data.quality;
}
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.green[700],
title: Text("แก้ไขข้อมูลอุปกรณ์"),
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
SizedBox(
height: 20,
),
TextFormField(
controller: ID_DeviceController,
decoration: new InputDecoration(labelText: "ID_Device"),
),
TextFormField(
controller: inventoryController,
decoration: new InputDecoration(labelText: "inventory"),
),
TextFormField(
controller: typeController,
decoration: new InputDecoration(labelText: "type"),
),
TextFormField(
controller: priceController,
decoration: new InputDecoration(labelText: "price"),
),
TextFormField(
controller: yearController,
decoration: new InputDecoration(labelText: "year"),
),
TextFormField(
controller: brandController,
decoration:
new InputDecoration(labelText: "brand"),
),
TextFormField(
controller: modelController,
decoration: new InputDecoration(labelText: "model"),
),
TextFormField(
controller: ID_DeskController,
decoration: new InputDecoration(labelText: "ID_Desk"),
),
SizedBox(
height: 50,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RaisedButton(
onPressed: () {
_Update(
data.id,
ID_DeviceController.text,
inventoryController.text,
typeController.text,
priceController.text,
yearController.text,
brandController.text,
modelController.text,
ID_DeskController.text,
qualityController.text,
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Update Data Equipment.'), //Messenger Save Datas User.
),
);
},
color: Colors.green,
child: Text("UpDate",style: TextStyle(color: Colors.white),))
],
)
],
)),
),
),
]));
}
Future<void> _Update(
ObjectId id,
String ID_Device,
String inventory,
String type,
String price,
String year,
String brand,
String model,
String ID_Desk,
String quality,
) async {
final UpdateData = DeviceDbModel(
id: id,
ID_Device: ID_Device,
inventory: inventory,
type: type,
price: price,
year: year,
brand: brand,
model: model,
ID_Desk:ID_Desk,
quality: quality,
);
await DeviceDatabase.update(UpdateData);
}
}
/*
ID_Device
inventory numder
type
price
year of use
brand
model
ID_Desk
quality
*/
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Address/AddressDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
import 'package:mongo_dart/mongo_dart.dart';
class from_map extends StatelessWidget {
@override
Widget build(BuildContext context) {
AddressDbModel data =
ModalRoute.of(context)!.settings.arguments as AddressDbModel;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.yellow[800],
title: Text("${data.ID_desk}"),
),
body: ListView(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Center(
child: Column(
children: [
Text( " floor : ${data.floor} \n"),
Image.network(
"${data.picture_floor}",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
Text( " room : ${data.room} "),
Image.network(
"${data.Picture_room}",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
Text(" ID_desk : ${data.ID_desk} \n\n"
),
],
),
)),
),
),
]));
}
}
/*
ID_desk,
picture_floor,
Picture_room,
floor,
room,
*/
\ No newline at end of file
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
import 'package:mongo_dart/mongo_dart.dart';
class from_User extends StatelessWidget {
var ID_UserController = new TextEditingController();
var passwordController = new TextEditingController();
var firstNameController = new TextEditingController();
var lastNameController = new TextEditingController();
var ageController = new TextEditingController();
var PhoneController = new TextEditingController();
var imageController = new TextEditingController();
var SeatController = new TextEditingController();
@override
Widget build(BuildContext context) {
UserDbModel data =ModalRoute.of(context)!.settings.arguments as UserDbModel;
if (data != null) {
ID_UserController.text = data.ID_User;
passwordController.text = data.password;
firstNameController.text = data.firstName;
lastNameController.text = data.lastName;
ageController.text = data.age;
PhoneController.text = data.Phone;
imageController.text = data.image;
SeatController.text = data.seat;
}
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.yellow[800],
title: Text("${ data.firstName} ${data.lastName}"),
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Center(
child: Column(
children: [
ClipOval(
child: Image.network(
"${data.image}",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
),
SizedBox(
height: 50,
),
Text(
" ID : ${data.ID_User} \n\n"
" password : ${data.password} \n\n"
" Name : ${data.firstName} ${data.lastName} \n\n"
" Age: ${data.age} \n\n"
" Phone number : ${data.Phone}\n\n"
" Seat : ${data.seat}"),
],
),
)),
),
),
]));
}
}
/*
1 ID_User
2 password
3 firstName
4 lastName
5 age
6 position
7 Phone
8 image
9 seat
*/
\ No newline at end of file
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Address/Address.dart';
import 'package:flutter_application/MongoDB/Address/AddressDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
import 'package:mongo_dart/mongo_dart.dart';
class map_update extends StatelessWidget {
var ID_deskController = new TextEditingController();
var picture_floorController = new TextEditingController();
var Picture_roomController = new TextEditingController();
var floorController = new TextEditingController();
var roomController = new TextEditingController();
/*
ID_desk;
picture_floor;
Picture_room;
floor;
room;
*/
@override
Widget build(BuildContext context) {
AddressDbModel data =ModalRoute.of(context)!.settings.arguments as AddressDbModel;
if (data != null) {
ID_deskController.text = data.ID_desk;
picture_floorController.text = data.picture_floor;
Picture_roomController.text = data.Picture_room;
floorController.text = data.floor;
roomController.text = data.room;
}
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.green[700],
title: Text("Update Map"),
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
TextFormField(
controller: ID_deskController,
decoration: new InputDecoration(labelText: "ID_desk"),
),
TextFormField(
controller: picture_floorController,
decoration: new InputDecoration(labelText: "picture_floor"),
),
TextFormField(
controller: Picture_roomController,
decoration: new InputDecoration(labelText: "Picture_room"),
),
TextFormField(
controller: floorController,
decoration: new InputDecoration(labelText: "floor"),
),
TextFormField(
controller: roomController,
decoration: new InputDecoration(labelText: "room"),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RaisedButton(
onPressed: () {
_Update(
data.id,
ID_deskController.text,
picture_floorController.text,
Picture_roomController.text,
floorController.text,
roomController.text,
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Update Data MAP.'), //Messenger Save Datas User.
),
);
},
color: Colors.green,
child: Text("UpDate",style: TextStyle(color: Colors.white),))
],
)
],
)),
),
),
]));
}
Future<void> _Update(
ObjectId id,
String ID_desk,
String picture_floor,
String Picture_room,
String floor,
String room,
) async {
final UpdateData = AddressDbModel(
id: id,
ID_desk: ID_desk,
picture_floor: picture_floor,
Picture_room: Picture_room,
floor: floor,
room: room,
);
await AddressDatabase.update(UpdateData);
}
}
/*
ID_desk;
picture_floor;
Picture_room;
floor;
room;
*/
\ No newline at end of file
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
class sign_up extends StatelessWidget {
var ID_UserController = new TextEditingController();
var passwordController = new TextEditingController();
var firstNameController = new TextEditingController();
var lastNameController = new TextEditingController();
var ageController = new TextEditingController();
var PhoneController = new TextEditingController();
var imageController = new TextEditingController();
var SeatController = new TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.red,
title: Text("Apply for an account"),
),
body: Column(
children:[
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
TextFormField(
controller: ID_UserController,
decoration: new InputDecoration(labelText: "ID User"),
),
TextFormField(
controller: passwordController,
decoration: new InputDecoration(labelText: "Password"),
),
TextFormField(
controller: firstNameController,
decoration: new InputDecoration(labelText: "FirstName"),
),
TextFormField(
controller: lastNameController,
decoration: new InputDecoration(labelText: "lastName"),
),
TextFormField(
controller: ageController,
decoration: new InputDecoration(labelText: "age"),
),
TextFormField(
controller: PhoneController,
decoration: new InputDecoration(labelText: "Phone Nunber"),
),
TextFormField(
controller: imageController,
decoration: new InputDecoration(labelText: "image"),
),
TextFormField(
controller: SeatController,
decoration: new InputDecoration(labelText: "Seat code"),
),
SizedBox(
height: 50,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
onPressed: () {
_inesrDataUser(
ID_UserController.text,
passwordController.text,
firstNameController.text,
lastNameController.text,
ageController.text,
PhoneController.text,
imageController.text,
SeatController.text,
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Save Data User.'),//Messenger Save Data User.
),);},
color: Colors.green,
child: Text("Insert Data",style: TextStyle(color: Colors.white),))
],) ],)),),),] ));}
Future<void> _inesrDataUser(
String ID_User,
String password,
String firstName,
String lastName,
String age,
String Phone,
String image,
String seat,
) async {
var _id = M.ObjectId();
final data = UserDbModel(
id: _id,
ID_User:ID_User,
password :password,
firstName: firstName,
lastName: lastName,
age:age,
Phone:Phone,
image:image,
seat:seat,
);
var result = await UserDatabase.inesrt(data);
_clearALL();
}
void _clearALL() {
ID_UserController.text= "";
passwordController.text= "";
firstNameController.text= "";
lastNameController.text = "";
ageController.text= "";
PhoneController.text= "";
imageController.text= "";
SeatController.text= "";
}}
/*
1 ID_User
2 password
3 firstName
4 lastName
5 age
6 position
7 Phone
8 image
9 seat
*/
\ No newline at end of file
This diff is collapsed.
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/from_add/User_update.dart';
import 'package:flutter_application/user/user.dart';
class account extends StatefulWidget {
const account({Key? key , required this.data}) : super(key: key);
final Map <String ,dynamic > data;
@override
State<account> createState() => _accountState();
}
class _accountState extends State<account>{
@override
Widget build(BuildContext context) {
print(" user account :${widget.data}");
return Scaffold(
drawer: User(data: widget.data),
appBar: AppBar(
backgroundColor: Colors.orange[400],
title: Text("บัญชีผู้ใช้งาน"),
actions: [
// Text("${data.firstName} ${data.lastName}"),
],
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: FutureBuilder(
future:UserDatabase.getone("${widget.data['ID_User']}","${widget.data['password']}") ,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Row(
children: [
Expanded(
child: ListView.builder(
itemCount: snapshot.data.length ,
itemBuilder: (context, index) {
return
list_Users(UserDbModel.fromJson(
snapshot.data[index ]));
})),
],
);
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
)),
);
}
Widget list_Users(UserDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipOval(
child: Image.network(
"${data.image}",
height: 100.0,
width: 100.0,
fit: BoxFit.cover,
),
),
SizedBox(
height: 5,
),
Text(
" ID : ${data.ID_User} \n\n"
" password : ${data.password} \n\n"
" Name : ${data.firstName} ${data.lastName} \n\n"
" Age: ${data.age} \n\n"
" Phone number : ${data.Phone}\n\n"
" Seat : ${data.seat}"),
],
),
SizedBox(
height: 20,
),
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
//////////////////////////User Update////////////////////////////////
RaisedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return User_update();
},
settings: RouteSettings(arguments: data))
)
.then((value) {
setState(() {});
});
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Update Data User.'),//Messenger Save Data User.
),);},
color: Colors.green,
child: Text("Insert Data",style: TextStyle(color: Colors.white),))
]),
],
),
),
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Inform/informDB.dart';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/user/user.dart';
class record extends StatelessWidget {
const record({Key? key , required this.data}) : super(key: key);
final Map <String ,dynamic > data;
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: User(data:data),
appBar: AppBar(
backgroundColor: Colors.orange[400],
title: Text("รายการแแจ้งปัญหา ${data['firstName']} ${data['lastName']}"),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: [
FutureBuilder(
future: informDatabase.getstatus(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
} else {
if (snapshot.hasData) {
var totalData = snapshot.data.length;
print("Total Data " + totalData.toString());
return Expanded(
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
return
list_Users(informDbModel.fromJson(
snapshot.data[index]
)//ฟังก์ชันเรียกใช้ส่งข้อมูลที่นี่ การแปลงข้อมูล (แบบฟอร์ม Json) เป็นคลาสโมเดลของเรา
);
}));
} else {
return Center(
child: Text('No Data available.'),
);
}
}
}),
],
),
)
),
);
}
Widget list_Users(informDbModel data) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('ID เครื่อง : ${data.ID_Device} \n\n'
'ชื่อ : ${data.firstName} ${data.lastName}\n\n'
'อาการ : ${data.Proble}'
),
Row(
mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[
Text("${data.status}",
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
color: Colors.grey)
),IconButton(
onPressed: () {},
icon: Icon(Icons.restart_alt ,size: 30,),
color: Colors.blueGrey,
),
]
),
],
),
),
);
}
}
\ No newline at end of file
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/Inform/informDB.dart';
import 'package:flutter_application/MongoDB/Inform/informDBModel.dart';
import 'package:flutter_application/user/user.dart';
import 'package:mongo_dart/mongo_dart.dart' as M;
class report_problem extends StatefulWidget {
const report_problem({Key? key , required this.data}) : super(key: key);
final Map <String ,dynamic > data;
@override
State<report_problem> createState() => _report_problemState();
}
class _report_problemState extends State<report_problem> {
var ID_DeviceController = new TextEditingController();
var ProbleController = new TextEditingController();
var firstNameController = new TextEditingController();
var lastNameController = new TextEditingController();
var statusController = "In progress";
@override
Widget build(BuildContext context) {
return Scaffold(
//drawer: User(),
appBar: AppBar(
backgroundColor: Colors.orange[400],
title: Text("แจ้งปัญหา "),
),
body: Column(
children:[
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Column(
children: [
TextFormField(
controller: firstNameController,
decoration: new InputDecoration(labelText: "ชื่อ"),
),
TextFormField(
controller: lastNameController,
decoration: new InputDecoration(labelText: "นามสกุล"),
),
TextFormField(
controller: ID_DeviceController,
decoration: new InputDecoration(labelText: "ID เครื่อง"),
),
TextFormField(
controller: ProbleController,
decoration: new InputDecoration(labelText: "อาการ"),
),
SizedBox(
height: 50,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RaisedButton(
onPressed: () {
_inesrDataUser(
ID_DeviceController.text,
ProbleController.text,
firstNameController.text,
lastNameController.text,
statusController
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Report Data User.'),//Messenger Save Data User.
),
);
},
color: Colors.green,
child: Text("Report",style: TextStyle(color: Colors.white),))
],
)
],
)),
),
),
]
)
);
}
Future<void> _inesrDataUser(
String ID_Device,
String Proble,
String firstName,
String lastName,
String status,
) async {
var _id = M.ObjectId();
final data = informDbModel(
id: _id,
ID_Device:ID_Device,
Proble :Proble,
firstName: firstName,
lastName: lastName,
status:status,
);
var result = await informDatabase.insert(data);
_clearALL();
}
void _clearALL() {
ID_DeviceController.text= "";
ProbleController.text= "";
firstNameController.text= "";
lastNameController.text = "";
}
}
/*
1 ID_Device
2 Proble
3 firstName
4 lastName
5 status
*/
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/main.dart';
import 'package:flutter_application/user/account.dart';
import 'package:flutter_application/user/record.dart';
import 'package:flutter_application/user/report_problem.dart';
class User extends StatefulWidget {
const User({Key? key , required this.data}) : super(key: key);
final Map <String ,dynamic > data;
@override
State<User> createState() => _UserState();
}
class _UserState extends State<User>
{
@override
Widget build(BuildContext context) {
return Drawer(
child: Column(
children: <Widget>[
AppBar(
backgroundColor: Colors.orange[400],
automaticallyImplyLeading: false,
title: Text("MENU" ),
),
ListTile(
leading:
Icon(Icons.account_circle , size: 30, color: Colors.blueGrey),
title: Text("บัญชีผู้ใช้งาน"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new account(data:widget.data)),
);
}),
ListTile(
leading:
Icon(Icons.add_alert_outlined, size: 30, color: Colors.blueGrey),
title: Text("แจ้งปัญหา"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new report_problem(data:widget.data)),
);
}),
ListTile(
leading:
Icon(Icons.article_outlined, size: 30, color: Colors.blueGrey),
title: Text("รายการแจ้งปัญหา"),
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new record(data:widget.data,)),
);
}),
ListTile(
leading:
Icon(Icons.output, size: 30, color: Colors.blueGrey),
title: Text("ออกจากระบบ"),
onTap: ()
{
Navigator.push(context, MaterialPageRoute(builder: (context){
return MyApp();//หน้าฟอร์มลงทะเบียน
}));
}
)
],
),
);
}
}
\ No newline at end of file
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
basic_utils:
dependency: transitive
description:
name: basic_utils
url: "https://pub.dartlang.org"
source: hosted
version: "3.9.4"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
bson:
dependency: transitive
description:
name: bson
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
buffer:
dependency: transitive
description:
name: buffer
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
mongo_dart:
dependency: "direct main"
description:
name: mongo_dart
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.4+1"
mongo_dart_query:
dependency: transitive
description:
name: mongo_dart_query
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
pointycastle:
dependency: transitive
description:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.2"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
sasl_scram:
dependency: transitive
description:
name: sasl_scram
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
saslprep:
dependency: transitive
description:
name: saslprep
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
unorm_dart:
dependency: transitive
description:
name: unorm_dart
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
uuid:
dependency: transitive
description:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.6"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
vy_string_utils:
dependency: transitive
description:
name: vy_string_utils
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
sdks:
dart: ">=2.16.1 <3.0.0"
name: flutter_application
description: A new flutter module project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
#
# This version is used _only_ for the Runner app, which is used if you just do
# a `flutter run` or a `flutter make-host-app-editable`. It has no impact
# on any other native host app that you embed your Flutter project into.
version: 1.0.0+1
environment:
sdk: ">=2.16.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
mongo_dart: ^0.7.4+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add Flutter specific assets to your application, add an assets section,
# like this:
# assets:
# - images/room.pnp
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add Flutter specific custom fonts to your application, add a fonts
# section here, in this "flutter" section. Each entry in this list should
# have a "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# This section identifies your Flutter project as a module meant for
# embedding in a native host app. These identifiers should _not_ ordinarily
# be changed after generation - they are used to ensure that the tooling can
# maintain consistency when adding or modifying assets and plugins.
# They also do not have any bearing on your native host application's
# identifiers, which may be completely independent or the same as these.
module:
androidX: true
androidPackage: com.example.flutter_application
iosBundleIdentifier: com.example.flutterApplication
// ignore_for_file: deprecated_member_use
import 'package:flutter/material.dart';
import 'package:flutter_application/MongoDB/users/UserDB.dart';
import 'package:flutter_application/MongoDB/users/UserDBModel.dart';
import 'package:flutter_application/admin/map.dart';
import 'package:flutter_application/from_add/User_update.dart';
import 'package:flutter_application/user/user.dart';
class account extends StatefulWidget {
const account({Key? key , required this.data}) : super(key: key);
final Map <String ,dynamic > data;
@override
State<account> createState() => _accountState();
}
class _accountState extends State<account>{
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.yellow[800],
),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(30.0),
child: Center(
child: Column(
children: [
ClipOval(
child: Image.network(
"${widget.data['image']}",
height: 250.0,
width: 250.0,
fit: BoxFit.cover,
),
),
SizedBox(
height: 50,
),
Text(
" ID : ${widget.data['ID_User']} \n\n"
" password : ${widget.data['password']} \n\n"
" Name : ${widget.data['firstName']} ${widget.data['lastName']} \n\n"
" Age: ${widget.data['age']}\n\n"
" Phone number : ${widget.data['Phone']}\n\n"
" Seat : ${widget.data['seat']}"),
],
),
)),
),
),
]));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment