Skip to content

Commit

Permalink
support 3.27
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Dec 17, 2024
1 parent 33058e6 commit 91e249b
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 77 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

## 编译运行流程

1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.24**),可参阅 [【搭建环境】](https://flutterchina.club)
1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.27**),可参阅 [【搭建环境】](https://flutterchina.club)

2、clone代码,执行`Packages get`安装第三方包。(因为某些不可抗力原因,国内可能需要设置代理: [代理环境变量](https://flutterchina.club/setup-windows/))

Expand All @@ -109,7 +109,7 @@

### 5、运行之前请注意下

>### 1、本地 Flutter SDK 版本 3.24 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
>### 1、本地 Flutter SDK 版本 3.27 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)

### 下载
Expand Down Expand Up @@ -154,7 +154,7 @@

### 第三方框架

>当前 Flutter SDK 版本 3.24
>当前 Flutter SDK 版本 3.27
|| 功能 |
| -------------------------- | -------------- |
Expand Down
6 changes: 3 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ With the use and feedback of the project, will user experience and function opti

### Operation instructions

1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.24** ).
1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.27** ).

2. Clone code, execute `Packages get'to install third-party packages.

Expand All @@ -68,7 +68,7 @@ With the use and feedback of the project, will user experience and function opti

4、Be careful

>### Local Flutter SDK version 3.24 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock?
>### Local Flutter SDK version 3.27 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock?
### Download

Expand Down Expand Up @@ -110,7 +110,7 @@ With the use and feedback of the project, will user experience and function opti

### Third-party framework

>Current Flutter SDK version **3.24**
>Current Flutter SDK version **3.27**
|| 功能 |
| -------------------------- | -------------- |
Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/build
/captures
GeneratedPluginRegistrant.java
.cxx/
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.provider.MediaStore
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.PluginRegistry.Registrar

class UpdateAlbumPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {

Expand All @@ -17,18 +16,11 @@ class UpdateAlbumPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
companion object {

private val sChannelName = "com.shuyu.gsygithub.gsygithubflutter/UpdateAlbumPlugin"

fun registerWith(registrar: Registrar) {
val instance = UpdateAlbumPlugin()
instance.channel = MethodChannel(registrar.messenger(), sChannelName)
instance.context = registrar.context()
instance.channel?.setMethodCallHandler(instance)
}
}

override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(
binding.flutterEngine.dartExecutor, sChannelName)
binding.binaryMessenger, sChannelName)
context = binding.applicationContext
channel!!.setMethodCallHandler(this)
}
Expand Down
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
allprojects {
repositories {
google()
jcenter()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
6 changes: 3 additions & 3 deletions lib/common/dao/issue_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class IssueDao {
/// @param direction 正序或者倒序
static getRepositoryIssueDao(userName, repository, state,
{sort, direction, page = 0, needDb = false}) async {
String? fullName = userName + "/" + repository;
String? fullName = "$userName/$repository";
String dbState = state ?? "*";
RepositoryIssueDbProvider provider = RepositoryIssueDbProvider();

Expand Down Expand Up @@ -101,7 +101,7 @@ class IssueDao {

/// issue的详请
static getIssueInfoDao(userName, repository, number, {needDb = true}) async {
String? fullName = userName + "/" + repository;
String? fullName = "$userName/$repository";

IssueDetailDbProvider provider = IssueDetailDbProvider();

Expand Down Expand Up @@ -134,7 +134,7 @@ class IssueDao {
/// issue的详请列表
static getIssueCommentDao(userName, repository, number,
{page = 0, needDb = false}) async {
String? fullName = userName + "/" + repository;
String? fullName = "$userName/$repository";
IssueCommentDbProvider provider = IssueCommentDbProvider();

next() async {
Expand Down
19 changes: 9 additions & 10 deletions lib/common/dao/repos_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ReposDao {
/// 仓库的详情数据
static getRepositoryDetailDao(userName, reposName, branch,
{needDb = true}) async {
String? fullName = userName + "/" + reposName + "v3";
String? fullName = userName + "/$reposName" + "v3";
RepositoryDetailDbProvider provider = RepositoryDetailDbProvider();

next() async {
Expand Down Expand Up @@ -144,7 +144,7 @@ class ReposDao {
/// 仓库活动事件
static getRepositoryEventDao(userName, reposName,
{page = 0, branch = "master", needDb = false}) async {
String? fullName = userName + "/" + reposName;
String? fullName = userName + "/$reposName";
RepositoryEventDbProvider provider = RepositoryEventDbProvider();

next() async {
Expand Down Expand Up @@ -193,15 +193,14 @@ class ReposDao {
/// 获取仓库的提交列表
static getReposCommitsDao(userName, reposName,
{page = 0, branch = "master", needDb = false}) async {
String? fullName = userName + "/" + reposName;
String? fullName = userName + "/$reposName";

RepositoryCommitsDbProvider provider = RepositoryCommitsDbProvider();

next() async {
String url = Address.getReposCommits(userName, reposName) +
Address.getPageParams("?", page) +
"&sha=" +
branch;
"&sha=$branch";
var res = await httpManager.netFetch(url, null, null, null);
if (res != null && res.result) {
List<RepoCommit> list = [];
Expand Down Expand Up @@ -295,7 +294,7 @@ class ReposDao {
/// 获取当前仓库所有订阅用户
static getRepositoryWatcherDao(userName, reposName, page,
{needDb = false}) async {
String? fullName = userName + "/" + reposName;
String? fullName = "$userName/$reposName";
RepositoryWatcherDbProvider provider = RepositoryWatcherDbProvider();

next() async {
Expand Down Expand Up @@ -334,7 +333,7 @@ class ReposDao {
/// 获取当前仓库所有star用户
static getRepositoryStarDao(userName, reposName, page,
{needDb = false}) async {
String? fullName = userName + "/" + reposName;
String? fullName = "$userName/$reposName";
RepositoryStarDbProvider provider = RepositoryStarDbProvider();
next() async {
String url = Address.getReposStar(userName, reposName) +
Expand Down Expand Up @@ -372,7 +371,7 @@ class ReposDao {
/// 获取仓库的fork分支
static getRepositoryForksDao(userName, reposName, page,
{needDb = false}) async {
String? fullName = userName + "/" + reposName;
String? fullName = "$userName/$reposName";
RepositoryForkDbProvider provider = RepositoryForkDbProvider();
next() async {
String url = Address.getReposForks(userName, reposName) +
Expand Down Expand Up @@ -545,12 +544,12 @@ class ReposDao {
/// 详情的remde数据
static getRepositoryDetailReadmeDao(userName, reposName, branch,
{needDb = true}) async {
String? fullName = userName + "/" + reposName;
String? fullName = "$userName/$reposName";
RepositoryDetailReadmeDbProvider provider =
RepositoryDetailReadmeDbProvider();

next() async {
String url = Address.readmeFile(userName + '/' + reposName, branch);
String url = Address.readmeFile('$userName/$reposName', branch);
var res = await httpManager.netFetch(
url,
null,
Expand Down
2 changes: 1 addition & 1 deletion lib/common/dao/user_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class UserDao {
}

static login(userName, password, store) async {
String type = userName + ":" + password;
String type = "$userName:$password";
var bytes = utf8.encode(type);
var base64Str = base64.encode(bytes);
if (Config.DEBUG!) {
Expand Down
7 changes: 3 additions & 4 deletions lib/common/utils/html_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,11 @@ class HtmlUtils {
"<meta name=\“app-mobile-web-app-capable\” content=\“yes\" /> " +
"<link href=\"https:\/\/cdn.bootcss.com/highlight.js/9.12.0/styles/dracula.min.css\" rel=\"stylesheet\">\n" +
"<script src=\"https:\/\/cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js\"></script> " +
"<script>hljs.configure({'useBR': " +
userBR.toString() +
"<script>hljs.configure({'useBR': ${userBR.toString()}"
"});hljs.initHighlightingOnLoad();</script> " +
"<style>" +
"body{background: " +
backgroundColor};}a {color:$actionColor !important;}.highlight pre, pre { word-wrap: ${wrap ? "break-word" : "normal"}; white-space: ${wrap ? "pre-wrap" : "pre"}; }thead, tr {background:${GSYColors.miWhiteString};}td, th {padding: 5px 10px;font-size: 12px;direction:hor}.highlight {overflow: scroll; background: ${GSYColors.miWhiteString}}tr:nth-child(even) {background:${GSYColors.primaryLightValueString};color:${GSYColors.miWhiteString};}tr:nth-child(odd) {background: ${GSYColors.miWhiteString};color:${GSYColors.primaryLightValueString};}th {font-size: 14px;color:${GSYColors.miWhiteString};background:${GSYColors.primaryLightValueString};}</style></head>\n<body>\n" +
"body{background: $backgroundColor"
};}a {color:$actionColor !important;}.highlight pre, pre { word-wrap: ${wrap ? "break-word" : "normal"}; white-space: ${wrap ? "pre-wrap" : "pre"}; }thead, tr {background:${GSYColors.miWhiteString};}td, th {padding: 5px 10px;font-size: 12px;direction:hor}.highlight {overflow: scroll; background: ${GSYColors.miWhiteString}}tr:nth-child(even) {background:${GSYColors.primaryLightValueString};color:${GSYColors.miWhiteString};}tr:nth-child(odd) {background: ${GSYColors.miWhiteString};color:${GSYColors.primaryLightValueString};}th {font-size: 14px;color:${GSYColors.miWhiteString};background:${GSYColors.primaryLightValueString};}</style></head>\n<body>\n" +
mdHTML}</body>\n</html>";
}

Expand Down
2 changes: 1 addition & 1 deletion lib/page/debug/debug_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _GlobalLabelState extends State<GlobalLabel> {
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.6),
color: Colors.black.withValues(alpha: 0.6),
borderRadius: const BorderRadius.all(
Radius.circular(5),
),
Expand Down
9 changes: 1 addition & 8 deletions lib/page/notify_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class _NotifyPageState extends State<NotifyPage>
AutomaticKeepAliveClientMixin<NotifyPage>,
GSYListState<NotifyPage>,
SingleTickerProviderStateMixin {
late SlidableController slidableController;

int selectIndex = 0;

Expand All @@ -42,8 +41,8 @@ class _NotifyPageState extends State<NotifyPage>
///只有未读消息支持 Slidable 滑动效果
return Slidable(
key: ValueKey<String>("${index}_$selectIndex"),
controller: slidableController,
endActionPane: ActionPane(
dragDismissible: false,
motion: const ScrollMotion(),
dismissible: DismissiblePane(onDismissed: () {
UserDao.setNotificationAsReadDao(notification.id.toString())
Expand Down Expand Up @@ -121,12 +120,6 @@ class _NotifyPageState extends State<NotifyPage>
return await _getDataLogic();
}

@override
void initState() {
super.initState();
slidableController = SlidableController(this);
}

@override
Widget build(BuildContext context) {
super.build(context); // See AutomaticKeepAliveClientMixin.
Expand Down
2 changes: 1 addition & 1 deletion lib/widget/diff_scale_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class _DiffText extends CustomPainter {
textPaint.color = textStyle!.color!;
} else {
textPaint.color = textStyle!.color!
.withAlpha((textStyle!.color!.alpha * alphaFactor).floor());
.withAlpha((textStyle!.color!.a * alphaFactor).floor());
}
var textPainter = TextPainter(
text: TextSpan(
Expand Down
8 changes: 4 additions & 4 deletions lib/widget/gsy_tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class _TabStyle extends AnimatedWidget {
@override
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final TabBarTheme tabBarTheme = TabBarTheme.of(context);
final TabBarThemeData tabBarTheme = TabBarTheme.of(context);
final Animation<double> animation = listenable as Animation<double>;

// To enable TextStyle.lerp(style1, style2, value), both styles must have
Expand Down Expand Up @@ -736,7 +736,7 @@ class _TabBarState extends State<TabBar> {

Decoration? get _indicator {
if (widget.indicator != null) return widget.indicator;
final TabBarTheme tabBarTheme = TabBarTheme.of(context);
final TabBarThemeData tabBarTheme = TabBarTheme.of(context);
if (tabBarTheme.indicator != null) return tabBarTheme.indicator;

Color color = widget.indicatorColor ?? Theme.of(context).indicatorColor;
Expand All @@ -750,7 +750,7 @@ class _TabBarState extends State<TabBar> {
//
// The material's color might be null (if it's a transparency). In that case
// there's no good way for us to find out what the color is so we don't.
if (color.value == Material.of(context).color?.value) color = Colors.white;
if (color == Material.of(context).color) color = Colors.white;

return UnderlineTabIndicator(
insets: widget.indicatorPadding,
Expand Down Expand Up @@ -978,7 +978,7 @@ class _TabBarState extends State<TabBar> {
);
}

final TabBarTheme tabBarTheme = TabBarTheme.of(context);
final TabBarThemeData tabBarTheme = TabBarTheme.of(context);



Expand Down
10 changes: 5 additions & 5 deletions lib/widget/pull/nested/nested_refresh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ class NestedScrollViewRefreshIndicatorState
final ThemeData theme = Theme.of(context);
_valueColor = _positionController.drive(
ColorTween(
begin: (widget.color ?? theme.colorScheme.primary).withOpacity(0.0),
end: (widget.color ?? theme.colorScheme.primary).withOpacity(1.0),
begin: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 0.0),
end: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 1.0),
).chain(CurveTween(
curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit),
)),
Expand All @@ -262,8 +262,8 @@ class NestedScrollViewRefreshIndicatorState
final ThemeData theme = Theme.of(context);
_valueColor = _positionController.drive(
ColorTween(
begin: (widget.color ?? theme.colorScheme.primary).withOpacity(0.0),
end: (widget.color ?? theme.colorScheme.primary).withOpacity(1.0),
begin: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 0.0),
end: (widget.color ?? theme.colorScheme.primary).withValues(alpha: 1.0),
).chain(CurveTween(
curve: const Interval(0.0, 1.0 / _kDragSizeFactorLimit),
)),
Expand Down Expand Up @@ -399,7 +399,7 @@ class NestedScrollViewRefreshIndicatorState
}
_positionController.value =
newValue.clamp(0.0, 1.0); // this triggers various rebuilds
if (_mode == _RefreshIndicatorMode.drag && _valueColor.value!.alpha == 0xFF) {
if (_mode == _RefreshIndicatorMode.drag && _valueColor.value!.a == 0xFF) {
_mode = _RefreshIndicatorMode.armed;
}
}
Expand Down
Loading

0 comments on commit 91e249b

Please sign in to comment.