1.优化补足了首页下拉刷新中对获取场站接口的加入,确保能够实时获取数据并渲染。
2.优化修改了tcp重连机制,具体操作:断开重连时候不再建立新链接 而是将旧链接重置,并重新发送数据。 3.大面积的给项目中的各个页面 手动接入了多语言的支持。同时也调整了相应带来的问题英文长度较大影响原有的样式的问题,已解决了对应的样式不和谐问题。保证了外观的统一性。 4.给项目中的主要操作加了几个核心的操作比如远程遥控和路径规划添加了双层的保护,设置里安全模式,即在此期间对服务器推送的重复登录操作后的自动退出登录做一个拦截 保证操作的安全性。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:maibu_satabot_v2/core/localization/app_localizations.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/home/domain/entities/home_entity.dart';
|
||||
|
||||
class PowerTrendChart extends StatelessWidget {
|
||||
@@ -22,9 +23,9 @@ class PowerTrendChart extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'发电趋势(今日)',
|
||||
style: TextStyle(
|
||||
Text(
|
||||
AppLocalizations.of(context).translate('home_v2.power_trend'),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1D2129),
|
||||
@@ -38,8 +39,14 @@ class PowerTrendChart extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
_buildTypeButton('kW'),
|
||||
_buildTypeButton('周'),
|
||||
_buildTypeButton(
|
||||
'day',
|
||||
AppLocalizations.of(context).translate('home_v2.day'),
|
||||
),
|
||||
_buildTypeButton(
|
||||
'month',
|
||||
AppLocalizations.of(context).translate('home_v2.month'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -88,7 +95,11 @@ class PowerTrendChart extends StatelessWidget {
|
||||
interval: 6,
|
||||
getTitlesWidget: (value, meta) {
|
||||
final index = value.toInt();
|
||||
if (index == 0 || index == 6 || index == 12 || index == 18 || index == 23) {
|
||||
if (index == 0 ||
|
||||
index == 6 ||
|
||||
index == 12 ||
|
||||
index == 18 ||
|
||||
index == 23) {
|
||||
String time;
|
||||
if (index == 23) {
|
||||
time = '23:00';
|
||||
@@ -174,7 +185,7 @@ class PowerTrendChart extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTypeButton(String type) {
|
||||
Widget _buildTypeButton(String type, String label) {
|
||||
final isSelected = trendType == type;
|
||||
return GestureDetector(
|
||||
onTap: () => onToggleType(type),
|
||||
@@ -187,7 +198,7 @@ class PowerTrendChart extends StatelessWidget {
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
type,
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: isSelected ? Colors.white : const Color(0xFF86909C),
|
||||
fontSize: 14,
|
||||
|
||||
Reference in New Issue
Block a user