add pickups

This commit is contained in:
Sai Naw Wun
2020-05-31 15:00:11 +06:30
parent d5847722d8
commit 3f6a66b887
57 changed files with 1368 additions and 1236 deletions

BIN
assets/amazon_ins.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -474,13 +474,14 @@
"user_edit.welcome":"Welcome to FCS", "user_edit.welcome":"Welcome to FCS",
"user_edit.name":"Please enter your name", "user_edit.name":"Please enter your name",
"user.phone":"My phone number", "user.phone":"MY PHONE NUMBER",
"user.fcs_id":"My FCS_ID", "user.fcs_id":"MY FCS_ID",
"user.shipping_address":"My USA shipping address", "user.shipping_address":"USA SHIPPING ADDRESS",
"user.deliveryAddress":"My delivery address", "user.deliveryAddress":"My delivery address",
"user.buying_instruction":"See below instructions to add shipping address", "user.buying_instruction":"See below instructions to add USA shipping address while shoping online",
"buy_online":"Buying online", "buy_online":"Buying online",
"buy_online.title":"BUYING ONLINE",
"buy.amazon":"Amazon", "buy.amazon":"Amazon",
"buy.newegg":"Newegg", "buy.newegg":"Newegg",
"buy.macy":"Macy", "buy.macy":"Macy",
@@ -495,7 +496,15 @@
"shipment.title":"Shipments", "shipment.title":"Shipments",
"shipment.add":"New shipment", "shipment.add":"New shipment",
"pickup.title": "Pickups", "pickup": "Pickups",
"pickup.title": "PICKUPS",
"pickup.new": "New Pickup", "pickup.new": "New Pickup",
"pickup.edit.title": "Pickup" "pickup.edit.title": "Pickup",
"rate":"Rates",
"rate.title":"RATES",
"rate.edit.title":"EDIT RATES",
"rate.cal.title":"CALCULATE RATES"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -1,177 +0,0 @@
import 'smile_painter.dart';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
import 'package:firebase_ml_vision/firebase_ml_vision.dart';
import 'package:flutter/foundation.dart';
import 'dart:ui' as ui show Image;
import 'utils.dart';
class FaceDetectionFromLiveCamera extends StatefulWidget {
FaceDetectionFromLiveCamera({Key key}) : super(key: key);
@override
_FaceDetectionFromLiveCameraState createState() =>
_FaceDetectionFromLiveCameraState();
}
class _FaceDetectionFromLiveCameraState
extends State<FaceDetectionFromLiveCamera> {
final FaceDetector faceDetector = FirebaseVision.instance.faceDetector();
List<Face> faces;
CameraController _camera;
bool _isDetecting = false;
CameraLensDirection _direction = CameraLensDirection.back;
@override
void initState() {
super.initState();
_initializeCamera();
}
void _initializeCamera() async {
CameraDescription description = await getCamera(_direction);
ImageRotation rotation = rotationIntToImageRotation(
description.sensorOrientation,
);
_camera = CameraController(
description,
defaultTargetPlatform == TargetPlatform.iOS
? ResolutionPreset.low
: ResolutionPreset.medium,
);
await _camera.initialize();
_camera.startImageStream((CameraImage image) {
if (_isDetecting) return;
_isDetecting = true;
detect(
image,
FirebaseVision.instance
.faceDetector(FaceDetectorOptions(
mode: FaceDetectorMode.accurate,
enableClassification: true))
.processImage,
rotation)
.then(
(dynamic result) {
setState(() {
faces = result;
});
_isDetecting = false;
},
).catchError(
(_) {
_isDetecting = false;
},
);
});
}
Widget _buildResults() {
const Text noResultsText = const Text('No results!');
const Text multipleFaceText = const Text('Multiple faces!');
const Text pleaseSmileText = const Text('Please smile!');
if (faces == null || _camera == null || !_camera.value.isInitialized) {
return noResultsText;
}
CustomPainter painter;
final Size imageSize = Size(
_camera.value.previewSize.height,
_camera.value.previewSize.width,
);
if (faces is! List<Face> ||
faces.isEmpty ||
faces == null ||
faces.length == 0) return noResultsText;
if (faces.length > 1) return multipleFaceText;
var face = faces[0];
if (face.smilingProbability == null || face.smilingProbability < 0.8) {
return pleaseSmileText;
}
painter = SmilePainterLiveCamera(imageSize, faces);
return CustomPaint(
painter: painter,
);
}
Widget _buildImage() {
return Container(
constraints: const BoxConstraints.expand(),
child: _camera == null
? const Center(
child: Text(
'Initializing Camera...',
style: TextStyle(
color: Colors.green,
fontSize: 30.0,
),
),
)
: Stack(
fit: StackFit.expand,
children: <Widget>[
CameraPreview(_camera),
_buildResults(),
Positioned(
bottom: 0.0,
left: 0.0,
right: 0.0,
child: Container(
color: Colors.white,
height: 50.0,
child: ListView(
children: faces
.map((face) => Text(
"${face.boundingBox.center.toString()}, Smile:${face.smilingProbability}"))
.toList(),
),
),
),
],
),
);
}
void _toggleCameraDirection() async {
if (_direction == CameraLensDirection.back) {
_direction = CameraLensDirection.front;
} else {
_direction = CameraLensDirection.back;
}
await _camera.stopImageStream();
await _camera.dispose();
setState(() {
_camera = null;
});
_initializeCamera();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Face Detection with Smile"),
),
body: _buildImage(),
floatingActionButton: FloatingActionButton(
onPressed: _toggleCameraDirection,
child: _direction == CameraLensDirection.back
? const Icon(Icons.camera_front)
: const Icon(Icons.camera_rear),
),
);
}
}

View File

@@ -1,59 +0,0 @@
import 'package:flutter/material.dart';
import 'dart:io';
import 'smile_painter.dart';
import 'package:firebase_ml_vision/firebase_ml_vision.dart';
import 'dart:ui' as ui show Image;
import 'package:image_picker/image_picker.dart';
class FaceDetectionFromImage extends StatefulWidget {
@override
_FaceDetectionFromImageState createState() => _FaceDetectionFromImageState();
}
class _FaceDetectionFromImageState extends State<FaceDetectionFromImage> {
bool loading = true;
ui.Image image;
List<Face> faces;
final FaceDetector faceDetector = FirebaseVision.instance.faceDetector();
Future<ui.Image> _loadImage(File file) async {
final data = await file.readAsBytes();
return await decodeImageFromList(data);
}
void pickAndProcessImage() async {
final File file = await ImagePicker.pickImage(source: ImageSource.gallery);
final FirebaseVisionImage visionImage = FirebaseVisionImage.fromFile(file);
faces = await faceDetector.processImage(visionImage);
image = await _loadImage(file);
setState(() {
loading = false;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Face detection with Smile'),
),
body: Center(
child: loading
? Text('Press The floating Action Button for load image!')
: FittedBox(
child: SizedBox(
width: image.width.toDouble(),
height: image.height.toDouble(),
child: FacePaint(
painter: SmilePainter(image, faces),
),
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: pickAndProcessImage,
child: Icon(Icons.image),
),
);
}
}

View File

@@ -1,40 +0,0 @@
import 'face_detection_camera.dart';
import 'face_detection_image.dart';
import 'package:flutter/material.dart';
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Smile To Face App'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: Text('Add Smile to Face from Image'),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => FaceDetectionFromImage(),
),
);
}),
RaisedButton(
child: Text('Add Smile to Face from Live Camera'),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => FaceDetectionFromLiveCamera(),
),
);
}),
],
),
),
);
}
}

View File

@@ -1,17 +0,0 @@
import 'package:flutter/material.dart';
import 'home.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomeScreen(),
);
}
}

View File

