Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5.0 #29

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fluttercheckversionx

<img src="https://badgen.net/badge/Version/3.2.0.231/blue">



Flutter development assistant, Dio monitoring, variable type display, generation of asset file dictionary, beautification of Dart documents and other tools, documents are under preparation
Expand Down
19 changes: 12 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.21"
}
group = "shop.itbug"
version = "3.5.0.as"
version = "3.5.1.as"
repositories {
mavenCentral()
google()
Expand All @@ -17,13 +17,13 @@ repositories {


intellij {
version.set("2022.2.1.18")
version.set("2022.3.1.18")
type.set("AI")
plugins.set(
listOf(
"yaml",
"Dart:222.4582",
"io.flutter:74.0.2",
"Dart:223.8950",
"io.flutter:74.0.3",
"org.intellij.plugins.markdown",
"terminal"
)
Expand Down Expand Up @@ -76,12 +76,17 @@ tasks {
}

patchPluginXml {
sinceBuild.set("222")
untilBuild.set("222.*")
sinceBuild.set("223")
untilBuild.set("223.*")
changeNotes.set(
"""
<div>
<h1>3.5.0.as (2023-07-25)</h1>
<h1>3.5.1.as (2023-07-27)</h1>
<ul>
<li>Add Freezed Shortcut Menu</li>
<li>Added multiple languages such as Korean, Japanese, and Traditional Chinese</li>
<li>Optimization of other details</li>
</ul>
<ul>
<li>添加freezed快捷操作菜单</li>
<li>新增韩语,日语,繁体等多国语言</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ import javax.swing.event.ListSelectionListener
*/
class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListener {

fun createPopupMenu(): ListPopup {
return JBPopupFactory.getInstance()
.createActionGroupPopup(PluginBundle.get("menu"), myActionGroup, myDataContext, true, { dispose() }, 10)

}
private val myDataContext: AsyncDataContext = object : AsyncDataContext {
override fun getData(dataId: String): Any? {
if (dataId == "select-api") {
return this@ApiListPanel.selectedValue
} else if (dataId == PROJECT_KEY) {
return project
}
return null
}
}


private val appService = service<AppService>()
private fun listModel(): DefaultListModel<Request> = model as DefaultListModel

Expand Down Expand Up @@ -70,30 +87,10 @@ class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListe
}


/**
* 查看菜单
*/
fun createPopupMenu(): ListPopup {
return JBPopupFactory.getInstance()
.createActionGroupPopup(PluginBundle.get("menu"), myActionGroup, myDataContext, true, { dispose() }, 10)

}

private val myActionGroup: ActionGroup
get() = ActionManager.getInstance().getAction("dio-window-view-params") as ActionGroup


private val myDataContext: AsyncDataContext = object : AsyncDataContext {
override fun getData(dataId: String): Any? {
if (dataId == "select-api") {
return this@ApiListPanel.selectedValue
} else if (dataId == PROJECT_KEY) {
return project
}
return null
}
}

/**
* 菜单销毁回调
*/
Expand Down Expand Up @@ -197,7 +194,13 @@ class ApiListPanel(val project: Project) : JBList<Request>(), ListSelectionListe
) {
BrowserUtil.open("https://github.com/mdddj/dd_flutter_idea_plugin/issues")
}
appendLine("IP:${Util.resolveLocalAddresses().filter { it.hostAddress.split('.').size == 4 && it.hostAddress.split(".")[2] != "0" }.map { it.hostAddress }}", SimpleTextAttributes.GRAYED_ATTRIBUTES){}
appendLine(
"IP:${
Util.resolveLocalAddresses()
.filter { it.hostAddress.split('.').size == 4 && it.hostAddress.split(".")[2] != "0" }
.map { it.hostAddress }
}", SimpleTextAttributes.GRAYED_ATTRIBUTES
) {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ class FreezedInlayCollector(val edit: Editor) : FactoryInlayHintsCollector(edit)
val isFreezedClass =
DartClassUtil.hasMetadata(element, "freezed") || DartClassUtil.hasMetadata(element, "Freezed")
if (isFreezedClass) {
// val lineStart = editor.getLineStart(element)
// val inlayPresentation =
// inlayFactory.iconText(AllIcons.General.ChevronDown, "Freezed Actions ", false) { mouseEvent, point ->
// showFreezedActionMenu(mouseEvent, point, element)
// }
// sink.addBlockElement(lineStart, true, true, 0, inlayPresentation)
val manager = DartClassManager(psiElement = element as DartClassDefinitionImpl)
val freezedElement = manager.findMataDataByText("freezed") ?: manager.findMataDataByText("Freezed")
freezedElement?.let {
Expand Down