Skip to content

Commit 4df328b

Browse files
committed
print
1 parent 38dcf5d commit 4df328b

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

lib/common/dao/user_dao.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:convert';
22
import 'package:dio/dio.dart';
33
import 'package:flutter/foundation.dart';
4-
import 'package:flutter/material.dart';
54
import 'package:gsy_github_app_flutter/common/net/graphql/client.dart';
65
import 'package:gsy_github_app_flutter/db/provider/user/user_followed_db_provider.dart';
76
import 'package:gsy_github_app_flutter/db/provider/user/user_follower_db_provider.dart';

lib/common/utils/html_utils.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ class HtmlUtils {
213213
lang = formName(tmpLang.toLowerCase());
214214
}
215215
}
216-
if (lang == null) {
217-
lang = defaultLang;
218-
}
216+
lang ??= defaultLang;
219217
if ('markdown' == lang) {
220218
return generateHtml(res.data, backgroundColor: GSYColors.miWhiteString);
221219
} else {

lib/page/user/person_page.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ class PersonPage extends StatefulWidget {
2525
const PersonPage(this.userName, {super.key});
2626

2727
@override
28-
PersonState createState() => PersonState(userName);
28+
PersonState createState() => PersonState();
2929
}
3030

3131
class PersonState extends BasePersonState<PersonPage> {
32-
final String? userName;
3332

3433
String beStaredCount = "---";
3534

@@ -39,9 +38,10 @@ class PersonState extends BasePersonState<PersonPage> {
3938

4039
User? userInfo = User.empty();
4140

41+
// ignore: overridden_fields
4242
final List<UserOrg> orgList = [];
4343

44-
PersonState(this.userName);
44+
PersonState();
4545

4646
///处理用户信息显示
4747
_resolveUserInfo(res) {
@@ -61,7 +61,7 @@ class PersonState extends BasePersonState<PersonPage> {
6161
page = 1;
6262

6363
///获取网络用户数据
64-
var userResult = await UserDao.getUserInfo(userName, needDb: true);
64+
var userResult = await UserDao.getUserInfo(widget.userName, needDb: true);
6565
if (userResult != null && userResult.result) {
6666
_resolveUserInfo(userResult);
6767
if (userResult.next != null) {
@@ -94,7 +94,7 @@ class PersonState extends BasePersonState<PersonPage> {
9494

9595
///获取当前用户的关注状态
9696
_getFocusStatus() async {
97-
var focusRes = await UserDao.checkFollowDao(userName);
97+
var focusRes = await UserDao.checkFollowDao(widget.userName);
9898
if (isShow) {
9999
setState(() {
100100
focus = (focusRes != null && focusRes.result)
@@ -168,7 +168,7 @@ class PersonState extends BasePersonState<PersonPage> {
168168
return;
169169
}
170170
CommonUtils.showLoadingDialog(context);
171-
UserDao.doFollowDao(userName, focusStatus).then((res) {
171+
UserDao.doFollowDao(widget.userName, focusStatus).then((res) {
172172
Navigator.pop(context);
173173
_getFocusStatus();
174174
});

lib/test/demo_appbar.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class ImageAppbar extends StatelessWidget implements PreferredSizeWidget {
2727
Widget build(BuildContext context) {
2828
var leading = this.leading;
2929

30-
if (leading == null) {
31-
leading ??= needLeading
30+
leading ??= needLeading
3231
? IconButton(
3332
highlightColor: Colors.transparent,
3433
icon: Icon(
@@ -45,7 +44,6 @@ class ImageAppbar extends StatelessWidget implements PreferredSizeWidget {
4544
},
4645
)
4746
: Container();
48-
}
4947

5048
leading = ConstrainedBox(
5149
constraints: BoxConstraints.tightFor(width: leadingWidth),

lib/test/demo_db.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:convert';
33

44
import 'package:flutter/foundation.dart';
55
import 'package:gsy_github_app_flutter/model/User.dart';
6-
import 'package:meta/meta.dart';
76
import 'package:sqflite/sqflite.dart';
87

98
/**

lib/widget/markdown/syntax_high_lighter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DartSyntaxHighlighter extends SyntaxCostomHighlighter {
4747
DartSyntaxHighlighter([this._style]) {
4848
_spans = <_HighlightSpan>[];
4949

50-
if (_style == null) _style = SyntaxHighlighterStyle.defaultStyle();
50+
_style ??= SyntaxHighlighterStyle.defaultStyle();
5151
}
5252

5353
SyntaxHighlighterStyle? _style;

0 commit comments

Comments
 (0)