@@ -1,138 +0,0 @@
import 'dart:ui' as ui show Image;
import 'dart:math' as Math;
import 'package:firebase_ml_vision/firebase_ml_vision.dart';
import 'package:flutter/material.dart';
class FacePaint extends CustomPaint {
final CustomPainter painter;
FacePaint({this.painter}) : super(painter: painter);
}
class SmilePainter extends CustomPainter {
final ui.Image image;
final List<Face> faces;
SmilePainter(this.image, this.faces);
@override
void paint(Canvas canvas, Size size) {
if (image != null) {
canvas.drawImage(image, Offset.zero, Paint());
}
final paintRectStyle = Paint()
..color = Colors.red
..strokeWidth = 30.0
..style = PaintingStyle.stroke;
//Draw Body
final paint = Paint()..color = Colors.yellow;
for (var i = 0; i < faces.length; i++) {
final radius =
Math.min(faces[i].boundingBox.width, faces[i].boundingBox.height) / 2;
final center = faces[i].boundingBox.center;
final smilePaint = Paint()
..style = PaintingStyle.stroke
..strokeWidth = radius / 8;
canvas.drawRect(faces[i].boundingBox, paintRectStyle);
canvas.drawCircle(center, radius, paint);
canvas.drawArc(
Rect.fromCircle(
center: center.translate(0, radius / 8), radius: radius / 2),
0,
Math.pi,
false,
smilePaint);
//Draw the eyes
canvas.drawCircle(Offset(center.dx - radius / 2, center.dy - radius / 2),
radius / 8, Paint());
canvas.drawCircle(Offset(center.dx + radius / 2, center.dy - radius / 2),
radius / 8, Paint());
}
}
@override
bool shouldRepaint(SmilePainter oldDelegate) {
return image != oldDelegate.image || faces != oldDelegate.faces;
}
}
class SmilePainterLiveCamera extends CustomPainter {
final Size imageSize;
final List<Face> faces;
SmilePainterLiveCamera(this.imageSize, this.faces);
@override
void paint(Canvas canvas, Size size) {
// final paintRectStyle = Paint()
// ..color = Colors.red
// ..strokeWidth = 10.0
// ..style = PaintingStyle.stroke;
final paint = Paint()..color = Colors.yellow;
for (var i = 0; i < faces.length; i++) {
//Scale rect to image size
final rect = _scaleRect(
rect: faces[i].boundingBox,
imageSize: imageSize,
widgetSize: size,
);
//Radius for smile circle
final radius = Math.min(rect.width, rect.height) / 2;
//Center of face rect
final Offset center = rect.center;
final smilePaint = Paint()
..style = PaintingStyle.stroke
..strokeWidth = radius / 8;
//Draw rect border
//canvas.drawRect(rect, paintRectStyle);
//Draw body
canvas.drawCircle(center, radius, paint);
//Draw mouth
canvas.drawArc(
Rect.fromCircle(
center: center.translate(0, radius / 8), radius: radius / 2),
0,
Math.pi,
false,
smilePaint);
//Draw the eyes
canvas.drawCircle(Offset(center.dx - radius / 2, center.dy - radius / 2),
radius / 8, Paint());
canvas.drawCircle(Offset(center.dx + radius / 2, center.dy - radius / 2),
radius / 8, Paint());
}
}
@override
bool shouldRepaint(SmilePainterLiveCamera oldDelegate) {
return imageSize != oldDelegate.imageSize || faces != oldDelegate.faces;
}
}
Rect _scaleRect({
@required Rect rect,
@required Size imageSize,
@required Size widgetSize,
}) {
final double scaleX = widgetSize.width / imageSize.width;
final double scaleY = widgetSize.height / imageSize.height;
return Rect.fromLTRB(
rect.left.toDouble() * scaleX,
rect.top.toDouble() * scaleY,
rect.right.toDouble() * scaleX,
rect.bottom.toDouble() * scaleY,
);
}

View File

