时间日期选择器
This commit is contained in:
BIN
assets/images/compass_rotated.png
Normal file
BIN
assets/images/compass_rotated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 987 KiB |
@ -19,11 +19,11 @@ class MyPainter extends CustomPainter {
|
|||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
// 创建画笔
|
// 创建画笔
|
||||||
final Paint paintLine = Paint()
|
final Paint paintLine = Paint()
|
||||||
..color = Colors.grey
|
..color = Colors.white
|
||||||
..strokeWidth = 2;
|
..strokeWidth = 2;
|
||||||
// 绘制线
|
// 绘制线
|
||||||
canvas.drawLine(Offset(-400, 0), Offset(400, 0), paintLine);
|
canvas.drawLine(const Offset(-400, 0), const Offset(400, 0), paintLine);
|
||||||
canvas.drawLine(Offset(0, 500), Offset(0, -440), paintLine);
|
canvas.drawLine(const Offset(0, 500), const Offset(0, -440), paintLine);
|
||||||
// 创建画笔
|
// 创建画笔
|
||||||
// final Paint paintPoint = Paint()..color = Colors.red;
|
// final Paint paintPoint = Paint()..color = Colors.red;
|
||||||
// 绘制圆点
|
// 绘制圆点
|
||||||
|
@ -12,7 +12,6 @@ class RegionSelector extends StatelessWidget {
|
|||||||
if (pname == '') return '未选择城市';
|
if (pname == '') return '未选择城市';
|
||||||
StringBuffer sb = StringBuffer();
|
StringBuffer sb = StringBuffer();
|
||||||
sb.write(pname);
|
sb.write(pname);
|
||||||
// if (cname == '') return sb.toString();
|
|
||||||
if (cname == '') return '未选择城市';
|
if (cname == '') return '未选择城市';
|
||||||
sb.write(' - ');
|
sb.write(' - ');
|
||||||
sb.write(cname);
|
sb.write(cname);
|
||||||
@ -31,8 +30,8 @@ class RegionSelector extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Pickers.showAddressPicker(context,
|
Pickers.showAddressPicker(context,
|
||||||
addAllItem: false,
|
addAllItem: false,
|
||||||
initProvince: regionProvider.provinceName,
|
initProvince: regionProvider.tempProvinceName,
|
||||||
initCity: regionProvider.cityName,
|
initCity: regionProvider.tempCityName,
|
||||||
onConfirm: (p, c, t) {
|
onConfirm: (p, c, t) {
|
||||||
regionProvider.updateRegion(p, c);
|
regionProvider.updateRegion(p, c);
|
||||||
});
|
});
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:fengshui_compass/components/my_icon.dart';
|
||||||
import 'package:fengshui_compass/models/et_date.dart';
|
import 'package:fengshui_compass/models/et_date.dart';
|
||||||
import 'package:fengshui_compass/pages/pan_page.dart';
|
import 'package:fengshui_compass/pages/pan_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fengshui_compass/components/my_icon.dart';
|
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
@ -96,6 +98,29 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_showDateTimePicker() {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHMS, onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
hour = p.hour;
|
||||||
|
minute = p.minute;
|
||||||
|
if (isLunar) {
|
||||||
|
lunar_year = p.year;
|
||||||
|
lunar_month = p.month;
|
||||||
|
lunar_day = p.day;
|
||||||
|
|
||||||
|
_controllerDate.text =
|
||||||
|
"${lunar_year}年${lunar_month}月${lunar_day}日 $hour时$minute分";
|
||||||
|
} else {
|
||||||
|
year = p.year;
|
||||||
|
month = p.month;
|
||||||
|
day = p.day;
|
||||||
|
|
||||||
|
_controllerDate.text = "${year}年${month}月${day}日 $hour时$minute分";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 通过公历算农历
|
// 通过公历算农历
|
||||||
calLunar() {
|
calLunar() {
|
||||||
if (_controllerWebView != null) {
|
if (_controllerWebView != null) {
|
||||||
@ -150,10 +175,10 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
|
|
||||||
calPan() {
|
calPan() {
|
||||||
if (_controllerWebView != null) {
|
if (_controllerWebView != null) {
|
||||||
if(qmType == 0) {
|
if (qmType == 0) {
|
||||||
_controllerWebView
|
_controllerWebView
|
||||||
.runJavascriptReturningResult(
|
.runJavascriptReturningResult(
|
||||||
"flutterCallPaiPan($year, $month, $day, $hour, $minute)")
|
"flutterCallPaiPan($year, $month, $day, $hour, $minute)")
|
||||||
.then((value) {
|
.then((value) {
|
||||||
String tmp = value
|
String tmp = value
|
||||||
.replaceAll(r'\"', '"')
|
.replaceAll(r'\"', '"')
|
||||||
@ -166,24 +191,24 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => PanPage(
|
builder: (context) => PanPage(
|
||||||
solarDate: EtDate(
|
solarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getSolar(),
|
.getSolar(),
|
||||||
lunarDate: EtDate(
|
lunarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getLunar(),
|
.getLunar(),
|
||||||
jieqi: qm.jieqi,
|
jieqi: qm.jieqi,
|
||||||
dunju: qm.dunju,
|
dunju: qm.dunju,
|
||||||
@ -191,13 +216,12 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
zhishi: qm.zhishi,
|
zhishi: qm.zhishi,
|
||||||
zhifu: qm.zhifu,
|
zhifu: qm.zhifu,
|
||||||
kong: qm.kong,
|
kong: qm.kong,
|
||||||
qimenResult: qm.qimenResult
|
qimenResult: qm.qimenResult)));
|
||||||
)));
|
|
||||||
});
|
});
|
||||||
} else if (qmType == 1) {
|
} else if (qmType == 1) {
|
||||||
_controllerWebView
|
_controllerWebView
|
||||||
.runJavascriptReturningResult(
|
.runJavascriptReturningResult(
|
||||||
"flutterCallYinPan($year, $month, $day, $hour, $minute)")
|
"flutterCallYinPan($year, $month, $day, $hour, $minute)")
|
||||||
.then((value) {
|
.then((value) {
|
||||||
String tmp = value
|
String tmp = value
|
||||||
.replaceAll(r'\"', '"')
|
.replaceAll(r'\"', '"')
|
||||||
@ -210,24 +234,24 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => PanPage(
|
builder: (context) => PanPage(
|
||||||
solarDate: EtDate(
|
solarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getSolar(),
|
.getSolar(),
|
||||||
lunarDate: EtDate(
|
lunarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getLunar(),
|
.getLunar(),
|
||||||
jieqi: qm.jieqi,
|
jieqi: qm.jieqi,
|
||||||
dunju: qm.dunju,
|
dunju: qm.dunju,
|
||||||
@ -235,13 +259,12 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
zhishi: qm.zhishi,
|
zhishi: qm.zhishi,
|
||||||
zhifu: qm.zhifu,
|
zhifu: qm.zhifu,
|
||||||
kong: qm.kong,
|
kong: qm.kong,
|
||||||
qimenResult: qm.qimenResult
|
qimenResult: qm.qimenResult)));
|
||||||
)));
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_controllerWebView
|
_controllerWebView
|
||||||
.runJavascriptReturningResult(
|
.runJavascriptReturningResult(
|
||||||
"flutterCallPaiPan($year, $month, $day, $hour, $minute)")
|
"flutterCallPaiPan($year, $month, $day, $hour, $minute)")
|
||||||
.then((value) {
|
.then((value) {
|
||||||
String tmp = value
|
String tmp = value
|
||||||
.replaceAll(r'\"', '"')
|
.replaceAll(r'\"', '"')
|
||||||
@ -254,24 +277,24 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => PanPage(
|
builder: (context) => PanPage(
|
||||||
solarDate: EtDate(
|
solarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getSolar(),
|
.getSolar(),
|
||||||
lunarDate: EtDate(
|
lunarDate: EtDate(
|
||||||
cYear: year,
|
cYear: year,
|
||||||
cMonth: month,
|
cMonth: month,
|
||||||
cDay: day,
|
cDay: day,
|
||||||
lYear: lunar_year,
|
lYear: lunar_year,
|
||||||
lMonth: lunar_month,
|
lMonth: lunar_month,
|
||||||
lDay: lunar_day,
|
lDay: lunar_day,
|
||||||
hour: hour,
|
hour: hour,
|
||||||
minute: minute)
|
minute: minute)
|
||||||
.getLunar(),
|
.getLunar(),
|
||||||
jieqi: qm.jieqi,
|
jieqi: qm.jieqi,
|
||||||
dunju: qm.dunju,
|
dunju: qm.dunju,
|
||||||
@ -279,8 +302,7 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
zhishi: qm.zhishi,
|
zhishi: qm.zhishi,
|
||||||
zhifu: qm.zhifu,
|
zhifu: qm.zhifu,
|
||||||
kong: qm.kong,
|
kong: qm.kong,
|
||||||
qimenResult: qm.qimenResult
|
qimenResult: qm.qimenResult)));
|
||||||
)));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -357,7 +379,7 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
lunar_day = json.decode(tmp)['lDay'];
|
lunar_day = json.decode(tmp)['lDay'];
|
||||||
|
|
||||||
_controllerDate.text =
|
_controllerDate.text =
|
||||||
"${year}年${month}月${day}日";
|
"${year}年${month}月${day}日 $hour时$minute分";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -410,7 +432,7 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
day = json.decode(tmp)['cDay'];
|
day = json.decode(tmp)['cDay'];
|
||||||
|
|
||||||
_controllerDate.text =
|
_controllerDate.text =
|
||||||
"${lunar_year}年${lunar_month}月${lunar_day}日";
|
"${lunar_year}年${lunar_month}月${lunar_day}日 $hour时$minute分";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -434,7 +456,7 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
))
|
))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.only(top: 40)),
|
const Padding(padding: EdgeInsets.only(top: 80)),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Padding(
|
const Padding(
|
||||||
@ -455,64 +477,73 @@ class _BirthCalState extends State<BirthCalPage> {
|
|||||||
readOnly: true,
|
readOnly: true,
|
||||||
)),
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: _showDatePicker,
|
// onPressed: _showDatePicker,
|
||||||
|
onPressed: _showDateTimePicker,
|
||||||
icon: Icon(MyIcons.icon_rili))
|
icon: Icon(MyIcons.icon_rili))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.only(top: 40)),
|
// const Padding(padding: EdgeInsets.only(top: 40)),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// const Padding(
|
||||||
|
// padding: EdgeInsets.only(
|
||||||
|
// left: 10,
|
||||||
|
// right: 10,
|
||||||
|
// ),
|
||||||
|
// child: Text(
|
||||||
|
// "出生时间:",
|
||||||
|
// style: TextStyle(fontSize: 18),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: TextField(
|
||||||
|
// controller: _controllerTime,
|
||||||
|
// decoration: InputDecoration(
|
||||||
|
// contentPadding: const EdgeInsets.all(10.0),
|
||||||
|
// border: OutlineInputBorder(
|
||||||
|
// borderRadius: BorderRadius.circular(10.0),
|
||||||
|
// )),
|
||||||
|
// readOnly: true,
|
||||||
|
// )),
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: _showTimePicker,
|
||||||
|
// icon: Icon(Icons.timelapse_outlined))
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
Padding(padding: EdgeInsets.only(top: 80)),
|
||||||
|
// 切换奇门类型,单选框
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Padding(
|
Row(
|
||||||
padding: EdgeInsets.only(
|
mainAxisSize: MainAxisSize.min,
|
||||||
left: 10,
|
children: [
|
||||||
right: 10,
|
Radio(
|
||||||
),
|
value: 0,
|
||||||
child: Text(
|
groupValue: qmType,
|
||||||
"出生时间:",
|
onChanged: (v) {
|
||||||
style: TextStyle(fontSize: 18),
|
setState(() {
|
||||||
),
|
qmType = v;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
const Text("拆补法")
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Expanded(
|
Row(
|
||||||
child: TextField(
|
mainAxisSize: MainAxisSize.min,
|
||||||
controller: _controllerTime,
|
children: [
|
||||||
decoration: InputDecoration(
|
Radio(
|
||||||
contentPadding: const EdgeInsets.all(10.0),
|
value: 1,
|
||||||
border: OutlineInputBorder(
|
groupValue: qmType,
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
onChanged: (v) {
|
||||||
)),
|
setState(() {
|
||||||
readOnly: true,
|
qmType = v;
|
||||||
)),
|
});
|
||||||
IconButton(
|
}),
|
||||||
onPressed: _showTimePicker,
|
const Text("阴盘")
|
||||||
icon: Icon(Icons.timelapse_outlined))
|
],
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.only(top: 40)),
|
|
||||||
// 切换奇门类型,单选框
|
|
||||||
Row(children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Radio(value: 0, groupValue: qmType, onChanged: (v){
|
|
||||||
setState(() {
|
|
||||||
qmType = v;
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
const Text("拆补法")
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Radio(value: 1, groupValue: qmType, onChanged: (v){
|
|
||||||
setState(() {
|
|
||||||
qmType = v;
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
const Text("阴盘")
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@ -327,152 +327,167 @@ class _CompassState extends State<CompassPage> {
|
|||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(minHeight: 600),
|
constraints: const BoxConstraints(minHeight: 600),
|
||||||
child: Stack(
|
child: Consumer<RegionProvider>(
|
||||||
alignment: Alignment.center,
|
builder: (builder, regionProvider, child) {
|
||||||
children: [
|
return Stack(
|
||||||
// 罗盘
|
alignment: Alignment.center,
|
||||||
Column(
|
|
||||||
children: [
|
children: [
|
||||||
const Padding(padding: EdgeInsets.only(top: 145)),
|
// 罗盘
|
||||||
Row(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Spacer(flex: 1),
|
const Padding(padding: EdgeInsets.only(top: 145)),
|
||||||
Container(
|
Row(
|
||||||
width: 700,
|
children: [
|
||||||
height: 700,
|
Spacer(flex: 1),
|
||||||
child: Stack(
|
Container(
|
||||||
children: [
|
width: 700,
|
||||||
Transform.rotate(
|
height: 700,
|
||||||
angle: myaw * pi / 360,
|
child: Stack(
|
||||||
child: const Image(
|
children: [
|
||||||
image:
|
Transform.rotate(
|
||||||
AssetImage("assets/images/compass.png"),
|
angle: myaw * pi / 360 +
|
||||||
fit: BoxFit.fill),
|
regionProvider.declination,
|
||||||
|
child: const Image(
|
||||||
|
image: AssetImage(
|
||||||
|
"assets/images/compass_rotated.png"),
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: FractionalOffset(w_x, w_y),
|
||||||
|
child: const Image(
|
||||||
|
image:
|
||||||
|
AssetImage("assets/images/water.png"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CrossPaint(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Align(
|
),
|
||||||
alignment: FractionalOffset(w_x, w_y),
|
const Spacer(flex: 1),
|
||||||
child: const Image(
|
],
|
||||||
image: AssetImage("assets/images/water.png"),
|
)
|
||||||
),
|
|
||||||
),
|
|
||||||
CrossPaint(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(flex: 1),
|
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
// 最上面一行, lock azimuth login
|
||||||
|
Positioned(
|
||||||
|
top: 5,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Image(
|
||||||
|
width: 15,
|
||||||
|
height: 15,
|
||||||
|
image: AssetImage("assets/images/arrow.png"),
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
// "${azimuth.toStringAsFixed(2)}",
|
||||||
|
(myaw + regionProvider.declination)
|
||||||
|
.toStringAsFixed(2),
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.amber, fontSize: 36),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
//磁偏角调整按钮
|
||||||
|
Positioned(
|
||||||
|
top: 5,
|
||||||
|
right: 8,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () => selectRegion(),
|
||||||
|
icon: const Icon(Icons.settings, color: Colors.amber),
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
top: 45,
|
||||||
|
right: 8,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () => selectRegion(),
|
||||||
|
icon: const Icon(Icons.photo, color: Colors.amber),
|
||||||
|
)),
|
||||||
|
// 最下面一行,ranging value openlaser
|
||||||
|
Positioned(
|
||||||
|
bottom: 80,
|
||||||
|
left: 50,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: raging,
|
||||||
|
icon: const Icon(
|
||||||
|
MyIcons.icon_celiang,
|
||||||
|
size: 34,
|
||||||
|
),
|
||||||
|
color: Colors.amber)),
|
||||||
|
const Positioned(
|
||||||
|
width: 180,
|
||||||
|
height: 90,
|
||||||
|
bottom: 60,
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage("assets/images/range_input.png"),
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
width: 180,
|
||||||
|
height: 90,
|
||||||
|
bottom: 60,
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 15),
|
||||||
|
child: Text(
|
||||||
|
"${distance} m",
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.amber, fontSize: 28),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
|
||||||
|
Positioned(
|
||||||
|
bottom: 60,
|
||||||
|
right: 40,
|
||||||
|
height: 120,
|
||||||
|
width: 100,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
color: Colors.amber,
|
||||||
|
onPressed: () {
|
||||||
|
if (isUpClose) {
|
||||||
|
openUpLaser();
|
||||||
|
} else {
|
||||||
|
closeUpLaser();
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
isUpClose = !isUpClose;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
isUpClose
|
||||||
|
? MyIcons.icon_shangdeng
|
||||||
|
: MyIcons.icon_shangdnegguanbi,
|
||||||
|
size: 36)),
|
||||||
|
IconButton(
|
||||||
|
color: Colors.amber,
|
||||||
|
onPressed: () {
|
||||||
|
if (isSideClose) {
|
||||||
|
openSideLaser();
|
||||||
|
} else {
|
||||||
|
closeSideLaser();
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
isSideClose = !isSideClose;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
isSideClose
|
||||||
|
? MyIcons.icon_zuoyoudneg
|
||||||
|
: MyIcons.icon_zuoyoudengguanbi,
|
||||||
|
size: 32,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
// 最上面一行, lock azimuth login
|
},
|
||||||
Positioned(
|
|
||||||
top: 5,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
const Image(
|
|
||||||
width: 15,
|
|
||||||
height: 15,
|
|
||||||
image: AssetImage("assets/images/arrow.png"),
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
// "${azimuth.toStringAsFixed(2)}",
|
|
||||||
myaw.toStringAsFixed(2),
|
|
||||||
style:
|
|
||||||
const TextStyle(color: Colors.amber, fontSize: 36),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
top: 5,
|
|
||||||
right: 8,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () => selectRegion(),
|
|
||||||
icon: const Icon(Icons.settings, color: Colors.amber),
|
|
||||||
)),
|
|
||||||
// 最下面一行,ranging value openlaser
|
|
||||||
Positioned(
|
|
||||||
bottom: 80,
|
|
||||||
left: 50,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: raging,
|
|
||||||
icon: const Icon(
|
|
||||||
MyIcons.icon_celiang,
|
|
||||||
size: 34,
|
|
||||||
),
|
|
||||||
color: Colors.amber)),
|
|
||||||
const Positioned(
|
|
||||||
width: 180,
|
|
||||||
height: 90,
|
|
||||||
bottom: 60,
|
|
||||||
child: Image(
|
|
||||||
image: AssetImage("assets/images/range_input.png"),
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
)),
|
|
||||||
Positioned(
|
|
||||||
width: 180,
|
|
||||||
height: 90,
|
|
||||||
bottom: 60,
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 15),
|
|
||||||
child: Text(
|
|
||||||
"${distance} m",
|
|
||||||
style:
|
|
||||||
const TextStyle(color: Colors.amber, fontSize: 28),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
|
|
||||||
Positioned(
|
|
||||||
bottom: 60,
|
|
||||||
right: 40,
|
|
||||||
height: 120,
|
|
||||||
width: 100,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
IconButton(
|
|
||||||
color: Colors.amber,
|
|
||||||
onPressed: () {
|
|
||||||
if (isUpClose) {
|
|
||||||
openUpLaser();
|
|
||||||
} else {
|
|
||||||
closeUpLaser();
|
|
||||||
}
|
|
||||||
setState(() {
|
|
||||||
isUpClose = !isUpClose;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
isUpClose
|
|
||||||
? MyIcons.icon_shangdeng
|
|
||||||
: MyIcons.icon_shangdnegguanbi,
|
|
||||||
size: 36)),
|
|
||||||
IconButton(
|
|
||||||
color: Colors.amber,
|
|
||||||
onPressed: () {
|
|
||||||
if (isSideClose) {
|
|
||||||
openSideLaser();
|
|
||||||
} else {
|
|
||||||
closeSideLaser();
|
|
||||||
}
|
|
||||||
setState(() {
|
|
||||||
isSideClose = !isSideClose;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
isSideClose
|
|
||||||
? MyIcons.icon_zuoyoudneg
|
|
||||||
: MyIcons.icon_zuoyoudengguanbi,
|
|
||||||
size: 32,
|
|
||||||
))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
@ -4,7 +4,6 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
import '../bottom_navigation_widget.dart';
|
import '../bottom_navigation_widget.dart';
|
||||||
import '../states/token.dart';
|
import '../states/token.dart';
|
||||||
import '../utils/token_helper.dart';
|
|
||||||
|
|
||||||
// 用户未登录页面
|
// 用户未登录页面
|
||||||
class PersonalLoginPage extends StatefulWidget {
|
class PersonalLoginPage extends StatefulWidget {
|
||||||
@ -17,7 +16,7 @@ class PersonalLoginPage extends StatefulWidget {
|
|||||||
class _PersonalLoginPageState extends State<PersonalLoginPage> {
|
class _PersonalLoginPageState extends State<PersonalLoginPage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
bool isLogin = TokenHelper.getInstance.isLogin;
|
// bool isLogin = TokenHelper.getInstance.isLogin;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
Reference in New Issue
Block a user