Skip to content

Commit 52b8a1c

Browse files
committed
refactor: eliminate indent package dependency from UserPage
1 parent 22e523c commit 52b8a1c

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

lib/pages/user/user_page.dart

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'dart:math';
44
import 'package:flutter/material.dart';
55
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
66
import 'package:get/get.dart';
7-
import 'package:indent/indent.dart';
87
import 'package:intl/intl.dart';
98
import 'package:share_plus/share_plus.dart';
109

@@ -281,16 +280,11 @@ class _UserPageState extends State<UserPage> {
281280
maxLines: 1,
282281
overflow: TextOverflow.ellipsis,
283282
),
284-
content: Text(
285-
'''
286-
|UID: ${user.uid}\n
287-
|等级: Lv.${user.level}\n
288-
|性别: ${user.gender == 1 ? '男' : user.gender == 0 ? '女' : '未知'}\n
289-
|注册时长: ${((DateTime.now().microsecondsSinceEpoch ~/ 10e5 - user.regdate!) ~/ 24 ~/ 3600)} 天\n
290-
|注册时间: ${DateFormat('yyyy年MM月dd日 HH:mm:ss').format(DateTime.fromMillisecondsSinceEpoch(user.regdate * 1000))}
291-
'''
292-
.trimMargin(),
293-
),
283+
content: Text('UID: ${user.uid}\n'
284+
'等级: Lv.${user.level}\n'
285+
'性别: ${user.gender == 1 ? '男' : user.gender == 0 ? '女' : '未知'}\n'
286+
'注册时长: ${((DateTime.now().microsecondsSinceEpoch ~/ 10e5 - user.regdate!) ~/ 24 ~/ 3600)} 天\n'
287+
'注册时间: ${DateFormat('yyyy年MM月dd日 HH:mm:ss').format(DateTime.fromMillisecondsSinceEpoch(user.regdate * 1000))}'),
294288
);
295289
},
296290
);

pubspec.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,6 @@ packages:
709709
url: "https://pub.flutter-io.cn"
710710
source: hosted
711711
version: "0.2.1+1"
712-
indent:
713-
dependency: "direct main"
714-
description:
715-
name: indent
716-
sha256: "819319a5c185f7fe412750c798953378b37a0d0d32564ce33e7c5acfd1372d2a"
717-
url: "https://pub.flutter-io.cn"
718-
source: hosted
719-
version: "2.0.0"
720712
intl:
721713
dependency: "direct main"
722714
description:

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dependencies:
5353
hive_flutter: ^1.1.0
5454
html: ^0.15.4
5555
image_picker: ^1.1.2
56-
indent: ^2.0.0
5756
intl: ^0.20.2
5857
json_annotation: ^4.9.0
5958
mime: ^2.0.0

0 commit comments

Comments
 (0)