@@ -1,69 +0,0 @@
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui';
import 'package:camera/camera.dart';
import 'package:firebase_ml_vision/firebase_ml_vision.dart';
import 'package:flutter/foundation.dart';
typedef HandleDetection = Future<List<Face>> Function(FirebaseVisionImage image);
Future<CameraDescription> getCamera(CameraLensDirection dir) async {
return await availableCameras().then(
(List<CameraDescription> cameras) => cameras.firstWhere(
(CameraDescription camera) => camera.lensDirection == dir,
),
);
}
Uint8List concatenatePlanes(List<Plane> planes) {
final WriteBuffer allBytes = WriteBuffer();
planes.forEach((Plane plane) => allBytes.putUint8List(plane.bytes));
return allBytes.done().buffer.asUint8List();
}
FirebaseVisionImageMetadata buildMetaData(
CameraImage image,
ImageRotation rotation,
) {
return FirebaseVisionImageMetadata(
rawFormat: image.format.raw,
size: Size(image.width.toDouble(), image.height.toDouble()),
rotation: rotation,
planeData: image.planes.map(
(Plane plane) {
return FirebaseVisionImagePlaneMetadata(
bytesPerRow: plane.bytesPerRow,
height: plane.height,
width: plane.width,
);
},
).toList(),
);
}
Future<List<Face>> detect(
CameraImage image,
HandleDetection handleDetection,
ImageRotation rotation,
) async {
return handleDetection(
FirebaseVisionImage.fromBytes(
concatenatePlanes(image.planes),
buildMetaData(image, rotation),
),
);
}
ImageRotation rotationIntToImageRotation(int rotation) {
switch (rotation) {
case 0:
return ImageRotation.rotation0;
case 90:
return ImageRotation.rotation90;
case 180:
return ImageRotation.rotation180;
default:
assert(rotation == 270);
return ImageRotation.rotation270;
}
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:fcs/config.dart'; import 'package:fcs/config.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'app.dart'; import 'app.dart';

View File

@@ -1,9 +1,9 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:fcs/model/api_helper.dart'; import 'package:fcs/model/api_helper.dart';
import 'package:fcs/model/main_model.dart';
import '../vo/setting.dart'; import '../vo/setting.dart';
import '../vo/user.dart'; import '../vo/user.dart';
import 'main_model.dart';
abstract class BaseModel extends ChangeNotifier { abstract class BaseModel extends ChangeNotifier {
User user; User user;

View File

@@ -10,7 +10,6 @@ import 'package:fcs/vo/revenue.dart';
import 'base_model.dart'; import 'base_model.dart';
import 'constants.dart'; import 'constants.dart';
import 'firebase_helper.dart';
class ChartModel extends BaseModel { class ChartModel extends BaseModel {
final log = Logger('ChartModel'); final log = Logger('ChartModel');

View File

@@ -51,7 +51,7 @@ class MainModel extends ChangeNotifier {
phoneNumber: '+95 9 444444444', phoneNumber: '+95 9 444444444',
fcsID: 'FCS-0203-390-2', fcsID: 'FCS-0203-390-2',
shippingAddress: shippingAddress:
'154-19 64th Ave.Flushing, NY 11367 TEL. +1 (929) 215-2247', '154-19 64th Ave.Flushing, \nNY 11367 \nTEL. +1 (929) 215-2247',
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon'); deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
Setting setting; Setting setting;
@@ -70,6 +70,23 @@ class MainModel extends ChangeNotifier {
// this.isOnline = _isOnline; // this.isOnline = _isOnline;
// notifyListeners(); // notifyListeners();
// }); // });
_loadFcs();
}
_loadFcs() async {
user = await SharedPref.getUser();
notifyListeners();
}
saveUser(String pin, String phone) {
if (pin == "000000") {
user = User(name: "Owner", phoneNumber: phone);
SharedPref.saveUser(user);
} else {
user = User(name: "Customer", phoneNumber: phone);
SharedPref.saveUser(user);
}
notifyListeners();
} }
resetPinTimer() { resetPinTimer() {
@@ -83,7 +100,7 @@ class MainModel extends ChangeNotifier {
} }
bool isLogin() { bool isLogin() {
return true; return this.user != null;
} }
bool hasEmail() { bool hasEmail() {
@@ -138,7 +155,6 @@ class MainModel extends ChangeNotifier {
void addModel(BaseModel model) { void addModel(BaseModel model) {
models.add(model); models.add(model);
model.mainModel = this;
} }
void _initUser(User user) { void _initUser(User user) {
@@ -292,6 +308,10 @@ class MainModel extends ChangeNotifier {
} }
Future<void> logout() async { Future<void> logout() async {
this.user = null;
notifyListeners();
return;
if (this.userListener != null) { if (this.userListener != null) {
await this.userListener.cancel(); await this.userListener.cancel();
} }

View File

@@ -11,25 +11,26 @@ class NotificationModel extends BaseModel {
int filer = 0; int filer = 0;
List<Notification> notifications = [ List<Notification> notifications = [
Notification( Notification(
desc: 'A102A-34-#23', desc: 'Package delivered!',
status: 'delivered', status: 'A102A-34-#23',
time: DateTime(2020, 4, 28, 10, 32)), time: DateTime(2020, 4, 28, 10, 32)),
Notification( Notification(
desc: 'A102A-34-#24', desc: 'Package in transit!',
status: 'picked up', status: 'A102A-34-#24',
time: DateTime(2020, 4, 26, 9, 32)), time: DateTime(2020, 4, 26, 9, 32)),
Notification( Notification(
desc: 'A102A-34-#23', desc: 'Package delivered!',
status: 'sorted', status: 'A102A-34-#23',
time: DateTime(2020, 4, 24, 10, 32)), time: DateTime(2020, 4, 24, 10, 32)),
Notification( Notification(
desc: 'ORDER # 114-0725982-9074639', marketPlace: "Macy",
status: 'audited', desc: "Audited received goods!",
status: 'ORDER # 114-0725982-9074639',
time: DateTime(2020, 4, 22, 12, 30)), time: DateTime(2020, 4, 22, 12, 30)),
Notification( Notification(
marketPlace: "Amazon", marketPlace: "Amazon",
desc: 'ORDER # 114-0725982-9074639', desc: "Receive goods!",
status: 'received', status: 'ORDER # 323-982-2308',
time: DateTime(2020, 4, 22, 12, 22)) time: DateTime(2020, 4, 22, 12, 22))
]; ];

View File

@@ -14,7 +14,8 @@ class PickUpModel extends BaseModel {
var profile = FCSProfile( var profile = FCSProfile(
id: '1', id: '1',
usaAddress: '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247', usaAddress:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247',
mmAddress: 'FCS Trading Myanmar\nRoom 333, Yangon', mmAddress: 'FCS Trading Myanmar\nRoom 333, Yangon',
usaContactNumber: '1 (929) 215-2247', usaContactNumber: '1 (929) 215-2247',
mmContactNumber: '+95 9 700224723', mmContactNumber: '+95 9 700224723',
@@ -30,7 +31,8 @@ class PickUpModel extends BaseModel {
toTime: '3PM', toTime: '3PM',
numberOfPackage: 5, numberOfPackage: 5,
weight: 25, weight: 25,
status: 'pickup', status: 'Pending',
date: DateTime(2020, 5, 1),
address: address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'), '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp( PickUp(
@@ -41,7 +43,8 @@ class PickUpModel extends BaseModel {
toTime: '3PM', toTime: '3PM',
numberOfPackage: 5, numberOfPackage: 5,
weight: 25, weight: 25,
status: 'pickup', status: 'Assigned',
date: DateTime(2020, 5, 6),
address: address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'), '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp( PickUp(
@@ -52,11 +55,100 @@ class PickUpModel extends BaseModel {
toTime: '3PM', toTime: '3PM',
numberOfPackage: 5, numberOfPackage: 5,
weight: 25, weight: 25,
status: "delivered", status: "Pickuped",
date: DateTime(2020, 5, 9),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200412 - 12 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: 'Pickuped',
date: DateTime(2020, 5, 15),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200125 - 12 May 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: 'Pickuped',
date: DateTime(2020, 5, 20),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200441 - 13 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "Pickuped",
date: DateTime(2020, 5, 21),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200441 - 10 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "Canceled",
date: DateTime(2020, 5, 25),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200441 - 6 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "Canceled",
date: DateTime(2020, 5, 27),
address: address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'), '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
]; ];
List<PickUp> get canceled {
List<PickUp> _p = pickups.where((e) => e.status == "Canceled").toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
return _p;
}
List<PickUp> get completed {
return pickups.where((e) => e.status == "Pickuped").toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
}
List<PickUp> get upcoming {
return pickups
.where((e) =>
e.status == "Pending" ||
e.status == "Assigned" ||
e.status == "Processed" ||
e.status == "Rescheduled")
.toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
}
void initUser(user) { void initUser(user) {
super.initUser(user); super.initUser(user);
} }

View File

@@ -11,7 +11,6 @@ import 'package:fcs/vo/po.dart';
import 'package:fcs/vo/popup_menu.dart'; import 'package:fcs/vo/popup_menu.dart';
import 'base_model.dart'; import 'base_model.dart';
import 'constants.dart';
import 'firebase_helper.dart'; import 'firebase_helper.dart';
class POSubmissionModel extends BaseModel { class POSubmissionModel extends BaseModel {

View File

@@ -60,13 +60,21 @@ class SharedPref {
} }
static _read(String key) async { static _read(String key) async {
try {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
return json.decode(prefs.getString(key)); return json.decode(prefs.getString(key));
} catch (e) {
print("Error:$e");
}
} }
static _save(String key, value) async { static _save(String key, value) async {
try {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
prefs.setString(key, json.encode(value)); prefs.setString(key, json.encode(value));
} catch (e) {
print("Error:$e");
}
} }
static _remove(String key) async { static _remove(String key) async {

View File

@@ -22,6 +22,8 @@ class ShipmentRateModel extends BaseModel {
price: 8), price: 8),
]; ];
int freeDeliveryWeight=10;
void initUser(user) { void initUser(user) {
super.initUser(user); super.initUser(user);
} }

View File

@@ -1,3 +1,5 @@
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/manual.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:fcs/model/main_model.dart'; import 'package:fcs/model/main_model.dart';
@@ -7,6 +9,7 @@ import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart'; import '../theme/theme.dart';
import '../widget/label_widgets.dart'; import '../widget/label_widgets.dart';
import '../widget/local_text.dart'; import '../widget/local_text.dart';
import 'instruction.dart';
import 'manual/manual_page.dart'; import 'manual/manual_page.dart';
class BuyingOnlinePage extends StatefulWidget { class BuyingOnlinePage extends StatefulWidget {
@@ -36,7 +39,7 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
"user.deliveryAddress")); "user.deliveryAddress"));
final instructionBox = Container( final instructionBox = Container(
padding: EdgeInsets.only(top: 30), padding: EdgeInsets.only(left: 10, top: 30, bottom: 10),
child: Center( child: Center(
child: Wrap( child: Wrap(
children: <Widget>[ children: <Widget>[
@@ -58,7 +61,8 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor, color: primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))), // borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme( child: ButtonTheme(
minWidth: 900.0, minWidth: 900.0,
height: 100.0, height: 100.0,
@@ -67,8 +71,9 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ManualPage( builder: (context) => InstructionPage(
marketplace: 'Amazon', name: 'Amazon',
image: "assets/amazon_ins.png",
))); )));
}, },
child: LocalText( child: LocalText(
@@ -90,7 +95,8 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor, color: primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))), // borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme( child: ButtonTheme(
minWidth: 900.0, minWidth: 900.0,
height: 100.0, height: 100.0,
@@ -122,7 +128,8 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: primaryColor, color: primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))), // borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme( child: ButtonTheme(
minWidth: 900.0, minWidth: 900.0,
height: 100.0, height: 100.0,
@@ -151,9 +158,14 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
title: LocalText( title: LocalText(
context, context,
"buy_online", "buy_online.title",
fontSize: 20, fontSize: 20,
color: Colors.white, color: Colors.white,
), ),
@@ -163,36 +175,42 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.only(top: 10, left: 10, right: 10),
children: <Widget>[ children: <Widget>[
Center( nameWidget(mainModel.customer.name),
child: Text( phoneWidget(context, mainModel.customer.phoneNumber),
mainModel.customer.name, Row(
style: TextStyle(
color: secondaryColor,
fontSize: 16,
fontWeight: FontWeight.bold),
)),
Container(
padding: EdgeInsets.only(top: 15),
child: Row(
children: <Widget>[ children: <Widget>[
Padding( SizedBox(
padding: const EdgeInsets.only(right: 8.0), width: 25,
child: phoneBox, height: 25,
), child: FittedBox(
InkWell( child: Image.asset("assets/logo.jpg"),
onTap: () {}, fit: BoxFit.fill,
child: Icon(
Icons.open_in_new,
color: Colors.grey,
size: 15,
),
),
],
), ),
), ),
fcsIdBox, fcsIdBox,
Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
),
)
],
),
Row(
children: <Widget>[
Icon(Icons.location_on),
shippingAddressBox, shippingAddressBox,
deliveryAddressBox, Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
),
)
],
),
// deliveryAddressBox,
instructionBox, instructionBox,
amazonbutton, amazonbutton,
neweggbutton, neweggbutton,

View File

@@ -1,5 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/shared_pref.dart';
import 'package:fcs/vo/user.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart'; import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@@ -182,10 +185,12 @@ class _CodePageState extends State<CodePage> {
_resend() async {} _resend() async {}
_verify() async { _verify() async {
Navigator.push( Provider.of<MainModel>(context).saveUser(pin,widget.phoneNumber);
await Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => UserEditPage()), MaterialPageRoute(builder: (context) => UserEditPage()),
); );
Navigator.pop(context);
} }
_completeResend() { _completeResend() {

View File

@@ -1,4 +1,7 @@
import 'package:fcs/model/main_model.dart';
import 'package:fcs/widget/bottom_up_page_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@@ -68,6 +71,8 @@ typedef BtnCallback();
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
final log = Logger('_HomePageState'); final log = Logger('_HomePageState');
bool login = false;
bool customer = true;
@override @override
void initState() { void initState() {
@@ -91,6 +96,7 @@ class _HomePageState extends State<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
login=Provider.of<MainModel>(context).isLogin();
final helpBtn = _buildBtn2("manual.title", final helpBtn = _buildBtn2("manual.title",
icon: FontAwesomeIcons.readme, icon: FontAwesomeIcons.readme,
imgIcon: Image.asset( imgIcon: Image.asset(
@@ -100,7 +106,7 @@ class _HomePageState extends State<HomePage> {
color: primaryColor, color: primaryColor,
), ),
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ManualPage())) .push(BottomUpPageRoute(ManualPage()))
// btnCallback: () => Navigator.of(context) // btnCallback: () => Navigator.of(context)
// .push(MaterialPageRoute(builder: (_) => TestList())) // .push(MaterialPageRoute(builder: (_) => TestList()))
); );
@@ -130,15 +136,15 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ReportList()))); .push(MaterialPageRoute(builder: (_) => ReportList())));
final pickUpBtn = _buildBtn2("pickup.title", final pickUpBtn = _buildBtn2("pickup",
icon: FontAwesomeIcons.directions, icon: MaterialCommunityIcons.directions,
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => PickUpList()))); .push(BottomUpPageRoute(PickUpList())));
final shipmentCostBtn = _buildBtn2("pickup.title", final shipmentCostBtn = _buildBtn2("rate",
icon: FontAwesomeIcons.ship, icon: FontAwesomeIcons.calculator,
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ShipmentRates()))); .push(BottomUpPageRoute(ShipmentRates())));
final fcsProfileBtn = _buildBtn2("profile.title", final fcsProfileBtn = _buildBtn2("profile.title",
icon: Icons.account_circle, icon: Icons.account_circle,
@@ -173,7 +179,8 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => DOList()))); .push(MaterialPageRoute(builder: (_) => DOList())));
final shipmentBtn = _buildBtn("shipment.title", final shipmentBtn = _buildBtn2("shipment.title",
icon: Ionicons.ios_airplane,
imgIcon: Image.asset( imgIcon: Image.asset(
"assets/truck.png", "assets/truck.png",
width: 50, width: 50,
@@ -203,7 +210,6 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => PDList()))); .push(MaterialPageRoute(builder: (_) => PDList())));
final termBtn = _buildBtn2("term.title", final termBtn = _buildBtn2("term.title",
icon: FontAwesomeIcons.fileContract, icon: FontAwesomeIcons.fileContract,
imgIcon: Image.asset( imgIcon: Image.asset(
@@ -223,16 +229,13 @@ class _HomePageState extends State<HomePage> {
); );
}); });
final signinBtn = _buildBtn2("login",
icon: FontAwesomeIcons.signInAlt,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => SigninPage())));
final buyingBtn = final buyingBtn = _buildBtn2("buy_online",
_buildBtn2("buy_online", icon: Icons.person, btnCallback: () { icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => BuyingOnlinePage()), BottomUpPageRoute(BuyingOnlinePage())
// MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
); );
}); });
@@ -240,21 +243,15 @@ class _HomePageState extends State<HomePage> {
btnCallback: () { btnCallback: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => NotificationList()), BottomUpPageRoute(NotificationList()),
); );
}); });
final staffBtn = _buildBtn("staff.title", final staffBtn = _buildBtn2("staff.title",
imgIcon: Image.asset( icon: SimpleLineIcons.people,
"assets/employee.png",
width: 40,
height: 40,
color: primaryColor,
),
btnCallback: () => Navigator.of(context) btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => StaffList()))); .push(MaterialPageRoute(builder: (_) => StaffList())));
final _bankAccountsBtn = _buildBtn2("banks.title", final _bankAccountsBtn = _buildBtn2("banks.title",
icon: FontAwesomeIcons.moneyCheck, btnCallback: () { icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
Navigator.push( Navigator.push(
@@ -263,15 +260,14 @@ class _HomePageState extends State<HomePage> {
); );
}); });
List<Widget> widgets = [helpBtn]; List<Widget> widgets = [];
widgets.add(signinBtn);
widgets.add(buyingBtn); widgets.add(buyingBtn);
widgets.add(pickUpBtn);
widgets.add(shipmentBtn); widgets.add(shipmentBtn);
widgets.add(notiBtn); widgets.add(notiBtn);
widgets.add(staffBtn); widgets.add(staffBtn);
// widgets.add(_bankAccountsBtn); // widgets.add(_bankAccountsBtn);
widgets.add(announcementBtn); widgets.add(announcementBtn);
widgets.add(pickUpBtn);
widgets.add(fcsProfileBtn); widgets.add(fcsProfileBtn);
widgets.add(shipmentCostBtn); widgets.add(shipmentCostBtn);
widgets.add(reportBtn); widgets.add(reportBtn);
@@ -391,12 +387,14 @@ class _HomePageState extends State<HomePage> {
child: Image.asset("assets/logo.jpg", height: 40), child: Image.asset("assets/logo.jpg", height: 40),
borderRadius: new BorderRadius.circular(35.0), borderRadius: new BorderRadius.circular(35.0),
), ),
actions: <Widget>[ actions: login
? <Widget>[
IconButton( IconButton(
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Contact()), MaterialPageRoute(
builder: (context) => Contact()),
); );
}, },
iconSize: 30, iconSize: 30,
@@ -406,12 +404,26 @@ class _HomePageState extends State<HomePage> {
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Profile()), MaterialPageRoute(
builder: (context) => Profile()),
); );
}, },
iconSize: 30, iconSize: 30,
icon: Icon(Icons.tune), icon: Icon(Icons.tune),
), ),
]
: [
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SigninPage()),
);
},
// iconSize: 30,
child: Text("Sign in",style: siginButtonStyle,),
),
]), ]),
body: Container( body: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -450,12 +462,26 @@ class _HomePageState extends State<HomePage> {
// stops: const <double>[0.0, 0.25, 0.5, 0.75, 1.0], // stops: const <double>[0.0, 0.25, 0.5, 0.75, 1.0],
// ), // ),
), ),
child: Column(
children: <Widget>[
Expanded(
child: ListView(children: [ child: ListView(children: [
Wrap( Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: widgets, children: widgets,
), ),
]) ]),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_buildSmallButton(
"Policies", FontAwesomeIcons.fileContract),
_buildSmallButton("Support", SimpleLineIcons.support),
],
)
],
)
// child: StaggeredGridView.count( // child: StaggeredGridView.count(
// crossAxisCount: 3, // crossAxisCount: 3,
// crossAxisSpacing: 12.0, // crossAxisSpacing: 12.0,
@@ -580,20 +606,19 @@ class _HomePageState extends State<HomePage> {
child: InkWell( child: InkWell(
splashColor: primaryColor, // inkwell color splashColor: primaryColor, // inkwell color
child: SizedBox( child: SizedBox(
width: 60, height: 60, child:Icon(icon,color: Colors.white, size: 30) width: 60,
), height: 60,
child: Icon(icon, color: Colors.white, size: 30)),
onTap: btnCallback, onTap: btnCallback,
), ),
), ),
), ),
FittedBox( FittedBox(
fit:BoxFit.fitWidth, fit: BoxFit.fitWidth,
child: Text(AppTranslations.of(context).text(title), child: Text(AppTranslations.of(context).text(title),
style: style: languageModel.isEng
languageModel.isEng ? TextStyle(
?
TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.0, fontSize: 14.0,
@@ -602,11 +627,40 @@ class _HomePageState extends State<HomePage> {
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12.0, fontSize: 12.0,
fontFamily: "MyanmarUnicode") fontFamily: "MyanmarUnicode")),
),
), ),
]), ]),
), ),
); );
} }
Widget _buildSmallButton(String text, IconData iconData) {
return InkWell(
onTap: () => {},
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Row(
children: <Widget>[
IconButton(
icon: Icon(iconData, color: Colors.white70),
color: Colors.white70,
onPressed: null),
// RaisedButton(onPressed: ()=>{},child: Row(
// children: <Widget>[
// IconButton(
// icon: Icon(iconData, ),
// onPressed: null),
// Text(text),
// ],
// ),color: Colors.transparent,
// focusColor: Colors.transparent,),
Text(
text,
style: subMenuStyle,
)
],
),
),
);
}
} }

