parent
4a25f07e8a
commit
e5c492da35
@ -0,0 +1,40 @@
|
||||
class GoodsOutModel {
|
||||
int id;
|
||||
String name;
|
||||
int weight;
|
||||
String expectedTime;
|
||||
int approach;
|
||||
int status;
|
||||
String movingCompanyTel;
|
||||
|
||||
GoodsOutModel(
|
||||
{this.id,
|
||||
this.name,
|
||||
this.weight,
|
||||
this.expectedTime,
|
||||
this.approach,
|
||||
this.status,
|
||||
this.movingCompanyTel});
|
||||
|
||||
GoodsOutModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
weight = json['weight'];
|
||||
expectedTime = json['expectedTime'];
|
||||
approach = json['approach'];
|
||||
status = json['status'];
|
||||
movingCompanyTel = json['movingCompanyTel'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['weight'] = this.weight;
|
||||
data['expectedTime'] = this.expectedTime;
|
||||
data['approach'] = this.approach;
|
||||
data['status'] = this.status;
|
||||
data['movingCompanyTel'] = this.movingCompanyTel;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class BeeDatePicker {
|
||||
static Future<DateTime> pick(DateTime initDate) async {
|
||||
return await Get.bottomSheet(_BeeDatePicker(date: initDate));
|
||||
}
|
||||
}
|
||||
|
||||
class _BeeDatePicker extends StatefulWidget {
|
||||
final DateTime date;
|
||||
_BeeDatePicker({Key key, @required this.date}) : super(key: key);
|
||||
|
||||
@override
|
||||
__BeeDatePickerState createState() => __BeeDatePickerState();
|
||||
}
|
||||
|
||||
class __BeeDatePickerState extends State<_BeeDatePicker> {
|
||||
DateTime _date = DateTime.now();
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_date = widget.date ?? DateTime.now();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(10)),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 48,
|
||||
child: NavigationToolbar(
|
||||
leading: TextButton(
|
||||
onPressed: Get.back,
|
||||
child: '取消'.text.black.make(),
|
||||
),
|
||||
trailing: TextButton(
|
||||
onPressed: () => Get.back(result: _date),
|
||||
child: '确定'.text.black.make(),
|
||||
),
|
||||
),
|
||||
),
|
||||
CupertinoDatePicker(
|
||||
initialDateTime: _date,
|
||||
onDateTimeChanged: (date) => _date = date,
|
||||
mode: CupertinoDatePickerMode.date,
|
||||
).expand(),
|
||||
],
|
||||
),
|
||||
),
|
||||
height: Get.height / 3,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue