|
@@ -1,7 +1,7 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_tracker/dio/login_dao.dart';
|
|
import 'package:flutter_tracker/dio/login_dao.dart';
|
|
|
|
+import 'package:flutter_tracker/model/base_model.dart';
|
|
import 'package:flutter_tracker/model/config.dart';
|
|
import 'package:flutter_tracker/model/config.dart';
|
|
-import 'package:flutter_tracker/model/message_model.dart';
|
|
|
|
import 'package:flutter_tracker/routes/routes.dart';
|
|
import 'package:flutter_tracker/routes/routes.dart';
|
|
import 'package:flutter_tracker/utils/app_util.dart';
|
|
import 'package:flutter_tracker/utils/app_util.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
@@ -18,13 +18,13 @@ class MinePage extends StatefulWidget {
|
|
|
|
|
|
class _MinePageState extends State<MinePage> {
|
|
class _MinePageState extends State<MinePage> {
|
|
Size get _size => MediaQuery.of(context).size;
|
|
Size get _size => MediaQuery.of(context).size;
|
|
- String _name = "张三";
|
|
|
|
|
|
+ final String _name = "张三";
|
|
int type = 1;
|
|
int type = 1;
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
return Scaffold(
|
|
- backgroundColor: Color(0xE6E4E4),
|
|
|
|
|
|
+ backgroundColor: const Color(0x00e6e4e4),
|
|
body: SizedBox(
|
|
body: SizedBox(
|
|
width: _size.width,
|
|
width: _size.width,
|
|
child: SingleChildScrollView(
|
|
child: SingleChildScrollView(
|
|
@@ -52,7 +52,7 @@ class _MinePageState extends State<MinePage> {
|
|
|
|
|
|
Text(
|
|
Text(
|
|
_name,
|
|
_name,
|
|
- style: TextStyle(fontSize: 25),
|
|
|
|
|
|
+ style: const TextStyle(fontSize: 25),
|
|
),
|
|
),
|
|
const SizedBox(
|
|
const SizedBox(
|
|
height: 10,
|
|
height: 10,
|
|
@@ -67,7 +67,7 @@ class _MinePageState extends State<MinePage> {
|
|
const SizedBox(
|
|
const SizedBox(
|
|
height: 10,
|
|
height: 10,
|
|
),
|
|
),
|
|
- Text("健康状态:"),
|
|
|
|
|
|
+ const Text("健康状态:"),
|
|
buildImgStatus(),
|
|
buildImgStatus(),
|
|
const SizedBox(
|
|
const SizedBox(
|
|
height: 10,
|
|
height: 10,
|
|
@@ -136,7 +136,7 @@ class _MinePageState extends State<MinePage> {
|
|
// ),
|
|
// ),
|
|
Offstage(
|
|
Offstage(
|
|
offstage: false,
|
|
offstage: false,
|
|
- child: Container(
|
|
|
|
|
|
+ child: SizedBox(
|
|
width: 200,
|
|
width: 200,
|
|
child: InkWell(
|
|
child: InkWell(
|
|
onTap: () {
|
|
onTap: () {
|
|
@@ -145,7 +145,7 @@ class _MinePageState extends State<MinePage> {
|
|
child: Container(
|
|
child: Container(
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
height: 50,
|
|
height: 50,
|
|
- padding: EdgeInsets.only(right: 20, left: 20),
|
|
|
|
|
|
+ padding: const EdgeInsets.only(right: 20, left: 20),
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
gradient: const LinearGradient(colors: [
|
|
gradient: const LinearGradient(colors: [
|
|
ThemeColor.subTextColor,
|
|
ThemeColor.subTextColor,
|
|
@@ -169,7 +169,7 @@ class _MinePageState extends State<MinePage> {
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- SizedBox(
|
|
|
|
|
|
+ const SizedBox(
|
|
height: 50,
|
|
height: 50,
|
|
),
|
|
),
|
|
Container(
|
|
Container(
|
|
@@ -181,7 +181,7 @@ class _MinePageState extends State<MinePage> {
|
|
child: Container(
|
|
child: Container(
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
height: 50,
|
|
height: 50,
|
|
- padding: EdgeInsets.only(right: 20, left: 20),
|
|
|
|
|
|
+ padding: const EdgeInsets.only(right: 20, left: 20),
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
gradient: const LinearGradient(colors: [
|
|
gradient: const LinearGradient(colors: [
|
|
ThemeColor.loignColor,
|
|
ThemeColor.loignColor,
|
|
@@ -255,7 +255,7 @@ class _MinePageState extends State<MinePage> {
|
|
var sharedPreferences = await SharedPreferences.getInstance();
|
|
var sharedPreferences = await SharedPreferences.getInstance();
|
|
String token = sharedPreferences.getString("token") ?? "";
|
|
String token = sharedPreferences.getString("token") ?? "";
|
|
try {
|
|
try {
|
|
- MessageModel messageModel = await LoginDao.logout(token);
|
|
|
|
|
|
+ BaseModel messageModel = await LoginDao.logout(token);
|
|
if (messageModel != null) {
|
|
if (messageModel != null) {
|
|
AppUtil.buildToast(messageModel.msg);
|
|
AppUtil.buildToast(messageModel.msg);
|
|
}
|
|
}
|