View File

@@ -0,0 +1,61 @@
import 'package:fcs/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/manual_model.dart';
import 'package:fcs/pages/manual/manual_item_title_dialog.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/manual.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/progress.dart';
class InstructionPage extends StatefulWidget {
final String image;
final String name;
const InstructionPage({Key key, this.image, this.name}) : super(key: key);
@override
_InstructionPageState createState() => _InstructionPageState();
}
class _InstructionPageState extends State<InstructionPage> {
TextEditingController _manualVersionController = TextEditingController();
final double dotSize = 10.0;
List<ManualItem> helpList = new List();
bool isEng;
String versionName;
bool _isLoading = false;
@override
void initState() {
helpList.clear();
var manualModel = Provider.of<ManualModel>(context, listen: false);
var mainModel = Provider.of<MainModel>(context, listen: false);
versionName = manualModel.version;
helpList = manualModel.getHelpList(mainModel.isBuyer());
super.initState();
}
@override
Widget build(BuildContext context) {
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: secondaryColor),
onPressed: () => Navigator.of(context).pop(),
),
title: Text(widget.name),
backgroundColor: primaryColor,
),
body: Container(
child: FittedBox(
child: Image.asset(widget.image), fit: BoxFit.contain),
),
),
);
}
}

View File

@@ -49,6 +49,10 @@ class _ManualPageState extends State<ManualPage> {
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
leading: new IconButton(
icon: new Icon(Icons.close, color: secondaryColor),
onPressed: () => Navigator.of(context).pop(),
),
title: Text(widget.marketplace == null ? '' : widget.marketplace), title: Text(widget.marketplace == null ? '' : widget.marketplace),
backgroundColor: primaryColor, backgroundColor: primaryColor,
), ),

View File

@@ -31,6 +31,11 @@ class _NotificationListState extends State<NotificationList> {
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, ),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: LocalText( title: LocalText(
context, context,
@@ -38,68 +43,6 @@ class _NotificationListState extends State<NotificationList> {
fontSize: 18, fontSize: 18,
color: Colors.white, color: Colors.white,
), ),
// actions: <Widget>[
// PopupMenuButton<PopupMenu>(
// elevation: 3.2,
// onSelected: (selected) {
// setState(() {
// this._selectedIndex = selected.index;
// });
// notificationModel.filter(selected.index);
// },
// icon: Container(
// width: 30,
// height: 30,
// decoration: new BoxDecoration(
// shape: BoxShape.circle,
// color: Colors.white,
// ),
// child: Stack(
// fit: StackFit.expand,
// children: <Widget>[
// Icon(
// Icons.filter_list,
// color: primaryColor,
// ),
// _selectedIndex != 0
// ? Positioned(
// bottom: 0,
// right: 0,
// child: Container(
// width: 10,
// height: 10,
// decoration: new BoxDecoration(
// shape: BoxShape.circle,
// color: secondaryColor,
// ),
// ),
// )
// : Container()
// ],
// )),
// itemBuilder: (BuildContext context) {
// return notificationMenu.map((PopupMenu choice) {
// return PopupMenuItem<PopupMenu>(
// value: choice,
// child: Row(
// children: <Widget>[
// Text(choice.status),
// SizedBox(
// width: 10,
// ),
// _selectedIndex != null &&
// _selectedIndex == choice.index
// ? Icon(
// Icons.check,
// color: Colors.grey,
// )
// : Container(),
// ],
// ),
// );
// }).toList();
// }),
// ],
), ),
body: new ListView.separated( body: new ListView.separated(
separatorBuilder: (context, index) => Divider( separatorBuilder: (context, index) => Divider(
@@ -133,25 +76,31 @@ class _NotificationListState extends State<NotificationList> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
noti.marketPlace == null
? Container()
: new Text(
noti.marketPlace,
style: new TextStyle(
fontSize: 15.0,
color: secondaryColor),
),
new Text( new Text(
noti.getDesc, noti.getDesc,
style: new TextStyle( style: new TextStyle(
fontSize: 15.0, fontSize: 15.0,
color: secondaryColor), color: primaryColor),
), ),
new Text( noti.marketPlace == null
? Container()
: Padding(
padding: const EdgeInsets.only(top:8.0),
child: new Text(
noti.marketPlace,
style: new TextStyle(
fontSize: 15.0,
color: primaryColor),
),
),
Padding(
padding: const EdgeInsets.only(top:8.0),
child: new Text(
noti.status == null ? "" : noti.status, noti.status == null ? "" : noti.status,
style: new TextStyle( style: new TextStyle(
fontSize: 13.0, fontSize: 16.0,
color: secondaryColor), color: Colors.grey),
),
), ),
], ],
), ),
@@ -175,31 +124,6 @@ class _NotificationListState extends State<NotificationList> {
], ],
), ),
), ),
// noti.seen
// ? Container()
// : new Positioned(
// left: 11,
// top: 11,
// child: new Container(
// padding: EdgeInsets.all(2),
// decoration: new BoxDecoration(
// color: Colors.red,
// borderRadius: BorderRadius.circular(6),
// ),
// constraints: BoxConstraints(
// minWidth: 18,
// minHeight: 18,
// ),
// child: Text(
// 'new',
// style: TextStyle(
// color: Colors.white,
// fontSize: 14,
// ),
// textAlign: TextAlign.center,
// ),
// ),
// )
], ],
); );
}), }),

View File

@@ -1,5 +1,9 @@
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/pickup_model.dart'; import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/pickup.dart'; import 'package:fcs/vo/pickup.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart'; import 'package:fcs/widget/localization/app_translations.dart';
@@ -56,6 +60,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
controller: _addressEditingController, controller: _addressEditingController,
cursorColor: primaryColor, cursorColor: primaryColor,
style: textStyle, style: textStyle,
minLines: 2,
decoration: new InputDecoration( decoration: new InputDecoration(
labelText: 'Pickup Address', labelText: 'Pickup Address',
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
@@ -139,10 +144,17 @@ class _PickUpEditorState extends State<PickUpEditor> {
]), ]),
); );
MainModel mainModel = Provider.of<MainModel>(context);
return LocalProgress( return LocalProgress(
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pickup.edit.title")), title: Text(AppTranslations.of(context).text("pickup.edit.title")),
), ),
@@ -153,23 +165,54 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
Text( Center(child: nameWidget(mainModel.customer.name)),
"U Aung Zaw", phoneWidget(context, mainModel.customer.phoneNumber),
style: TextStyle(fontSize: 15.0), Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(Icons.location_on),
), ),
Text( Expanded(child: pickUpAddress),
"+82054857695", ],
style: TextStyle(fontSize: 15.0), ),
SizedBox(height: 25),
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(Icons.timer),
),
Text('Pickup Time',
style: TextStyle(color: Colors.grey, fontSize: 18)),
],
),
SizedBox(height: 5),
Padding(
padding: const EdgeInsets.only(left: 33),
child: pickupTime,
), ),
pickUpAddress,
SizedBox(height: 15), SizedBox(height: 15),
Text('Pickup Time'), Row(
SizedBox(height: 15), children: <Widget>[
pickupTime, Padding(
SizedBox(height: 15), padding: const EdgeInsets.only(right: 8.0),
noOfPackageBox, child: Icon(Octicons.package),
SizedBox(height: 15), ),
weightBox Expanded(child: noOfPackageBox),
],
),
SizedBox(
height: 15,
),
fcsInput("Total Weight (lb)", FontAwesomeIcons.weightHanging),
SizedBox(
height: 15,
),
widget.pickUp != null
? fcsDropDown("Assigned", MaterialCommunityIcons.worker)
: Container(),
fcsInput("Remark", MaterialCommunityIcons.note)
]), ]),
)), )),
widget.pickUp == null widget.pickUp == null
@@ -179,9 +222,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
shape: new RoundedRectangleBorder( child: Text('Request for pickup'),
borderRadius: new BorderRadius.circular(10)),
child: Text('Request'),
color: primaryColor, color: primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
@@ -198,10 +239,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
shape: new RoundedRectangleBorder( child: Text('Update'),
borderRadius:
new BorderRadius.circular(10)),
child: Text('Pickuped'),
color: primaryColor, color: primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
@@ -215,11 +253,8 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
shape: new RoundedRectangleBorder( child: Text('Cancel Pickup'),
borderRadius: color: Colors.grey[600],
new BorderRadius.circular(10)),
child: Text('Cancel'),
color: Colors.blue,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);

View File

@@ -38,12 +38,17 @@ class _PickUpListState extends State<PickUpList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var pickupModel = Provider.of<PickUpModel>(context);
return LocalProgress( return LocalProgress(
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: DefaultTabController(
length: 3,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pickup.title")), title: Text(AppTranslations.of(context).text("pickup.title")),
actions: <Widget>[ actions: <Widget>[
@@ -55,116 +60,105 @@ class _PickUpListState extends State<PickUpList> {
iconSize: 30, iconSize: 30,
onPressed: () => showPlacesSearch(context), onPressed: () => showPlacesSearch(context),
), ),
PopupMenuButton<PopupMenu>(
elevation: 3.2,
onSelected: (selected) {},
icon: Container(
width: 30,
height: 30,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
Icon(
Icons.sort,
color: primaryColor,
),
], ],
)), bottom: TabBar(
itemBuilder: (BuildContext context) { unselectedLabelColor: Colors.grey,
return userMenu.map((PopupMenu choice) { tabs: [
return PopupMenuItem<PopupMenu>( Tab(
value: choice, text: "Upcoming",
child: Container(
padding: EdgeInsets.only(left: 8),
child: Row(
children: <Widget>[
Text(choice.status),
SizedBox(
width: 10,
), ),
Tab(text: "Completed"),
Tab(text: "Canceled"),
], ],
), ),
), ),
); floatingActionButton: FloatingActionButton.extended(
}).toList();
}),
PopupMenuButton<PopupMenu>(
elevation: 3.2,
onSelected: (selected) {
String status;
},
icon: Container(
width: 30,
height: 30,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
Icon(
Icons.filter_list,
color: primaryColor,
),
],
)),
itemBuilder: (BuildContext context) {
return buyerStatusMenu.map((PopupMenu choice) {
return PopupMenuItem<PopupMenu>(
value: choice,
child: Row(
children: <Widget>[
Text(choice.status),
SizedBox(
width: 10,
),
],
),
);
}).toList();
}),
],
),
body: Column(
children: <Widget>[
Expanded(
child: new ListView.builder(
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.pickups.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.pickups[index]);
}),
),
Align(
alignment: Alignment.bottomCenter,
child: Center(
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(10)),
child: Text(AppTranslations.of(context).text("pickup.new")),
color: primaryColor,
textColor: Colors.white,
onPressed: () { onPressed: () {
Navigator.push( _newPickup();
context,
MaterialPageRoute(
builder: (context) => new PickUpEditor()),
);
}, },
icon: Icon(Icons.add),
label: Text(AppTranslations.of(context).text("pickup.new")),
backgroundColor: primaryColor,
), ),
))) body: TabBarView(
children: [
//Icon(Icons.directions_car),
_upComing(),
_completed(),
_canceled()
], ],
), )),
), ),
); );
} }
_newPickup() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => new PickUpEditor()),
);
}
Widget _upComing() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.upcoming.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.upcoming[index]);
}),
),
],
);
}
Widget _completed() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.completed.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.completed[index]);
}),
),
],
);
}
Widget _canceled() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.canceled.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.canceled[index]);
}),
),
],
);
}
} }

View File

@@ -41,9 +41,6 @@ class _PickupListRowState extends State<PickupListRow> {
print('_pickup $_pickUp'); print('_pickup $_pickUp');
return Container( return Container(
padding: EdgeInsets.only(left: 15, right: 15), padding: EdgeInsets.only(left: 15, right: 15),
child: Card(
elevation: 10,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@@ -72,46 +69,52 @@ class _PickupListRowState extends State<PickupListRow> {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0), padding: const EdgeInsets.only(left: 10.0, top: 10),
child: new Text(
_pickUp.id == null ? '' : "Last ${_pickUp.last} days" ,
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(_pickUp.status),
),
Padding(
padding: const EdgeInsets.only(left: 8.0,top:5,bottom: 5),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
new Text( new Text(
_pickUp.weight == null _pickUp.weight == null
? '' ? ''
: _pickUp.weight.toString() + 'lb - ', : _pickUp.weight.toString() + 'lb - ',
style: new TextStyle( style:
fontSize: 15.0, color: Colors.grey), new TextStyle(fontSize: 15.0, color: Colors.grey),
), ),
new Text( new Text(
_pickUp.numberOfPackage == null _pickUp.numberOfPackage == null
? "" ? ""
: _pickUp.numberOfPackage.toString() + : _pickUp.numberOfPackage.toString() + ' packages',
' packages', style:
style: new TextStyle( new TextStyle(fontSize: 15.0, color: Colors.grey),
fontSize: 15.0, color: Colors.grey),
), ),
], ],
), ),
), ),
], ],
),
),
],
),
),
),
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: getStatus(_pickUp.status),
),
],
) )
], ],
), ),
), ),
),
); );
} }
} }

View File

@@ -223,6 +223,8 @@ class _ProfileState extends State<Profile> {
_isLoading = true; _isLoading = true;
}); });
await mainModel.logout(); await mainModel.logout();
Navigator.pop(context);
// Navigator.of(context) // Navigator.of(context)
// .pushNamedAndRemoveUntil("/", ModalRoute.withName('/')); // .pushNamedAndRemoveUntil("/", ModalRoute.withName('/'));
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {

View File

@@ -1,5 +1,7 @@
import 'package:fcs/model/pickup_model.dart'; import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart'; import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/pages/shipment_rates_calculate.dart';
import 'package:fcs/pages/shipment_rates_edit.dart';
import 'package:fcs/vo/pickup.dart'; import 'package:fcs/vo/pickup.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart'; import 'package:fcs/widget/localization/app_translations.dart';
@@ -8,6 +10,7 @@ import 'package:flutter/material.dart';
import 'package:fcs/widget/progress.dart'; import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart'; import '../theme/theme.dart';
import 'util.dart';
class ShipmentRates extends StatefulWidget { class ShipmentRates extends StatefulWidget {
final PickUp pickUp; final PickUp pickUp;
@@ -28,6 +31,14 @@ class _ShipmentRatesState extends State<ShipmentRates> {
PickUp _pickUp; PickUp _pickUp;
bool _isLoading = false; bool _isLoading = false;
List<String> texts = [
"Minimum shipping weight is 1lbs.",
"Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.",
"Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.",
"Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.",
"Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.",
"Payments made in Myanmar will incur 2% tranfer fee"
];
@override @override
void initState() { void initState() {
@@ -51,6 +62,13 @@ class _ShipmentRatesState extends State<ShipmentRates> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var shipmentRateModel = Provider.of<ShipmentRateModel>(context); var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
var textList = texts
.map(
(e) => TextSpan(
text: "\n * " + e + "\n",
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)),
)
.toList();
final usaAddress = Container( final usaAddress = Container(
child: TextFormField( child: TextFormField(
maxLines: null, maxLines: null,
@@ -66,240 +84,91 @@ class _ShipmentRatesState extends State<ShipmentRates> {
), ),
)); ));
final mmAddress = Container(
height: 50.0,
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Yangon, Myanmar Office'),
),
Expanded(
child: TextFormField(
controller: _noOfPackageEditingController,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[300], width: 2),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: primaryColor, width: 2.0),
),
),
)),
]),
);
final contactNumber = Container(
height: 50.0,
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('USA contact number'),
),
Expanded(
child: TextFormField(
controller: _weightEditingController,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[300], width: 2),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: primaryColor, width: 2.0),
),
),
)),
]),
);
final mmContactNumber = Container(
height: 50.0,
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Myanmar contact number'),
),
Expanded(
child: TextFormField(
controller: _weightEditingController,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[300], width: 2),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: primaryColor, width: 2.0),
),
),
)),
]),
);
final mailBox = Container(
height: 50.0,
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Email Address'),
),
Expanded(
child: TextFormField(
controller: _weightEditingController,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[300], width: 2),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: primaryColor, width: 2.0),
),
),
)),
]),
);
final fbLinkBox = Container(
height: 50.0,
child: Row(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Facebook Link'),
),
Expanded(
child: TextFormField(
controller: _weightEditingController,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey[300], width: 2),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: primaryColor, width: 2.0),
),
),
)),
]),
);
return LocalProgress( return LocalProgress(
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pickup.edit.title")), title: Text(AppTranslations.of(context).text("rate.title")),
), ),
body: Card( body: Padding(
child: Column( padding: const EdgeInsets.all(8.0),
mainAxisAlignment: MainAxisAlignment.start, child: ListView(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
SizedBox(
height: 250,
// child: Image.asset(
// 'assets/logo.jpg',
// ),
),
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Text('Rates',
style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Text('Most affortable rate',
style: TextStyle(fontSize: 14.0)),
),
Container( Container(
height: 100, height: 135,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: ListView.builder( child: ListView.builder(
itemCount: shipmentRateModel.rates.length, itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return _row(
child: Row( shipmentRateModel.rates[index].description,
children: <Widget>[ "\$ " +shipmentRateModel.rates[index].price.toString(),
Text( 'per pound');
'${shipmentRateModel.rates[index].description} - '), }),
Text(
'\$${shipmentRateModel.rates[index].price} per lb',
style: TextStyle(color: Colors.blueAccent),
)
],
));
})),
), ),
widget.pickUp == null _row("Free delivery within Yangon \nfor shipments over","10","pounds"),
? Align( _row("Delivery fees","\$ 5","below 10 pounds"),
alignment: Alignment.bottomCenter, Padding(
child: Center( padding: const EdgeInsets.only(left: 18.0, right: 18),
child: Container( child: RichText(
width: 250, // overflow: TextOverflow.fade,
child: FlatButton( text: TextSpan(
shape: new RoundedRectangleBorder( style: TextStyle(color: primaryColor),
borderRadius: new BorderRadius.circular(10)), children: textList,
child: Text('Calculate my packages'),
color: primaryColor,
textColor: Colors.white,
onPressed: () {
Navigator.pop(context);
},
), ),
)))
: Container(
child: Column(
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Center(
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10)),
child: Text('Pickuped'),
color: primaryColor,
textColor: Colors.white,
onPressed: () {
Navigator.pop(context);
},
), ),
))),
Align(
alignment: Alignment.bottomCenter,
child: Center(
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10)),
child: Text('Cancel'),
color: primaryColor,
textColor: Colors.white,
onPressed: () {
Navigator.pop(context);
},
), ),
))) fcsButton(context, "Calculate", callack: () {
], Navigator.of(context)
)) .push(MaterialPageRoute(builder: (_) => ShipmentRatesCal()));
}),
fcsButton(context, "Edit", callack: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ShipmentRatesEdit()));
}),
SizedBox(height:10)
], ],
), ),
), ),
), ),
); );
} }
_row(String desc, String price, String unit) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
],
),
SizedBox(
width: 50,
),
],
));
}
} }

View File

@@ -0,0 +1,127 @@
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/pages/shipment_rates_calculate.dart';
import 'package:fcs/pages/shipment_rates_edit.dart';
import 'package:fcs/vo/pickup.dart';
import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:flutter/material.dart';
import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart';
import 'util.dart';
class ShipmentRatesCal extends StatefulWidget {
final PickUp pickUp;
ShipmentRatesCal({this.pickUp});
@override
_ShipmentRatesCalState createState() => _ShipmentRatesCalState();
}
class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
TextEditingController _addressEditingController = new TextEditingController();
TextEditingController _fromTimeEditingController =
new TextEditingController();
TextEditingController _toTimeEditingController = new TextEditingController();
TextEditingController _noOfPackageEditingController =
new TextEditingController();
TextEditingController _weightEditingController = new TextEditingController();
PickUp _pickUp;
bool _isLoading = false;
@override
void initState() {
super.initState();
if (widget.pickUp != null) {
_pickUp = widget.pickUp;
_addressEditingController.text = _pickUp.address;
_fromTimeEditingController.text = _pickUp.fromTime;
_toTimeEditingController.text = _pickUp.toTime;
_noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
_weightEditingController.text = _pickUp.weight.toString();
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("rate.title")),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 185,
child: ListView.builder(
itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) {
return _row(
shipmentRateModel.rates[index].description +
"\n\$ " +
shipmentRateModel.rates[index].price.toString() +
" per pound",
'',
"",input: true);
}),
),
SizedBox(height: 50),
Center(child: Text("Delivery fee:\$ 5",style: TextStyle(color:primaryColor,fontSize:16),)),
SizedBox(height: 20),
Center(child: Text("Total estimated amount:\$ 38",style: TextStyle(color:primaryColor,fontSize:20),))
],
),
),
),
);
}
_row(String desc, String price, String unit,{bool input}) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
// TextFormField(),
],
),
SizedBox(
width: 50,
),
Container(
width: 70,
child: TextField(textAlign: TextAlign.end,)),
],
));
}
}

View File

@@ -0,0 +1,154 @@
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/vo/pickup.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:flutter/material.dart';
import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart';
import 'util.dart';
class ShipmentRatesEdit extends StatefulWidget {
final PickUp pickUp;
ShipmentRatesEdit({this.pickUp});
@override
_ShipmentRatesEditState createState() => _ShipmentRatesEditState();
}
class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
TextEditingController _addressEditingController = new TextEditingController();
TextEditingController _fromTimeEditingController =
new TextEditingController();
TextEditingController _toTimeEditingController = new TextEditingController();
TextEditingController _noOfPackageEditingController =
new TextEditingController();
TextEditingController _weightEditingController = new TextEditingController();
PickUp _pickUp;
bool _isLoading = false;
List<String> texts = [
"Minimum shipping weight is 1lbs.",
"Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.",
"Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.",
"Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.",
"Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.",
"Payments made in Myanmar will incur 2% tranfer fee"
];
@override
void initState() {
super.initState();
if (widget.pickUp != null) {
_pickUp = widget.pickUp;
_addressEditingController.text = _pickUp.address;
_fromTimeEditingController.text = _pickUp.fromTime;
_toTimeEditingController.text = _pickUp.toTime;
_noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
_weightEditingController.text = _pickUp.weight.toString();
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
var textList = texts
.map(
(e) => TextSpan(
text: "\n * " + e + "\n",
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)),
)
.toList();
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("rate.edit.title")),
),
body: Container(
padding: EdgeInsets.all(18),
child: ListView(
children: <Widget>[
Container(
height: 145,
child: ListView.builder(
itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) {
return fcsInput(
shipmentRateModel.rates[index].description,
Icons.attach_money,
value:
shipmentRateModel.rates[index].price.toString());
}),
),
fcsInput("Min Weight for Free delivery within Yangon",
FontAwesomeIcons.weightHanging,
value: "10"),
fcsInput("Delivery fees", Icons.attach_money, value: "5"),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8),
child: RichText(
// overflow: TextOverflow.fade,
text: TextSpan(
style: TextStyle(color: primaryColor),
children: textList,
),
),
),
fcsButton(context, "Save", callack: () {}),
SizedBox(height: 10)
],
),
),
),
);
}
_row(String desc, String price, String unit) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
],
),
SizedBox(
width: 50,
),
],
));
}
}

View File

@@ -162,10 +162,11 @@ class _SigninPageState extends State<SigninPage> {
: phoneNumber; : phoneNumber;
phoneNumber = dialCode + phoneNumber; phoneNumber = dialCode + phoneNumber;
Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => CodePage(phoneNumber: phoneNumber))); builder: (context) => CodePage(phoneNumber: phoneNumber)));
Navigator.pop(context);
if (exp != null) throw exp; if (exp != null) throw exp;
} catch (e) { } catch (e) {

View File

@@ -1,16 +1,12 @@
import 'dart:async'; import 'dart:async';
import 'dart:io' show Platform;
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:google_api_availability/google_api_availability.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/main_model.dart'; import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/shared_pref.dart';
import 'package:fcs/theme/theme.dart'; import 'package:fcs/theme/theme.dart';
import 'package:fcs/widget/local_text.dart'; import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/localization/app_translations.dart'; import 'package:fcs/widget/localization/app_translations.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
class SplashScreen extends StatefulWidget { class SplashScreen extends StatefulWidget {
@override @override
@@ -30,7 +26,7 @@ class _SplashScreenState extends State<SplashScreen> {
Timer timer; Timer timer;
startTime() async { startTime() async {
var _duration = new Duration(milliseconds: 500); var _duration = new Duration(milliseconds: 1000);
this.timer = new Timer.periodic(_duration, navigationPage); this.timer = new Timer.periodic(_duration, navigationPage);
} }
@@ -92,7 +88,7 @@ class _SplashScreenState extends State<SplashScreen> {
MainModel mainModel = Provider.of<MainModel>(context); MainModel mainModel = Provider.of<MainModel>(context);
this._loaded = mainModel.isLoaded; this._loaded = mainModel.isLoaded;
this._isSupport = mainModel.isSupport(); this._isSupport = true;
this._isLogin = mainModel.isLogin(); this._isLogin = mainModel.isLogin();
this._isAgree = mainModel.agreedTerm(); this._isAgree = mainModel.agreedTerm();
this._hasEmail = mainModel.hasEmail(); this._hasEmail = mainModel.hasEmail();
@@ -105,13 +101,25 @@ class _SplashScreenState extends State<SplashScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Image.asset( new Image.asset(
"assets/logo.png", "assets/logo.jpg",
width: 180, width: 180,
), ),
SizedBox(height: 50), SizedBox(height: 50),
CircularProgressIndicator( Column(
valueColor: new AlwaysStoppedAnimation<Color>(primaryColor), children: <Widget>[
Text(
"Cargo Services",
style: welcomeLabelStyle,
), ),
Text(
"by FCS Trading",
style: welcomeSubLabelStyle,
),
],
),
// CircularProgressIndicator(
// valueColor: new AlwaysStoppedAnimation<Color>(primaryColor),
// ),
SizedBox(height: 30), SizedBox(height: 30),
_isOnline _isOnline
? Container() ? Container()

View File

@@ -1,3 +1,4 @@
import 'package:fcs/model/shared_pref.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -108,5 +109,7 @@ class _UserEditPageState extends State<UserEditPage> {
); );
} }
_submit() async {} _submit() async {
Navigator.pop(context);
}
} }

View File

@@ -1,3 +1,4 @@
import 'package:fcs/widget/label_widgets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
@@ -234,15 +235,59 @@ Widget getStatus(String status) {
status, status,
style: TextStyle(color: Colors.white, fontSize: 12), style: TextStyle(color: Colors.white, fontSize: 12),
)) ))
: status == "pickup" : status == "Pickuped"
? Text( ? Text(
status, status,
style: TextStyle(color: Colors.red, fontSize: 12), style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
) )
: status == "delivered" : status == "Pending" || status == "Rescheduled"
? Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.schedule),
),
Text(
status,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
],
)
: status == "Assigned"
? Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.check),
),
Text(
status,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
],
)
: status == "Canceled"
? Text( ? Text(
status, status,
style: TextStyle(color: Colors.green, fontSize: 12), style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
: status == "Delivered"
? Text(
status,
style: TextStyle(
color: Colors.green, fontSize: 12),
) )
: Chip( : Chip(
avatar: Icon( avatar: Icon(
@@ -325,3 +370,131 @@ Future<void> displayNotiContent(
showMsgDialog(context, "Error", "Notification item not found!"); showMsgDialog(context, "Error", "Notification item not found!");
} finally {} } finally {}
} }
Widget nameWidget(String name) {
return Center(
child: Padding(
padding: const EdgeInsets.only(left: 10.0, top: 8),
child: Text(
name,
style: TextStyle(
color: Colors.black87, fontSize: 18, fontWeight: FontWeight.bold),
),
),
);
}
Widget phoneWidget(BuildContext context, String phone) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Row(
children: <Widget>[
Icon(Icons.phone),
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: labeledText(context, phone, "user.phone"),
),
],
),
);
}
Widget fcsInput(String label, IconData iconData,
{TextEditingController controller,String value}) {
return Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(iconData),
),
Expanded(
child: Container(
height: 50.0,
child: Row(children: <Widget>[
Expanded(
child: TextFormField(
initialValue: value,
controller: controller,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: new InputDecoration(
contentPadding: EdgeInsets.only(top: 8),
labelText: label,
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
),
)),
]),
)),
],
);
}
Widget fcsDropDown(String label, IconData iconData,
{TextEditingController controller}) {
return Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(iconData),
),
Expanded(
child: Container(
height: 50.0,
child: Row(children: <Widget>[
Expanded(child: _dropDown()),
]),
)),
],
);
}
Widget _dropDown() {
return DropdownButton<String>(
value: "Ko Nge",
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
// style: TextStyle(color: Colors.deepPurple),
underline: Container(
height: 2,
color: primaryColor,
),
onChanged: (String newValue) {},
items: <String>['Ko Nge', 'Two', 'Free', 'Four']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
);
}
Widget fcsButton(BuildContext context, String text,{Function callack}) {
return Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Container(
height: 45.0,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.rectangle,
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
child: FlatButton(
onPressed: callack,
child: Text(text,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
)),
),
),
),
);
}

View File

@@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart';
const primaryColor = const Color(0xff272262); const primaryColor = const Color(0xff272262);
const secondaryColor = const Color(0xffff4400); const secondaryColor = const Color(0xffff4400);
const thirdColor = const Color(0xFF0700f1); const thirdColor = const Color(0xf0ff4444);
const nextColor = const Color(0xFFfa833d); const nextColor = const Color(0xFFfa833d);
const buttonColor = const Color(0xFFFFFFFF); const buttonColor = const Color(0xFFFFFFFF);
const buttonBkColor = const Color(0xFF268944); const buttonBkColor = const Color(0xFF268944);
@@ -12,6 +12,16 @@ const labelColor = const Color(0xFF757575);
const TextStyle labelStyle = const TextStyle labelStyle =
TextStyle(fontSize: 13, color: Colors.grey, fontWeight: FontWeight.w500); TextStyle(fontSize: 13, color: Colors.grey, fontWeight: FontWeight.w500);
const TextStyle welcomeLabelStyle =
TextStyle(fontSize: 23, color: primaryColor, fontWeight: FontWeight.w500);
const TextStyle welcomeSubLabelStyle =
TextStyle(fontSize: 18, color: primaryColor, fontWeight: FontWeight.w500);
const TextStyle subMenuStyle =
TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w500);
const TextStyle siginButtonStyle =
TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w800);
const TextStyle labelStyleMM = TextStyle( const TextStyle labelStyleMM = TextStyle(
fontSize: 13, fontSize: 13,
color: Colors.grey, color: Colors.grey,
@@ -48,7 +58,7 @@ const TextStyle photoLabelStyle =
const TextStyle photoLabelStyleMM = TextStyle( const TextStyle photoLabelStyleMM = TextStyle(
color: Colors.black, fontSize: 13.0, fontFamily: "MyanmarUnicode"); color: Colors.black, fontSize: 13.0, fontFamily: "MyanmarUnicode");
const TextStyle textStyle = const TextStyle textStyle =
TextStyle(fontSize: 15, color: Colors.black87, fontWeight: FontWeight.w500); TextStyle(fontSize: 18, color: Colors.black87, fontWeight: FontWeight.w500);
const TextStyle textStyleOdd = TextStyle( const TextStyle textStyleOdd = TextStyle(
fontSize: 15, color: Colors.blueAccent, fontWeight: FontWeight.w500); fontSize: 15, color: Colors.blueAccent, fontWeight: FontWeight.w500);
const TextStyle textStrikeStyle = TextStyle( const TextStyle textStrikeStyle = TextStyle(

View File

@@ -8,6 +8,7 @@ class PickUp {
int weight; int weight;
String address; String address;
String status; String status;
DateTime date;
PickUp( PickUp(
{this.id, {this.id,
@@ -18,7 +19,10 @@ class PickUp {
this.numberOfPackage, this.numberOfPackage,
this.weight, this.weight,
this.address, this.address,
this.status}); this.status,
this.date});
int get last => DateTime.now().difference(date).inDays;
factory PickUp.fromMap(Map<String, dynamic> map, String id) { factory PickUp.fromMap(Map<String, dynamic> map, String id) {
return PickUp( return PickUp(

View File

@@ -0,0 +1,23 @@
import 'package:flutter/cupertino.dart';
class BottomUpPageRoute extends PageRouteBuilder {
final Widget child;
BottomUpPageRoute(this.child)
: super(
pageBuilder: (context, animation, secondaryAnimation) => child,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
var begin = Offset(0.0, 1.0);
var end = Offset.zero;
var curve = Curves.ease;
var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
);
}

View File

@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:fcs/theme/theme.dart'; import 'package:fcs/theme/theme.dart';
@@ -11,14 +13,20 @@ Widget labeledText(BuildContext context, String text, String label,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
LocalText( Padding(
padding: const EdgeInsets.only(top:8.0),
child: LocalText(
context, context,
label, label,
fontSize: 15, fontSize: 16,
color:primaryColor,
fontWeight: FontWeight.bold,
), ),
),
// number ? Spacer() : Container(), // number ? Spacer() : Container(),
Container( Container(
// padding: EdgeInsets.only(left: 10), padding: EdgeInsets.only(top: 10),
// alignment: number ? Alignment.topRight : null, // alignment: number ? Alignment.topRight : null,
child: Text( child: Text(
text == null ? "" : text, text == null ? "" : text,

View File

@@ -1,3 +1,4 @@
import 'package:fcs/model/product_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@@ -5,7 +6,6 @@ import 'package:progress/progress.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:fcs/charts/lines.dart'; import 'package:fcs/charts/lines.dart';
import 'package:fcs/model/main_model.dart'; import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/pages/po/po_submission_form.dart'; import 'package:fcs/pages/po/po_submission_form.dart';
import 'package:fcs/theme/theme.dart'; import 'package:fcs/theme/theme.dart';
import 'package:fcs/vo/product.dart'; import 'package:fcs/vo/product.dart';

View File

@@ -1,9 +1,9 @@
import 'package:fcs/model/product_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:fcs/model/language_model.dart'; import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/theme/theme.dart'; import 'package:fcs/theme/theme.dart';
import 'package:fcs/vo/product.dart'; import 'package:fcs/vo/product.dart';
import 'package:fcs/widget/local_text.dart'; import 'package:fcs/widget/local_text.dart';

View File

@@ -119,7 +119,7 @@ packages:
name: country_code_picker name: country_code_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.14" version: "1.3.15"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@@ -218,13 +218,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.16" version: "6.0.16"
firebase_ml_vision:
dependency: "direct main"
description:
name: firebase_ml_vision
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0+2"
firebase_storage: firebase_storage:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -258,6 +251,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.4" version: "1.4.4"
flutter_icons:
dependency: "direct main"
description:
name: flutter_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
flutter_launcher_icons: flutter_launcher_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -617,7 +617,28 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.3" version: "0.5.7+3"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+9"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+7"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

View File

@@ -22,7 +22,7 @@ dependencies:
flutter_launcher_icons: "^0.7.2" flutter_launcher_icons: "^0.7.2"
qr_flutter: ^2.1.0+55 qr_flutter: ^2.1.0+55
image_picker: ^0.6.0+9 image_picker: ^0.6.0+9
shared_preferences: ^0.4.3 shared_preferences: ^0.5.7+3
http_parser: ^3.1.3 http_parser: ^3.1.3
progress: progress:
path: path:
@@ -47,7 +47,6 @@ dependencies:
http_server: ^0.9.8+3 http_server: ^0.9.8+3
archive: ^2.0.11 archive: ^2.0.11
http: ^0.12.0+4 http: ^0.12.0+4
firebase_ml_vision: ^0.6.0+2
camera: ^0.4.2 camera: ^0.4.2
faker: ^1.2.0 faker: ^1.2.0
url_launcher: ^5.4.1 url_launcher: ^5.4.1
@@ -65,6 +64,7 @@ dependencies:
permission_handler: ^4.0.0 permission_handler: ^4.0.0
country_code_picker: ^1.3.12 country_code_picker: ^1.3.12
pin_input_text_field: pin_input_text_field:
flutter_icons: ^1.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: