Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
cc1071d86e | |||
e334b862df | |||
32c33a963a | |||
a04bfe4cf9 | |||
7b7988e6cb | |||
81a616157e | |||
52312662fb | |||
ca18d6ade4 | |||
af7cc8dab0 | |||
382e3c4a4c | |||
1e37c6ddae | |||
442ef06147 | |||
606a0d708a | |||
558828f3e0 | |||
09dc7d2a0d | |||
6876d2e7c0 | |||
3a5964730c | |||
271c722df3 | |||
97656249f2 | |||
d7e6fe2d8f | |||
2e9c4d166e | |||
c5258cb9ca | |||
47c535910d | |||
66f2f33394 | |||
f5fbe1f483 | |||
fcf4dc7a2d | |||
43b7059957 |
13
.roadsignrc
Normal file
13
.roadsignrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"sync": {
|
||||||
|
"region": "solian",
|
||||||
|
"configPath": "roadsign.toml"
|
||||||
|
},
|
||||||
|
"deployments": [
|
||||||
|
{
|
||||||
|
"region": "solian",
|
||||||
|
"site": "solian-web",
|
||||||
|
"path": "build/web"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
358
assets/highlighting/cpp.json
Normal file
358
assets/highlighting/cpp.json
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
{
|
||||||
|
"name": "C++",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"fileTypes": ["cpp", "hpp", "cc", "h"],
|
||||||
|
"scopeName": "source.cpp",
|
||||||
|
|
||||||
|
"foldingStartMarker": "\\{\\s*$",
|
||||||
|
"foldingStopMarker": "^\\s*\\}",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "meta.preprocessor.script.cpp",
|
||||||
|
"match": "^\\s*#\\s*(include|define|if|ifdef|ifndef|else|endif|pragma)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "meta.declaration.cpp",
|
||||||
|
"begin": "^\\w*\\b(namespace|class|struct|enum|typedef|template)\\b",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "keyword.other.declaration.cpp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "(\\{|;)",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.terminator.cpp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.other.cpp",
|
||||||
|
"match": "\\b(public|private|protected|virtual|override|final)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#punctuation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#annotations"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#keywords"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#constants-and-special-vars"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#operators"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
"comments": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.empty.cpp",
|
||||||
|
"match": "/\\*\\*/",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.comment.cpp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-doc-oldschool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-doc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-inline"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-doc-oldschool": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.documentation.cpp",
|
||||||
|
"begin": "/\\*\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-doc-oldschool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-doc": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.documentation.cpp",
|
||||||
|
"begin": "///",
|
||||||
|
"while": "^\\s*///",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-inline"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-inline": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(//.*)$",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "comment.line.double-slash.cpp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-block": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.cpp",
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "storage.type.annotation.cpp",
|
||||||
|
"match": "__attribute__\\(\\w+\\)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"constants-and-special-vars": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.language.cpp",
|
||||||
|
"match": "\\b(true|false|nullptr)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.language.cpp",
|
||||||
|
"match": "\\b(this|super)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.numeric.cpp",
|
||||||
|
"match": "\\b((0(x|X)[0-9a-fA-F]+)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#class-identifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#function-identifier"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class-identifier": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\b(bool|int|char|double|float|long|short|signed|unsigned|void)\\b",
|
||||||
|
"name": "storage.type.primitive.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "(\\b[A-Z]\\w*\\b)",
|
||||||
|
"end": "(?!<)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "support.class.cpp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#type-args"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"function-identifier": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\b([a-z_][a-zA-Z0-9_]*)\\s*\\(",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "entity.name.function.cpp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type-args": {
|
||||||
|
"begin": "(<)",
|
||||||
|
"end": "(>)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "other.source.cpp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"endCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "other.source.cpp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#class-identifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.declaration.cpp",
|
||||||
|
"match": "extends"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"keywords": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.control.cpp",
|
||||||
|
"match": "\\b(if|else|for|while|do|switch|case|break|continue|goto|return)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.cpp",
|
||||||
|
"match": "\\b(sizeof|typeid|decltype|new|delete)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.try.cpp",
|
||||||
|
"match": "\\b(try|catch|throw)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.cpp",
|
||||||
|
"match": "\\b(static|inline|virtual|override|const|volatile|explicit|friend|constexpr)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"operators": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.comparison.cpp",
|
||||||
|
"match": "(==|!=|<=?|>=?)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.arithmetic.cpp",
|
||||||
|
"match": "(\\+|\\-|\\*|\\/|%)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.assignment.cpp",
|
||||||
|
"match": "(=|\\+=|-=|\\*=|/=|%=)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.logical.cpp",
|
||||||
|
"match": "(\\&\\&|\\|\\||!)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.bitwise.cpp",
|
||||||
|
"match": "(<<|>>|\\&|\\||\\^|~)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"string-interp": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\$([a-zA-Z0-9_]+)",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "variable.parameter.cpp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.expression.cpp",
|
||||||
|
"begin": "\\$\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#constants-and-special-vars",
|
||||||
|
"name": "variable.parameter.cpp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.parameter.cpp",
|
||||||
|
"match": "[a-zA-Z0-9_]+"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.cpp",
|
||||||
|
"match": "\\\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"strings": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "string.quoted.double.cpp",
|
||||||
|
"begin": "\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.cpp",
|
||||||
|
"match": "\\\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.single.cpp",
|
||||||
|
"begin": "'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.cpp",
|
||||||
|
"match": "\\\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"punctuation": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "punctuation.comma.cpp",
|
||||||
|
"match": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "punctuation.terminator.cpp",
|
||||||
|
"match": ";"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
531
assets/highlighting/dart.json
Normal file
531
assets/highlighting/dart.json
Normal file
@ -0,0 +1,531 @@
|
|||||||
|
{
|
||||||
|
"name": "Dart",
|
||||||
|
"version": "1.2.3",
|
||||||
|
"fileTypes": ["dart"],
|
||||||
|
"scopeName": "source.dart",
|
||||||
|
|
||||||
|
"foldingStartMarker": "\\{\\s*$",
|
||||||
|
"foldingStopMarker": "^\\s*\\}",
|
||||||
|
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "meta.preprocessor.script.dart",
|
||||||
|
"match": "^(#!.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "meta.declaration.dart",
|
||||||
|
"begin": "^\\w*\\b(library|import|part of|part|export)\\b",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "keyword.other.import.dart"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": ";",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.terminator.dart"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.other.import.dart",
|
||||||
|
"match": "\\b(as|show|hide)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.dart",
|
||||||
|
"match": "\\b(if)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#punctuation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#annotations"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#keywords"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#constants-and-special-vars"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#operators"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"repository": {
|
||||||
|
"dartdoc": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(\\[.*?\\])",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "variable.name.source.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "^ {4,}(?![ \\*]).*",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "variable.name.source.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"contentName": "variable.other.source.dart",
|
||||||
|
"begin": "```.*?$",
|
||||||
|
"end": "```"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(`.*?`)",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "variable.other.source.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(`.*?`)",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "variable.other.source.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(\\* (( ).*))$",
|
||||||
|
"captures": {
|
||||||
|
"2": {
|
||||||
|
"name": "variable.other.source.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.empty.dart",
|
||||||
|
"match": "/\\*\\*/",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.comment.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-doc-oldschool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-doc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-inline"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-doc-oldschool": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.documentation.dart",
|
||||||
|
"begin": "/\\*\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-doc-oldschool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#dartdoc"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-doc": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.documentation.dart",
|
||||||
|
"begin": "///",
|
||||||
|
"while": "^\\s*///",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#dartdoc"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-inline": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "((//).*)$",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "comment.line.double-slash.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments-block": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.block.dart",
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#comments-block"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "storage.type.annotation.dart",
|
||||||
|
"match": "@[a-zA-Z]+"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"constants-and-special-vars": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.language.dart",
|
||||||
|
"match": "(?<!\\$)\\b(true|false|null)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.language.dart",
|
||||||
|
"match": "(?<!\\$)\\b(this|super)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.numeric.dart",
|
||||||
|
"match": "(?<!\\$)\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#class-identifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#function-identifier"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class-identifier": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<!\\$)\\b(bool|num|int|double|dynamic)\\b(?!\\$)",
|
||||||
|
"name": "support.class.dart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?<!\\$)\\bvoid\\b(?!\\$)",
|
||||||
|
"name": "storage.type.primitive.dart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*)\\b",
|
||||||
|
"end": "(?!<)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "support.class.dart"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#type-args"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"function-identifier": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "([_$]*[a-z][a-zA-Z0-9_$]*)(<(?:[a-zA-Z0-9_$<>?]|,\\s*|\\s+extends\\s+)+>)?[!?]?\\(",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "entity.name.function.dart"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#type-args"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type-args": {
|
||||||
|
"begin": "(<)",
|
||||||
|
"end": "(>)",
|
||||||
|
"beginCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "other.source.dart"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"endCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "other.source.dart"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#class-identifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.declaration.dart",
|
||||||
|
"match": "extends"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"keywords": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.cast.dart",
|
||||||
|
"match": "(?<!\\$)\\bas\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.catch-exception.dart",
|
||||||
|
"match": "(?<!\\$)\\b(try|on|catch|finally|throw|rethrow)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.dart",
|
||||||
|
"match": "(?<!\\$)\\b(break|case|continue|default|do|else|for|if|in|return|switch|while|when)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.dart",
|
||||||
|
"match": "(?<!\\$)\\b(sync(\\*)?|async(\\*)?|await|yield(\\*)?)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.dart",
|
||||||
|
"match": "(?<!\\$)\\bassert\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.control.new.dart",
|
||||||
|
"match": "(?<!\\$)\\b(new)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.declaration.dart",
|
||||||
|
"match": "(?<!\\$)\\b(abstract|sealed|base|interface|class|enum|extends|extension type|extension|external|factory|implements|get(?!\\()|mixin|native|operator|set(?!\\()|typedef|with|covariant)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "storage.modifier.dart",
|
||||||
|
"match": "(?<!\\$)\\b(static|final|const|required|late)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "storage.type.primitive.dart",
|
||||||
|
"match": "(?<!\\$)\\b(?:void|var)\\b(?!\\$)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"operators": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.dart",
|
||||||
|
"match": "(?<!\\$)\\b(is\\!?)\\b(?!\\$)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.ternary.dart",
|
||||||
|
"match": "\\?|:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.bitwise.dart",
|
||||||
|
"match": "(<<|>>>?|~|\\^|\\||&)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.assignment.bitwise.dart",
|
||||||
|
"match": "((&|\\^|\\||<<|>>>?)=)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.closure.dart",
|
||||||
|
"match": "(=>)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.comparison.dart",
|
||||||
|
"match": "(==|!=|<=?|>=?)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.assignment.arithmetic.dart",
|
||||||
|
"match": "(([+*/%-]|\\~)=)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.assignment.dart",
|
||||||
|
"match": "(=)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.increment-decrement.dart",
|
||||||
|
"match": "(\\-\\-|\\+\\+)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.arithmetic.dart",
|
||||||
|
"match": "(\\-|\\+|\\*|\\/|\\~\\/|%)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.logical.dart",
|
||||||
|
"match": "(!|&&|\\|\\|)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"string-interp": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\$([a-zA-Z0-9_]+)",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "variable.parameter.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.expression.dart",
|
||||||
|
"begin": "\\$\\{",
|
||||||
|
"end": "\\}",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#constants-and-special-vars",
|
||||||
|
"name": "variable.parameter.dart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#strings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "variable.parameter.dart",
|
||||||
|
"match": "[a-zA-Z0-9_]+"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.dart",
|
||||||
|
"match": "\\\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"strings": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.triple.double.dart",
|
||||||
|
"begin": "(?<!r)\"\"\"",
|
||||||
|
"end": "\"\"\"(?!\")",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#string-interp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.triple.single.dart",
|
||||||
|
"begin": "(?<!r)'''",
|
||||||
|
"end": "'''(?!')",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#string-interp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.triple.double.dart",
|
||||||
|
"begin": "r\"\"\"",
|
||||||
|
"end": "\"\"\"(?!\")"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.triple.single.dart",
|
||||||
|
"begin": "r'''",
|
||||||
|
"end": "'''(?!')"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.double.dart",
|
||||||
|
"begin": "(?<!\\|r)\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "invalid.string.newline",
|
||||||
|
"match": "\\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#string-interp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.double.dart",
|
||||||
|
"begin": "r\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "invalid.string.newline",
|
||||||
|
"match": "\\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.interpolated.single.dart",
|
||||||
|
"begin": "(?<!\\|r)'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "invalid.string.newline",
|
||||||
|
"match": "\\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#string-interp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.single.dart",
|
||||||
|
"begin": "r'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "invalid.string.newline",
|
||||||
|
"match": "\\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"punctuation": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "punctuation.comma.dart",
|
||||||
|
"match": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "punctuation.terminator.dart",
|
||||||
|
"match": ";"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "punctuation.dot.dart",
|
||||||
|
"match": "\\."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
212
assets/highlighting/json.json
Normal file
212
assets/highlighting/json.json
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
{
|
||||||
|
"fileTypes": ["json"],
|
||||||
|
"foldingStartMarker": "^\\s*[{\\[](?!.*[}\\]],?\\s*$)|[{\\[]\\s*$",
|
||||||
|
"foldingStopMarker": "^\\s*[}\\]]",
|
||||||
|
"keyEquivalent": "^~J",
|
||||||
|
"name": "JSON (Javascript Next)",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"array": {
|
||||||
|
"begin": "\\[",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.array.begin.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\\]",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.array.end.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "meta.structure.array.json",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#value"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": ",",
|
||||||
|
"name": "punctuation.separator.array.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "[^\\s\\]]",
|
||||||
|
"name": "invalid.illegal.expected-array-separator.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"comments": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"begin": "/\\*\\*",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.comment.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\\*/",
|
||||||
|
"name": "comment.block.documentation.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "/\\*",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.comment.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\\*/",
|
||||||
|
"name": "comment.block.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "punctuation.definition.comment.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"match": "(//).*$\\n?",
|
||||||
|
"name": "comment.line.double-slash.js"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"constant": {
|
||||||
|
"match": "\\b(?:true|false|null)\\b",
|
||||||
|
"name": "constant.language.json"
|
||||||
|
},
|
||||||
|
"number": {
|
||||||
|
"match": "-?(?:0|[1-9]\\d*)\n(?:\n(?:\n\\.\\d+)?\n(?:\n[eE][+-]?\\d+)?)?",
|
||||||
|
"name": "constant.numeric.json"
|
||||||
|
},
|
||||||
|
"object": {
|
||||||
|
"begin": "\\{",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.dictionary.begin.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\\}",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.dictionary.end.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "meta.structure.dictionary.json",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"comment": "the JSON object key",
|
||||||
|
"include": "#objectkey"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": ":",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.separator.dictionary.key-value.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "(,)|(?=\\})",
|
||||||
|
"endCaptures": {
|
||||||
|
"1": {
|
||||||
|
"name": "punctuation.separator.dictionary.pair.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "meta.structure.dictionary.value.json",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"comment": "the JSON object value",
|
||||||
|
"include": "#value"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "[^\\s,]",
|
||||||
|
"name": "invalid.illegal.expected-dictionary-separator.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "[^\\s\\}]",
|
||||||
|
"name": "invalid.illegal.expected-dictionary-separator.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"begin": "\"",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.string.begin.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\"",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.string.end.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "string.quoted.double.json",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#stringcontent"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"objectkey": {
|
||||||
|
"begin": "\"",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.support.type.property-name.begin.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"end": "\"",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.support.type.property-name.end.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name": "support.type.property-name.json",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#stringcontent"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"stringcontent": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4})",
|
||||||
|
"name": "constant.character.escape.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "\\\\.",
|
||||||
|
"name": "invalid.illegal.unrecognized-string-escape.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#constant"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#array"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#object"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#comments"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scopeName": "source.json",
|
||||||
|
"uuid": "8f97457b-516e-48ce-83c7-08ae12fb327a"
|
||||||
|
}
|
98
assets/highlighting/python.json
Normal file
98
assets/highlighting/python.json
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"name": "Python",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"fileTypes": ["py"],
|
||||||
|
"scopeName": "source.python",
|
||||||
|
"foldingStartMarker": "\\b(?:def|class)\\s*[^:]*:\\s*$",
|
||||||
|
"foldingStopMarker": "^\\s*\\}",
|
||||||
|
"patterns": [
|
||||||
|
{ "include": "#comments" },
|
||||||
|
{ "include": "#keywords" },
|
||||||
|
{ "include": "#constants-and-special-vars" },
|
||||||
|
{ "include": "#operators" },
|
||||||
|
{ "include": "#strings" }
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"comments": {
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "comment.line.hash.python", "match": "#.*$" },
|
||||||
|
{ "name": "comment.block.python", "begin": "'''", "end": "'''" },
|
||||||
|
{ "name": "comment.block.python", "begin": "\"\"\"", "end": "\"\"\"" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"keywords": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.control.python",
|
||||||
|
"match": "\\b(?:if|else|while|for|in|break|continue|return)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.logical.python",
|
||||||
|
"match": "\\b(?:and|or|not)\\b"
|
||||||
|
},
|
||||||
|
{ "name": "keyword.operator.assignment.python", "match": "=" },
|
||||||
|
{ "name": "storage.modifier.python", "match": "\\b(?:def|class)\\b" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"constants-and-special-vars": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.language.python",
|
||||||
|
"match": "\\b(?:True|False|None)\\b"
|
||||||
|
},
|
||||||
|
{ "name": "variable.language.python", "match": "\\b(?:self)\\b" },
|
||||||
|
{
|
||||||
|
"name": "constant.numeric.python",
|
||||||
|
"match": "\\b(?:\\d+\\.?\\d*|\\.\\d+)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"operators": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.arithmetic.python",
|
||||||
|
"match": "\\b(?:\\+|-|\\*|/|%|//)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.comparison.python",
|
||||||
|
"match": "\\b(?:==|!=|<|<=|>|>=)\\b"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "keyword.operator.logical.python",
|
||||||
|
"match": "\\b(?:and|or|not)\\b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"strings": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "string.quoted.triple.double.python",
|
||||||
|
"begin": "\"\"\"",
|
||||||
|
"end": "\"\"\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.triple.single.python",
|
||||||
|
"begin": "'''",
|
||||||
|
"end": "'''"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.double.python",
|
||||||
|
"begin": "\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [{ "include": "#string-escape" }]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.single.python",
|
||||||
|
"begin": "'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [{ "include": "#string-escape" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"string-escape": {
|
||||||
|
"patterns": [
|
||||||
|
{ "name": "constant.character.escape.python", "match": "\\\\[\"']" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
145
assets/highlighting/sql.json
Normal file
145
assets/highlighting/sql.json
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
{
|
||||||
|
"fileTypes": ["sql", "ddl", "dml"],
|
||||||
|
"foldingStartMarker": "(?i)^\\s*(begin|if|loop)\\b",
|
||||||
|
"foldingStopMarker": "(?i)^\\s*(end)\\b",
|
||||||
|
"keyEquivalent": "^~S",
|
||||||
|
"name": "PL/pgSQL (Postgres)",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"begin": "/\\*",
|
||||||
|
"end": "\\*/",
|
||||||
|
"name": "comment.block.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "--.*$",
|
||||||
|
"name": "comment.line.double-dash.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"match": "(?i)^\\s*(create)(\\s+or\\s+replace)?\\s+",
|
||||||
|
"name": "meta.create.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"name": "entity.name.type.postgres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"match": "(?i)\\b(package)(\\s+body)?\\s+(\\S+)",
|
||||||
|
"name": "meta.package.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "entity.name.type.postgres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"match": "(?i)\\b(type)\\s+\"([^\"]+)\"",
|
||||||
|
"name": "meta.type.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "entity.name.function.postgres"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"match": "(?i)\\s*(function|procedure)\\s+([-a-z0-9_.]+)",
|
||||||
|
"name": "meta.procedure.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "[!<>:]?=|<>|<|>|\\+|(?<!\\.)\\*|-|(?<!^)/|@@|\\|\\|",
|
||||||
|
"name": "keyword.operator.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(true|false|null|found)\\b",
|
||||||
|
"name": "constant.language.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "\\b\\d+(\\.\\d+)?\\b",
|
||||||
|
"name": "constant.numeric.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(if|elsif|else|end\\s+if|loop|end\\s+loop|for|foreach|array|case|end\\s+case|continue|return|goto|alias)\\b",
|
||||||
|
"name": "keyword.control.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(or|and|not|like)\\b",
|
||||||
|
"name": "keyword.operator.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(sysdate|%(isopen|found|notfound|rowcount)|commit|rollback|sqlerrm|substr|cast|decode|length|lower|upper|coalesce)\\b",
|
||||||
|
"name": "support.function.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(avg|count|sum|max|min|nvl|trim|to_date|to_char|lpad|ltrim|rpad|rtrim|trunc|to_number|regexp_split_to_array|regexp_replace)\\b",
|
||||||
|
"name": "support.function.builtin.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(sql|sqlcode)\\b",
|
||||||
|
"name": "variable.language.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(p(i|o|io)_[-a-z0-9_]+)\\b",
|
||||||
|
"name": "variable.parameter.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(l_[-a-z0-9_]+)\\b",
|
||||||
|
"name": "variable.other.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(immutable|volatile|stable|serial|primary|key|references|comment|column|schema|authorization|get|diagnostics|returning|drop|all|raise|notice|warning|exception|external|security|definer|language|grant|execute|on|to|function|procedure|returns|end|then|deterministic|exception|when|others|subtype|constant|range|binary_integer|declare|begin|in|out|is|as|exit|open|fetch|into|close|type|rowtype|default|\\.(extend|count|first|last|next|nextval|currval)|cost|alter|owner)\\b",
|
||||||
|
"name": "keyword.other.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(select|perform|from|where|order\\s+by|group\\s+by|asc|desc|update|set|insert|into|values|delete|from|distinct|union|having|limit|table|of|prepare|(inner|left|outer) join)\\b",
|
||||||
|
"name": "keyword.other.sql.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "[$][0-9]+",
|
||||||
|
"name": "storage.type.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(dbms_lock|dbms_output)\\b",
|
||||||
|
"name": "support.class.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(put_line)\\b",
|
||||||
|
"name": "support.function.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "'",
|
||||||
|
"end": "'",
|
||||||
|
"name": "string.quoted.single.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "\"",
|
||||||
|
"end": "\"",
|
||||||
|
"name": "string.quoted.double.postgres"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?i)\\b(number|integer|bigint|varchar2|varchar|boolean|date|setof|record|query|numeric|void|character varying|text|([-a-z0-9_.]+%(row)?type))\\b",
|
||||||
|
"name": "storage.type.postgres"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scopeName": "source.plpgsql.postgres",
|
||||||
|
"uuid": "28DCE4DD-F5E1-4ED3-8847-64DA6B1F9163"
|
||||||
|
}
|
66
assets/highlighting/yaml.json
Normal file
66
assets/highlighting/yaml.json
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"name": "YAML",
|
||||||
|
"fileTypes": ["yaml", "yml"],
|
||||||
|
"scopeName": "source.yaml",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "comment.line.number-sign.yaml",
|
||||||
|
"match": "#.*",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.comment.yaml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "entity.name.tag.yaml",
|
||||||
|
"match": "^\\s*\\w+",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.definition.tag.yaml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "punctuation.separator.key-value.yaml",
|
||||||
|
"match": ":",
|
||||||
|
"captures": {
|
||||||
|
"0": {
|
||||||
|
"name": "punctuation.separator.key-value.yaml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.double.yaml",
|
||||||
|
"begin": "\"",
|
||||||
|
"end": "\"",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.yaml",
|
||||||
|
"match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{6}|.)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "string.quoted.single.yaml",
|
||||||
|
"begin": "'",
|
||||||
|
"end": "'",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "constant.character.escape.yaml",
|
||||||
|
"match": "''"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"scalar-plain": {
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "\\b(\\w+)\\b",
|
||||||
|
"name": "scalar.plain.yaml"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -468,5 +468,18 @@
|
|||||||
"all": "All",
|
"all": "All",
|
||||||
"unablePreview": "Unable to preview",
|
"unablePreview": "Unable to preview",
|
||||||
"dashboardNav": "Dash",
|
"dashboardNav": "Dash",
|
||||||
"accountNav": "You"
|
"accountNav": "You",
|
||||||
|
"performance": "Performance",
|
||||||
|
"animatedMessageList": "Non-animated message list",
|
||||||
|
"animatedMessageListDesc": "Remove animation effects in message list, to reduce cause lag",
|
||||||
|
"theme": "Theme",
|
||||||
|
"globalTheme": "Global theme",
|
||||||
|
"agedTheme": "Old school style theme",
|
||||||
|
"agedThemeDesc": "Downgrade the global theme to Material Design 2. Unexpected issues may occur. For experimental use only.",
|
||||||
|
"appBackgroundImage": "Global background image",
|
||||||
|
"appBackgroundImageDesc": "The global background image will be displayed on all pages",
|
||||||
|
"authPreferences": "Auth preferences",
|
||||||
|
"authPreferencesDesc": "Set the security behavior of your account",
|
||||||
|
"authMaximumAuthSteps": "Maximum authentication steps",
|
||||||
|
"authMaximumAuthStepsDesc": "The maximum number of authentication steps when logging in, higher value is more secure, lower value is more convenient; default is 2"
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@
|
|||||||
"channelMembersAddHint": "到 @channel",
|
"channelMembersAddHint": "到 @channel",
|
||||||
"channelType": "频道类型",
|
"channelType": "频道类型",
|
||||||
"channelTypeCommon": "普通频道",
|
"channelTypeCommon": "普通频道",
|
||||||
"channelTypeDirect": "私信聊天",
|
"channelTypeDirect": "私信",
|
||||||
"channelAdjust": "调整频道",
|
"channelAdjust": "调整频道",
|
||||||
"channelDetail": "频道详情",
|
"channelDetail": "频道详情",
|
||||||
"channelSettings": "频道设置",
|
"channelSettings": "频道设置",
|
||||||
@ -464,5 +464,18 @@
|
|||||||
"all": "全部",
|
"all": "全部",
|
||||||
"unablePreview": "无法预览",
|
"unablePreview": "无法预览",
|
||||||
"dashboardNav": "仪表盘",
|
"dashboardNav": "仪表盘",
|
||||||
"accountNav": "您"
|
"accountNav": "您",
|
||||||
|
"performance": "性能",
|
||||||
|
"animatedMessageList": "无动画消息列表",
|
||||||
|
"animatedMessageListDesc": "在消息列表中禁用动画效果",
|
||||||
|
"theme": "主题",
|
||||||
|
"globalTheme": "全局应用主题",
|
||||||
|
"agedTheme": "过时主题",
|
||||||
|
"agedThemeDesc": "将全局主题降级为 Material Design 2,可能发生意料之外的问题,仅供实验使用",
|
||||||
|
"appBackgroundImage": "全局背景图片",
|
||||||
|
"appBackgroundImageDesc": "全局背景图片将会在所有页面中展示",
|
||||||
|
"authPreferences": "安全偏好设置",
|
||||||
|
"authPreferencesDesc": "调整账号的安全行为模式",
|
||||||
|
"authMaximumAuthSteps": "最大认证步数",
|
||||||
|
"authMaximumAuthStepsDesc": "登陆时最多的验证步数,值越高则越安全,反之则会相对方便;默认设置为 2"
|
||||||
}
|
}
|
||||||
|
134
ios/Podfile.lock
134
ios/Podfile.lock
@ -38,45 +38,45 @@ PODS:
|
|||||||
- file_picker (0.0.1):
|
- file_picker (0.0.1):
|
||||||
- DKImagePickerController/PhotoGallery
|
- DKImagePickerController/PhotoGallery
|
||||||
- Flutter
|
- Flutter
|
||||||
- Firebase/Analytics (11.0.0):
|
- Firebase/Analytics (11.2.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- Firebase/Core (11.0.0):
|
- Firebase/Core (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseAnalytics (~> 11.0.0)
|
- FirebaseAnalytics (~> 11.2.0)
|
||||||
- Firebase/CoreOnly (11.0.0):
|
- Firebase/CoreOnly (11.2.0):
|
||||||
- FirebaseCore (= 11.0.0)
|
- FirebaseCore (= 11.2.0)
|
||||||
- Firebase/Crashlytics (11.0.0):
|
- Firebase/Crashlytics (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseCrashlytics (~> 11.0.0)
|
- FirebaseCrashlytics (~> 11.2.0)
|
||||||
- Firebase/Messaging (11.0.0):
|
- Firebase/Messaging (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseMessaging (~> 11.0.0)
|
- FirebaseMessaging (~> 11.2.0)
|
||||||
- Firebase/Performance (11.0.0):
|
- Firebase/Performance (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebasePerformance (~> 11.0.0)
|
- FirebasePerformance (~> 11.2.0)
|
||||||
- firebase_analytics (11.3.2):
|
- firebase_analytics (11.3.3):
|
||||||
- Firebase/Analytics (= 11.0.0)
|
- Firebase/Analytics (= 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- firebase_core (3.5.0):
|
- firebase_core (3.6.0):
|
||||||
- Firebase/CoreOnly (= 11.0.0)
|
- Firebase/CoreOnly (= 11.2.0)
|
||||||
- Flutter
|
- Flutter
|
||||||
- firebase_crashlytics (4.1.2):
|
- firebase_crashlytics (4.1.3):
|
||||||
- Firebase/Crashlytics (= 11.0.0)
|
- Firebase/Crashlytics (= 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- firebase_messaging (15.1.2):
|
- firebase_messaging (15.1.3):
|
||||||
- Firebase/Messaging (= 11.0.0)
|
- Firebase/Messaging (= 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- firebase_performance (0.10.0-7):
|
- firebase_performance (0.10.0-8):
|
||||||
- Firebase/Performance (= 11.0.0)
|
- Firebase/Performance (= 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- FirebaseABTesting (11.2.0):
|
- FirebaseABTesting (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseAnalytics (11.0.0):
|
- FirebaseAnalytics (11.2.0):
|
||||||
- FirebaseAnalytics/AdIdSupport (= 11.0.0)
|
- FirebaseAnalytics/AdIdSupport (= 11.2.0)
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
@ -84,24 +84,24 @@ PODS:
|
|||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseAnalytics/AdIdSupport (11.0.0):
|
- FirebaseAnalytics/AdIdSupport (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleAppMeasurement (= 11.0.0)
|
- GoogleAppMeasurement (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseCore (11.0.0):
|
- FirebaseCore (11.2.0):
|
||||||
- FirebaseCoreInternal (~> 11.0)
|
- FirebaseCoreInternal (~> 11.0)
|
||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- GoogleUtilities/Logger (~> 8.0)
|
- GoogleUtilities/Logger (~> 8.0)
|
||||||
- FirebaseCoreExtension (11.2.0):
|
- FirebaseCoreExtension (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseCoreInternal (11.2.0):
|
- FirebaseCoreInternal (11.3.0):
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- FirebaseCrashlytics (11.0.0):
|
- FirebaseCrashlytics (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- FirebaseRemoteConfigInterop (~> 11.0)
|
- FirebaseRemoteConfigInterop (~> 11.0)
|
||||||
@ -110,12 +110,12 @@ PODS:
|
|||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- PromisesObjC (~> 2.4)
|
- PromisesObjC (~> 2.4)
|
||||||
- FirebaseInstallations (11.2.0):
|
- FirebaseInstallations (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- PromisesObjC (~> 2.4)
|
- PromisesObjC (~> 2.4)
|
||||||
- FirebaseMessaging (11.0.0):
|
- FirebaseMessaging (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleDataTransport (~> 10.0)
|
- GoogleDataTransport (~> 10.0)
|
||||||
@ -124,7 +124,7 @@ PODS:
|
|||||||
- GoogleUtilities/Reachability (~> 8.0)
|
- GoogleUtilities/Reachability (~> 8.0)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebasePerformance (11.0.0):
|
- FirebasePerformance (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- FirebaseRemoteConfig (~> 11.0)
|
- FirebaseRemoteConfig (~> 11.0)
|
||||||
@ -134,7 +134,7 @@ PODS:
|
|||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseRemoteConfig (11.2.0):
|
- FirebaseRemoteConfig (11.3.0):
|
||||||
- FirebaseABTesting (~> 11.0)
|
- FirebaseABTesting (~> 11.0)
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
@ -142,8 +142,8 @@ PODS:
|
|||||||
- FirebaseSharedSwift (~> 11.0)
|
- FirebaseSharedSwift (~> 11.0)
|
||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- FirebaseRemoteConfigInterop (11.2.0)
|
- FirebaseRemoteConfigInterop (11.3.0)
|
||||||
- FirebaseSessions (11.2.0):
|
- FirebaseSessions (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseCoreExtension (~> 11.0)
|
- FirebaseCoreExtension (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
@ -152,7 +152,7 @@ PODS:
|
|||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- PromisesSwift (~> 2.1)
|
- PromisesSwift (~> 2.1)
|
||||||
- FirebaseSharedSwift (11.2.0)
|
- FirebaseSharedSwift (11.3.0)
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_app_update (0.0.1):
|
- flutter_app_update (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
@ -172,21 +172,21 @@ PODS:
|
|||||||
- gal (1.0.0):
|
- gal (1.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- GoogleAppMeasurement (11.0.0):
|
- GoogleAppMeasurement (11.2.0):
|
||||||
- GoogleAppMeasurement/AdIdSupport (= 11.0.0)
|
- GoogleAppMeasurement/AdIdSupport (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- GoogleAppMeasurement/AdIdSupport (11.0.0):
|
- GoogleAppMeasurement/AdIdSupport (11.2.0):
|
||||||
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.0.0)
|
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- GoogleAppMeasurement/WithoutAdIdSupport (11.0.0):
|
- GoogleAppMeasurement/WithoutAdIdSupport (11.2.0):
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
@ -269,7 +269,7 @@ PODS:
|
|||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- sqflite (0.0.3):
|
- sqflite_darwin (0.0.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- "sqlite3 (3.46.1+1)":
|
- "sqlite3 (3.46.1+1)":
|
||||||
@ -334,7 +334,7 @@ DEPENDENCIES:
|
|||||||
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
|
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
|
||||||
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)
|
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
|
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
|
||||||
@ -437,8 +437,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/share_plus/ios"
|
:path: ".symlinks/plugins/share_plus/ios"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||||
sqflite:
|
sqflite_darwin:
|
||||||
:path: ".symlinks/plugins/sqflite/darwin"
|
:path: ".symlinks/plugins/sqflite_darwin/darwin"
|
||||||
sqlite3_flutter_libs:
|
sqlite3_flutter_libs:
|
||||||
:path: ".symlinks/plugins/sqlite3_flutter_libs/ios"
|
:path: ".symlinks/plugins/sqlite3_flutter_libs/ios"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
@ -454,25 +454,25 @@ SPEC CHECKSUMS:
|
|||||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||||
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
|
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
|
||||||
Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9
|
Firebase: 98e6bf5278170668a7983e12971a66b2cd57fc8c
|
||||||
firebase_analytics: 4fd10182fd08bb8358f26ac8aca8dad7b6d0f592
|
firebase_analytics: fbc57838bdb94eef1e0ff504f127d974ff2981ad
|
||||||
firebase_core: 2ec6b789859c7c24766344ec71fdf78639402d56
|
firebase_core: 2bedc3136ec7c7b8561c6123ed0239387b53f2af
|
||||||
firebase_crashlytics: 60630a0f91ee432275fa1660fd8593079761448a
|
firebase_crashlytics: 37d104d457b51760b48504a93a12b3bf70995d77
|
||||||
firebase_messaging: a18e1e02b2e8e69097c8173e0c851be223b21c50
|
firebase_messaging: 15d114e1a41fc31e4fbabcd48d765a19eec94a38
|
||||||
firebase_performance: 12d45fdf120992fa879d990929bf73d4a5ced053
|
firebase_performance: 26ad47755d3e8d7b04b9bb36bdfbf1cec8d8dfcc
|
||||||
FirebaseABTesting: 2104d957ce33888a3d6f3bde298cdee376dde8f1
|
FirebaseABTesting: c4559fcd2eba9f6bdaf0599e2c37ded01c343e4c
|
||||||
FirebaseAnalytics: 27eb78b97880ea4a004839b9bac0b58880f5a92a
|
FirebaseAnalytics: c36efd5710c60c17558650fa58c2066eca7e9265
|
||||||
FirebaseCore: 3cf438f431f18c12cdf2aaf64434648b63f7e383
|
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
|
||||||
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de
|
FirebaseCoreExtension: 30bb063476ef66cd46925243d64ad8b2c8ac3264
|
||||||
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5
|
FirebaseCoreInternal: ac26d09a70c730e497936430af4e60fb0c68ec4e
|
||||||
FirebaseCrashlytics: 745d8f0221fe49c62865391d1bf56f5a12eeec0b
|
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
|
||||||
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a
|
FirebaseInstallations: 58cf94dabf1e2bb2fa87725a9be5c2249171cda0
|
||||||
FirebaseMessaging: d2d1d9c62c46dd2db49a952f7deb5b16ad2c9742
|
FirebaseMessaging: c9ec7b90c399c7a6100297e9d16f8a27fc7f7152
|
||||||
FirebasePerformance: efdc02bacb1b4710588c9f867011605c081cdf79
|
FirebasePerformance: c39138c0700b8ef6040f0b80b5707320808e2862
|
||||||
FirebaseRemoteConfig: fca0b2d017fc1de52b28a4e5bcf2007c1a840457
|
FirebaseRemoteConfig: 5be2ca4f9870d475b39214210955fdaeecf7e5ca
|
||||||
FirebaseRemoteConfigInterop: 477b26fdeb8fb5fbaf22fa9db5343b42289dc7db
|
FirebaseRemoteConfigInterop: c3a5c31b3c22079f41ba1dc645df889d9ce38cb9
|
||||||
FirebaseSessions: adcec8b72d0066a385e3affcd1bcb1ebb3908ce6
|
FirebaseSessions: 655ff17f3cc1a635cbdc2d69b953878001f9e25b
|
||||||
FirebaseSharedSwift: 7a0d78d155ede78407f0fdc89fbc914014c7c540
|
FirebaseSharedSwift: d39c2ad64a11a8d936ce25a42b00df47078bb59c
|
||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc
|
flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc
|
||||||
flutter_background_service_ios: e30e0d3ee69e4cee66272d0c78eacd48c2e94aac
|
flutter_background_service_ios: e30e0d3ee69e4cee66272d0c78eacd48c2e94aac
|
||||||
@ -482,7 +482,7 @@ SPEC CHECKSUMS:
|
|||||||
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
||||||
flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f
|
flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f
|
||||||
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
|
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
|
||||||
GoogleAppMeasurement: 6e49ffac7d3f2c3ded9cc663f912a13b67bbd0de
|
GoogleAppMeasurement: 76d4f8b36b03bd8381fa9a7fe2cc7f99c0a2e93a
|
||||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||||
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
||||||
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
|
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
|
||||||
@ -505,7 +505,7 @@ SPEC CHECKSUMS:
|
|||||||
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
|
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
|
||||||
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
||||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
|
||||||
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
|
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
|
||||||
sqlite3_flutter_libs: c00457ebd31e59fa6bb830380ddba24d44fbcd3b
|
sqlite3_flutter_libs: c00457ebd31e59fa6bb830380ddba24d44fbcd3b
|
||||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||||
|
@ -83,7 +83,6 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>CFBundleLocalizations</key>
|
<key>CFBundleLocalizations</key>
|
||||||
<array>
|
<array>
|
||||||
<string>zh_CN</string>
|
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIStatusBarHidden</key>
|
<key>UIStatusBarHidden</key>
|
||||||
|
@ -17,6 +17,7 @@ import 'package:solian/providers/relation.dart';
|
|||||||
import 'package:solian/providers/theme_switcher.dart';
|
import 'package:solian/providers/theme_switcher.dart';
|
||||||
import 'package:solian/providers/websocket.dart';
|
import 'package:solian/providers/websocket.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
import 'package:flutter_app_update/flutter_app_update.dart';
|
import 'package:flutter_app_update/flutter_app_update.dart';
|
||||||
import 'package:version/version.dart';
|
import 'package:version/version.dart';
|
||||||
@ -255,8 +256,7 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_isBusy || _isErrored) {
|
if (_isBusy || _isErrored) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Material(
|
child: RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
import 'package:solian/models/pagination.dart';
|
import 'package:solian/models/pagination.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
|
import 'package:solian/providers/content/attachment.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
import 'package:solian/providers/last_read.dart';
|
import 'package:solian/providers/last_read.dart';
|
||||||
|
|
||||||
@ -31,9 +34,18 @@ class PostListController extends GetxController {
|
|||||||
pagingController.addPageRequestListener(_onPagingControllerRequest);
|
pagingController.addPageRequestListener(_onPagingControllerRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Completer<void>? _pagingLoadCompleter;
|
||||||
|
|
||||||
Future<void> _onPagingControllerRequest(int pageKey) async {
|
Future<void> _onPagingControllerRequest(int pageKey) async {
|
||||||
try {
|
try {
|
||||||
|
if (_pagingLoadCompleter != null) {
|
||||||
|
await _pagingLoadCompleter!.future;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_pagingLoadCompleter = Completer();
|
||||||
final result = await loadMore();
|
final result = await loadMore();
|
||||||
|
_pagingLoadCompleter!.complete();
|
||||||
|
_pagingLoadCompleter = null;
|
||||||
|
|
||||||
if (result != null && hasMore.value) {
|
if (result != null && hasMore.value) {
|
||||||
pagingController.appendPage(result, nextPageKey.value);
|
pagingController.appendPage(result, nextPageKey.value);
|
||||||
@ -97,9 +109,6 @@ class PostListController extends GetxController {
|
|||||||
hasMore.value = false;
|
hasMore.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final idx = <dynamic>{};
|
|
||||||
postList.retainWhere((x) => idx.add(x.id));
|
|
||||||
|
|
||||||
if (postList.isNotEmpty) {
|
if (postList.isNotEmpty) {
|
||||||
var lastId = postList.map((x) => x.id).reduce(max);
|
var lastId = postList.map((x) => x.id).reduce(max);
|
||||||
Get.find<LastReadProvider>().feedLastReadAt = lastId;
|
Get.find<LastReadProvider>().feedLastReadAt = lastId;
|
||||||
@ -111,35 +120,39 @@ class PostListController extends GetxController {
|
|||||||
Future<List<Post>?> _loadPosts(int pageKey) async {
|
Future<List<Post>?> _loadPosts(int pageKey) async {
|
||||||
isBusy.value = true;
|
isBusy.value = true;
|
||||||
|
|
||||||
final PostProvider provider = Get.find();
|
final PostProvider posts = Get.find();
|
||||||
|
|
||||||
Response resp;
|
Response resp;
|
||||||
try {
|
try {
|
||||||
if (author != null) {
|
if (author != null) {
|
||||||
resp = await provider.listPost(
|
resp = await posts.listPost(
|
||||||
pageKey,
|
pageKey,
|
||||||
author: author,
|
author: author,
|
||||||
|
take: 10,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
switch (mode.value) {
|
switch (mode.value) {
|
||||||
case 2:
|
case 2:
|
||||||
resp = await provider.listRecommendations(
|
resp = await posts.listRecommendations(
|
||||||
pageKey,
|
pageKey,
|
||||||
channel: 'shuffle',
|
channel: 'shuffle',
|
||||||
realm: realm,
|
realm: realm,
|
||||||
|
take: 10,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
resp = await provider.listRecommendations(
|
resp = await posts.listRecommendations(
|
||||||
pageKey,
|
pageKey,
|
||||||
channel: 'friends',
|
channel: 'friends',
|
||||||
realm: realm,
|
realm: realm,
|
||||||
|
take: 10,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
resp = await provider.listRecommendations(
|
resp = await posts.listRecommendations(
|
||||||
pageKey,
|
pageKey,
|
||||||
realm: realm,
|
realm: realm,
|
||||||
|
take: 10,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -153,6 +166,27 @@ class PostListController extends GetxController {
|
|||||||
final result = PaginationResult.fromJson(resp.body);
|
final result = PaginationResult.fromJson(resp.body);
|
||||||
final out = result.data?.map((e) => Post.fromJson(e)).toList();
|
final out = result.data?.map((e) => Post.fromJson(e)).toList();
|
||||||
|
|
||||||
|
final AttachmentProvider attach = Get.find();
|
||||||
|
|
||||||
|
if (out != null) {
|
||||||
|
final attachmentIds = out
|
||||||
|
.mapMany((x) => x.body['attachments'] ?? [])
|
||||||
|
.cast<String>()
|
||||||
|
.toSet()
|
||||||
|
.toList();
|
||||||
|
final attachmentOut = await attach.listMetadata(attachmentIds);
|
||||||
|
|
||||||
|
for (var idx = 0; idx < out.length; idx++) {
|
||||||
|
final rids = List<String>.from(out[idx].body['attachments'] ?? []);
|
||||||
|
out[idx].preload = PostPreload(
|
||||||
|
attachments: attachmentOut
|
||||||
|
.where((x) => x != null && rids.contains(x.rid))
|
||||||
|
.cast<Attachment>()
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
postTotal.value = result.count;
|
postTotal.value = result.count;
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:solian/models/account.dart';
|
import 'package:solian/models/account.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
import 'package:solian/models/post_categories.dart';
|
import 'package:solian/models/post_categories.dart';
|
||||||
import 'package:solian/models/realm.dart';
|
import 'package:solian/models/realm.dart';
|
||||||
|
|
||||||
part 'post.g.dart';
|
part 'post.g.dart';
|
||||||
|
|
||||||
|
class PostPreload {
|
||||||
|
List<Attachment> attachments;
|
||||||
|
|
||||||
|
PostPreload({
|
||||||
|
required this.attachments,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class Post {
|
class Post {
|
||||||
int id;
|
int id;
|
||||||
@ -33,6 +42,9 @@ class Post {
|
|||||||
Account author;
|
Account author;
|
||||||
PostMetric? metric;
|
PostMetric? metric;
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
PostPreload? preload;
|
||||||
|
|
||||||
Post({
|
Post({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
|
50
lib/models/theme.dart
Normal file
50
lib/models/theme.dart
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'theme.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable(converters: [ColorConverter()])
|
||||||
|
class SolianThemeData {
|
||||||
|
String id;
|
||||||
|
Color seedColor;
|
||||||
|
String? fontFamily;
|
||||||
|
List<String>? fontFamilyFallback;
|
||||||
|
|
||||||
|
SolianThemeData({
|
||||||
|
required this.id,
|
||||||
|
required this.seedColor,
|
||||||
|
this.fontFamily,
|
||||||
|
this.fontFamilyFallback,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SolianThemeData.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$SolianThemeDataFromJson(json);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => _$SolianThemeDataToJson(this);
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => id.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (other is SolianThemeData) {
|
||||||
|
return id == other.id;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ColorConverter extends JsonConverter<Color, int> {
|
||||||
|
const ColorConverter();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Color fromJson(int json) {
|
||||||
|
return Color(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int toJson(Color object) {
|
||||||
|
return object.value;
|
||||||
|
}
|
||||||
|
}
|
26
lib/models/theme.g.dart
Normal file
26
lib/models/theme.g.dart
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'theme.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
SolianThemeData _$SolianThemeDataFromJson(Map<String, dynamic> json) =>
|
||||||
|
SolianThemeData(
|
||||||
|
id: json['id'] as String,
|
||||||
|
seedColor:
|
||||||
|
const ColorConverter().fromJson((json['seed_color'] as num).toInt()),
|
||||||
|
fontFamily: json['font_family'] as String?,
|
||||||
|
fontFamilyFallback: (json['font_family_fallback'] as List<dynamic>?)
|
||||||
|
?.map((e) => e as String)
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$SolianThemeDataToJson(SolianThemeData instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'seed_color': const ColorConverter().toJson(instance.seedColor),
|
||||||
|
'font_family': instance.fontFamily,
|
||||||
|
'font_family_fallback': instance.fontFamilyFallback,
|
||||||
|
};
|
@ -125,7 +125,7 @@ class AuthProvider extends GetConnect {
|
|||||||
userAgent: await ServiceFinder.getUserAgent(),
|
userAgent: await ServiceFinder.getUserAgent(),
|
||||||
sendUserAgent: true,
|
sendUserAgent: true,
|
||||||
);
|
);
|
||||||
client.httpClient.addAuthenticator(requestAuthenticator);
|
client.httpClient.addRequestModifier(requestAuthenticator);
|
||||||
client.httpClient.baseUrl = ServiceFinder.buildUrl(service, null);
|
client.httpClient.baseUrl = ServiceFinder.buildUrl(service, null);
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
|
@ -41,6 +41,7 @@ class AttachmentProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pendingQuery.isNotEmpty) {
|
||||||
final resp = await get(
|
final resp = await get(
|
||||||
'/attachments?take=${pendingQuery.length}&id=${pendingQuery.join(',')}',
|
'/attachments?take=${pendingQuery.length}&id=${pendingQuery.join(',')}',
|
||||||
);
|
);
|
||||||
@ -63,6 +64,7 @@ class AttachmentProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -3,22 +3,11 @@ import 'package:solian/exceptions/request.dart';
|
|||||||
import 'package:solian/exceptions/unauthorized.dart';
|
import 'package:solian/exceptions/unauthorized.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/services.dart';
|
|
||||||
|
|
||||||
class PostProvider extends GetConnect {
|
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
httpClient.baseUrl = ServiceFinder.buildUrl('interactive', null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
class PostProvider extends GetxController {
|
||||||
Future<Response> seeWhatsNew(int pivot) async {
|
Future<Response> seeWhatsNew(int pivot) async {
|
||||||
GetConnect client;
|
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.value) {
|
final client = await auth.configureClient('co');
|
||||||
client = await auth.configureClient('co');
|
|
||||||
} else {
|
|
||||||
client = await ServiceFinder.configureClient('co');
|
|
||||||
}
|
|
||||||
final resp = await client.get('/whats-new?pivot=$pivot');
|
final resp = await client.get('/whats-new?pivot=$pivot');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw RequestException(resp);
|
throw RequestException(resp);
|
||||||
@ -28,19 +17,14 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> listRecommendations(int page,
|
Future<Response> listRecommendations(int page,
|
||||||
{String? realm, String? channel}) async {
|
{String? realm, String? channel, int take = 10}) async {
|
||||||
GetConnect client;
|
|
||||||
final AuthProvider auth = Get.find();
|
|
||||||
final queries = [
|
final queries = [
|
||||||
'take=${10}',
|
'take=$take',
|
||||||
'offset=$page',
|
'offset=$page',
|
||||||
if (realm != null) 'realm=$realm',
|
if (realm != null) 'realm=$realm',
|
||||||
];
|
];
|
||||||
if (auth.isAuthorized.value) {
|
final AuthProvider auth = Get.find();
|
||||||
client = await auth.configureClient('co');
|
final client = await auth.configureClient('interactive');
|
||||||
} else {
|
|
||||||
client = await ServiceFinder.configureClient('co');
|
|
||||||
}
|
|
||||||
final resp = await client.get(
|
final resp = await client.get(
|
||||||
channel == null
|
channel == null
|
||||||
? '/recommendations?${queries.join('&')}'
|
? '/recommendations?${queries.join('&')}'
|
||||||
@ -71,16 +55,18 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> listPost(int page,
|
Future<Response> listPost(int page,
|
||||||
{String? realm, String? author, tag, category}) async {
|
{String? realm, String? author, tag, category, int take = 10}) async {
|
||||||
final queries = [
|
final queries = [
|
||||||
'take=${10}',
|
'take=$take',
|
||||||
'offset=$page',
|
'offset=$page',
|
||||||
if (tag != null) 'tag=$tag',
|
if (tag != null) 'tag=$tag',
|
||||||
if (category != null) 'category=$category',
|
if (category != null) 'category=$category',
|
||||||
if (author != null) 'author=$author',
|
if (author != null) 'author=$author',
|
||||||
if (realm != null) 'realm=$realm',
|
if (realm != null) 'realm=$realm',
|
||||||
];
|
];
|
||||||
final resp = await get('/posts?${queries.join('&')}');
|
final AuthProvider auth = Get.find();
|
||||||
|
final client = await auth.configureClient('co');
|
||||||
|
final resp = await client.get('/posts?${queries.join('&')}');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw RequestException(resp);
|
throw RequestException(resp);
|
||||||
}
|
}
|
||||||
@ -89,7 +75,10 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> listPostReplies(String alias, int page) async {
|
Future<Response> listPostReplies(String alias, int page) async {
|
||||||
final resp = await get('/posts/$alias/replies?take=${10}&offset=$page');
|
final AuthProvider auth = Get.find();
|
||||||
|
final client = await auth.configureClient('co');
|
||||||
|
final resp =
|
||||||
|
await client.get('/posts/$alias/replies?take=${10}&offset=$page');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw RequestException(resp);
|
throw RequestException(resp);
|
||||||
}
|
}
|
||||||
@ -98,7 +87,9 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Post>> listPostFeaturedReply(String alias, {int take = 1}) async {
|
Future<List<Post>> listPostFeaturedReply(String alias, {int take = 1}) async {
|
||||||
final resp = await get('/posts/$alias/replies/featured?take=$take');
|
final AuthProvider auth = Get.find();
|
||||||
|
final client = await auth.configureClient('co');
|
||||||
|
final resp = await client.get('/posts/$alias/replies/featured?take=$take');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw RequestException(resp);
|
throw RequestException(resp);
|
||||||
}
|
}
|
||||||
@ -107,16 +98,9 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> getPost(String alias) async {
|
Future<Response> getPost(String alias) async {
|
||||||
final resp = await get('/posts/$alias');
|
final AuthProvider auth = Get.find();
|
||||||
if (resp.statusCode != 200) {
|
final client = await auth.configureClient('co');
|
||||||
throw RequestException(resp);
|
final resp = await client.get('/posts/$alias');
|
||||||
}
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<Response> getArticle(String alias) async {
|
|
||||||
final resp = await get('/articles/$alias');
|
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw RequestException(resp);
|
throw RequestException(resp);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:solian/models/theme.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
|
|
||||||
class ThemeSwitcher extends ChangeNotifier {
|
class ThemeSwitcher extends ChangeNotifier {
|
||||||
@ -13,11 +16,21 @@ class ThemeSwitcher extends ChangeNotifier {
|
|||||||
|
|
||||||
Future<void> restoreTheme() async {
|
Future<void> restoreTheme() async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
if (prefs.containsKey('global_theme_color')) {
|
if (prefs.containsKey('global_theme')) {
|
||||||
final value = prefs.getInt('global_theme_color')!;
|
final value = SolianThemeData.fromJson(
|
||||||
final color = Color(value);
|
jsonDecode(prefs.getString('global_theme')!),
|
||||||
lightThemeData = AppTheme.build(Brightness.light, seedColor: color);
|
);
|
||||||
darkThemeData = AppTheme.build(Brightness.dark, seedColor: color);
|
final agedTheme = prefs.getBool('aged_theme');
|
||||||
|
lightThemeData = AppTheme.buildFromData(
|
||||||
|
Brightness.light,
|
||||||
|
value,
|
||||||
|
useMaterial3: agedTheme == null ? true : !agedTheme,
|
||||||
|
);
|
||||||
|
darkThemeData = AppTheme.buildFromData(
|
||||||
|
Brightness.dark,
|
||||||
|
value,
|
||||||
|
useMaterial3: agedTheme == null ? true : !agedTheme,
|
||||||
|
);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,4 +40,25 @@ class ThemeSwitcher extends ChangeNotifier {
|
|||||||
darkThemeData = dark;
|
darkThemeData = dark;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> setThemeData(SolianThemeData? data) async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
if (data == null) {
|
||||||
|
prefs.remove('global_theme');
|
||||||
|
} else {
|
||||||
|
prefs.setString(
|
||||||
|
'global_theme',
|
||||||
|
jsonEncode(data.toJson()),
|
||||||
|
);
|
||||||
|
lightThemeData = AppTheme.buildFromData(Brightness.light, data);
|
||||||
|
darkThemeData = AppTheme.buildFromData(Brightness.dark, data);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setAgedTheme(bool enabled) async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
prefs.setBool('aged_theme', enabled);
|
||||||
|
await restoreTheme();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
@ -165,11 +166,13 @@ class WebSocketProvider extends GetxController {
|
|||||||
|
|
||||||
late final String? token;
|
late final String? token;
|
||||||
late final String provider;
|
late final String provider;
|
||||||
final deviceUuid = await _getDeviceUuid();
|
var deviceUuid = await _getDeviceUuid();
|
||||||
|
|
||||||
if (deviceUuid == null || deviceUuid.isEmpty) {
|
if (deviceUuid == null || deviceUuid.isEmpty) {
|
||||||
log("Unable to active push notifications, couldn't get device uuid");
|
log("Unable to active push notifications, couldn't get device uuid");
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
deviceUuid = md5.convert(utf8.encode(deviceUuid)).toString();
|
||||||
log('Device UUID is $deviceUuid');
|
log('Device UUID is $deviceUuid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import 'package:solian/screens/about.dart';
|
|||||||
import 'package:solian/screens/account.dart';
|
import 'package:solian/screens/account.dart';
|
||||||
import 'package:solian/screens/account/friend.dart';
|
import 'package:solian/screens/account/friend.dart';
|
||||||
import 'package:solian/screens/account/preferences/notifications.dart';
|
import 'package:solian/screens/account/preferences/notifications.dart';
|
||||||
|
import 'package:solian/screens/account/preferences/security.dart';
|
||||||
import 'package:solian/screens/account/profile_edit.dart';
|
import 'package:solian/screens/account/profile_edit.dart';
|
||||||
import 'package:solian/screens/account/profile_page.dart';
|
import 'package:solian/screens/account/profile_page.dart';
|
||||||
import 'package:solian/screens/auth/signin.dart';
|
import 'package:solian/screens/auth/signin.dart';
|
||||||
@ -178,6 +179,7 @@ abstract class AppRouter {
|
|||||||
final arguments = state.extra as ChannelDetailArguments;
|
final arguments = state.extra as ChannelDetailArguments;
|
||||||
return TitleShell(
|
return TitleShell(
|
||||||
state: state,
|
state: state,
|
||||||
|
isResponsive: true,
|
||||||
child: ChannelDetailScreen(
|
child: ChannelDetailScreen(
|
||||||
channel: arguments.channel,
|
channel: arguments.channel,
|
||||||
profile: arguments.profile,
|
profile: arguments.profile,
|
||||||
@ -263,6 +265,14 @@ abstract class AppRouter {
|
|||||||
child: const NotificationPreferencesScreen(),
|
child: const NotificationPreferencesScreen(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/account/preferences/auth',
|
||||||
|
name: 'authPreferences',
|
||||||
|
builder: (context, state) => TitleShell(
|
||||||
|
state: state,
|
||||||
|
child: const AuthPreferencesScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/account/view/:name',
|
path: '/account/view/:name',
|
||||||
name: 'accountProfilePage',
|
name: 'accountProfilePage',
|
||||||
|
@ -15,9 +15,7 @@ class AboutScreen extends StatelessWidget {
|
|||||||
const denseButtonStyle =
|
const denseButtonStyle =
|
||||||
ButtonStyle(visualDensity: VisualDensity(vertical: -4));
|
ButtonStyle(visualDensity: VisualDensity(vertical: -4));
|
||||||
|
|
||||||
return Material(
|
return SizedBox(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: SizedBox(
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -142,7 +140,6 @@ class AboutScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,7 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
|
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
|
|
||||||
return Material(
|
return SafeArea(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: SafeArea(
|
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
if (auth.isAuthorized.isFalse) {
|
if (auth.isAuthorized.isFalse) {
|
||||||
return Center(
|
return Center(
|
||||||
@ -108,7 +106,7 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
if (auth.userProfile.value != null)
|
if (auth.userProfile.value != null)
|
||||||
const AccountHeading().paddingOnly(bottom: 8, top: 8),
|
const AccountHeading().paddingOnly(bottom: 8, top: 16),
|
||||||
...(actionItems.map(
|
...(actionItems.map(
|
||||||
(x) => ListTile(
|
(x) => ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
||||||
@ -131,6 +129,15 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
AppRouter.instance.pushNamed('settings');
|
AppRouter.instance.pushNamed('settings');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
if (auth.isAuthorized.value)
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.lock),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
||||||
|
title: Text('authPreferences'.tr),
|
||||||
|
onTap: () {
|
||||||
|
AppRouter.instance.pushNamed('authPreferences');
|
||||||
|
},
|
||||||
|
),
|
||||||
if (auth.isAuthorized.value)
|
if (auth.isAuthorized.value)
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
||||||
@ -155,7 +162,6 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import 'package:solian/models/relations.dart';
|
|||||||
import 'package:solian/providers/relation.dart';
|
import 'package:solian/providers/relation.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/account/relative_list.dart';
|
import 'package:solian/widgets/account/relative_list.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class FriendScreen extends StatefulWidget {
|
class FriendScreen extends StatefulWidget {
|
||||||
const FriendScreen({super.key});
|
const FriendScreen({super.key});
|
||||||
@ -117,8 +118,7 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
|
@ -59,9 +59,9 @@ class _NotificationPreferencesScreenState
|
|||||||
});
|
});
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
context.showErrorDialog(RequestException(resp));
|
context.showErrorDialog(RequestException(resp));
|
||||||
}
|
} else {
|
||||||
|
|
||||||
context.showSnackbar('preferencesApplied'.tr);
|
context.showSnackbar('preferencesApplied'.tr);
|
||||||
|
}
|
||||||
|
|
||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
@ -74,9 +74,7 @@ class _NotificationPreferencesScreenState
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return Column(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
||||||
ListTile(
|
ListTile(
|
||||||
@ -112,7 +110,6 @@ class _NotificationPreferencesScreenState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
118
lib/screens/account/preferences/security.dart
Normal file
118
lib/screens/account/preferences/security.dart
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get/get_connect/http/src/exceptions/exceptions.dart';
|
||||||
|
import 'package:solian/exceptions/request.dart';
|
||||||
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/providers/auth.dart';
|
||||||
|
|
||||||
|
class AuthPreferencesScreen extends StatefulWidget {
|
||||||
|
const AuthPreferencesScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AuthPreferencesScreen> createState() => _AuthPreferencesScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AuthPreferencesScreenState extends State<AuthPreferencesScreen> {
|
||||||
|
bool _isBusy = true;
|
||||||
|
|
||||||
|
Map<String, dynamic> _config = {
|
||||||
|
'maximum_auth_steps': 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
Future<void> _getPreferences() async {
|
||||||
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
|
final auth = Get.find<AuthProvider>();
|
||||||
|
if (!auth.isAuthorized.value) throw UnauthorizedException();
|
||||||
|
|
||||||
|
final client = await auth.configureClient('id');
|
||||||
|
final resp = await client.get('/preferences/auth');
|
||||||
|
if (resp.statusCode != 200 && resp.statusCode != 404) {
|
||||||
|
context.showErrorDialog(RequestException(resp));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resp.statusCode == 200) {
|
||||||
|
_config = resp.body;
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() => _isBusy = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _savePreferences() async {
|
||||||
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
|
final auth = Get.find<AuthProvider>();
|
||||||
|
if (!auth.isAuthorized.value) throw UnauthorizedException();
|
||||||
|
|
||||||
|
final client = await auth.configureClient('id');
|
||||||
|
final resp = await client.put('/preferences/auth', _config);
|
||||||
|
if (resp.statusCode != 200) {
|
||||||
|
context.showErrorDialog(RequestException(resp));
|
||||||
|
} else {
|
||||||
|
context.showSnackbar('preferencesApplied'.tr);
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() => _isBusy = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_getPreferences();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
||||||
|
ListTile(
|
||||||
|
tileColor: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
leading: const Icon(Icons.save),
|
||||||
|
title: Text('save'.tr),
|
||||||
|
enabled: !_isBusy,
|
||||||
|
onTap: () {
|
||||||
|
_savePreferences();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: Text('authMaximumAuthSteps'.tr),
|
||||||
|
subtitle: Text('authMaximumAuthStepsDesc'.tr),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
trailing: SizedBox(
|
||||||
|
width: 60,
|
||||||
|
child: _isBusy
|
||||||
|
? null
|
||||||
|
: TextFormField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
|
isDense: true,
|
||||||
|
),
|
||||||
|
initialValue:
|
||||||
|
_config['maximum_auth_steps']?.toString() ?? '2',
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly
|
||||||
|
],
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
onChanged: (value) {
|
||||||
|
_config['maximum_auth_steps'] =
|
||||||
|
int.tryParse(value) ?? 2;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -186,15 +186,13 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
const double padding = 32;
|
const double padding = 32;
|
||||||
|
|
||||||
return Material(
|
return ListView(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: ListView(
|
|
||||||
children: [
|
children: [
|
||||||
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
||||||
const Gap(24),
|
const Gap(24),
|
||||||
Stack(
|
Stack(
|
||||||
children: [
|
children: [
|
||||||
AccountAvatar(content: _avatar, radius: 40),
|
AttachedCircleAvatar(content: _avatar, radius: 40),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 40,
|
left: 40,
|
||||||
@ -343,7 +341,6 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: padding),
|
).paddingSymmetric(horizontal: padding),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ import 'package:solian/widgets/app_bar_leading.dart';
|
|||||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||||
import 'package:solian/widgets/daily_sign/history_chart.dart';
|
import 'package:solian/widgets/daily_sign/history_chart.dart';
|
||||||
import 'package:solian/widgets/posts/post_list.dart';
|
import 'package:solian/widgets/posts/post_list.dart';
|
||||||
import 'package:solian/widgets/posts/post_warped_list.dart';
|
|
||||||
import 'package:solian/widgets/reports/abuse_report.dart';
|
import 'package:solian/widgets/reports/abuse_report.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
|
|
||||||
class AccountProfilePage extends StatefulWidget {
|
class AccountProfilePage extends StatefulWidget {
|
||||||
@ -230,11 +230,14 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_isBusy || _userinfo == null) {
|
if (_isBusy || _userinfo == null) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return RootContainer(
|
||||||
|
child: const Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 3,
|
length: 3,
|
||||||
child: NestedScrollView(
|
child: NestedScrollView(
|
||||||
@ -250,10 +253,15 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
height: 56,
|
height: 56,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
AppBarLeadingButton.adaptive(context) ?? const Gap(8),
|
AppBarLeadingButton.adaptive(
|
||||||
|
context,
|
||||||
|
forceBack: true,
|
||||||
|
) ??
|
||||||
|
const Gap(8),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
if (_userinfo != null)
|
if (_userinfo != null)
|
||||||
AccountAvatar(content: _userinfo!.avatar, radius: 16),
|
AttachedCircleAvatar(
|
||||||
|
content: _userinfo!.avatar, radius: 16),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -601,7 +609,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
child: Center(child: CircularProgressIndicator()),
|
child: Center(child: CircularProgressIndicator()),
|
||||||
),
|
),
|
||||||
if (_userinfo != null)
|
if (_userinfo != null)
|
||||||
PostWarpedListWidget(
|
ControlledPostListWidget(
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
controller: _postController.pagingController,
|
controller: _postController.pagingController,
|
||||||
onUpdate: () => _postController.reloadAllOver(),
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
|
@ -216,10 +216,10 @@ class _SignInScreenState extends State<SignInScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return CenteredContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: CenteredContainer(
|
|
||||||
maxWidth: 360,
|
maxWidth: 360,
|
||||||
|
child: Theme(
|
||||||
|
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
|
||||||
child: PageTransitionSwitcher(
|
child: PageTransitionSwitcher(
|
||||||
transitionBuilder: (
|
transitionBuilder: (
|
||||||
Widget child,
|
Widget child,
|
||||||
|
@ -65,9 +65,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return CenteredContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: CenteredContainer(
|
|
||||||
maxWidth: 360,
|
maxWidth: 360,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@ -96,8 +94,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'username'.tr,
|
labelText: 'username'.tr,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) =>
|
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
TextField(
|
TextField(
|
||||||
@ -110,8 +107,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'nickname'.tr,
|
labelText: 'nickname'.tr,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) =>
|
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
TextField(
|
TextField(
|
||||||
@ -124,8 +120,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'email'.tr,
|
labelText: 'email'.tr,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) =>
|
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
TextField(
|
TextField(
|
||||||
@ -139,8 +134,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'password'.tr,
|
labelText: 'password'.tr,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) =>
|
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
onSubmitted: (_) => _performAction(context),
|
onSubmitted: (_) => _performAction(context),
|
||||||
),
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
@ -206,7 +200,6 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
|
||||||
).paddingAll(24),
|
).paddingAll(24),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import 'package:solian/widgets/app_bar_leading.dart';
|
|||||||
import 'package:solian/widgets/chat/call/call_controls.dart';
|
import 'package:solian/widgets/chat/call/call_controls.dart';
|
||||||
import 'package:solian/widgets/chat/call/call_participant.dart';
|
import 'package:solian/widgets/chat/call/call_participant.dart';
|
||||||
import 'package:livekit_client/livekit_client.dart' as livekit;
|
import 'package:livekit_client/livekit_client.dart' as livekit;
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class CallScreen extends StatefulWidget {
|
class CallScreen extends StatefulWidget {
|
||||||
final bool hideAppBar;
|
final bool hideAppBar;
|
||||||
@ -197,8 +198,7 @@ class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final ChatCallProvider ctrl = Get.find();
|
final ChatCallProvider ctrl = Get.find();
|
||||||
|
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: widget.hideAppBar
|
appBar: widget.hideAppBar
|
||||||
? null
|
? null
|
||||||
|
@ -3,6 +3,7 @@ import 'dart:ui';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:solian/controllers/chat_events_controller.dart';
|
import 'package:solian/controllers/chat_events_controller.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
import 'package:solian/models/call.dart';
|
import 'package:solian/models/call.dart';
|
||||||
@ -25,6 +26,7 @@ import 'package:solian/widgets/chat/chat_event_list.dart';
|
|||||||
import 'package:solian/widgets/chat/chat_message_input.dart';
|
import 'package:solian/widgets/chat/chat_message_input.dart';
|
||||||
import 'package:solian/widgets/chat/chat_typing_indicator.dart';
|
import 'package:solian/widgets/chat/chat_typing_indicator.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class ChannelChatScreen extends StatefulWidget {
|
class ChannelChatScreen extends StatefulWidget {
|
||||||
final String alias;
|
final String alias;
|
||||||
@ -179,6 +181,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
late SharedPreferences _prefs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@ -189,11 +193,14 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
_chatController = ChatEventController();
|
_chatController = ChatEventController();
|
||||||
_chatController.initialize();
|
_chatController.initialize();
|
||||||
|
|
||||||
|
SharedPreferences.getInstance().then((inst) {
|
||||||
|
_prefs = inst;
|
||||||
_getOngoingCall();
|
_getOngoingCall();
|
||||||
_getChannel().then((_) {
|
_getChannel().then((_) {
|
||||||
_chatController.getInitialEvents(_channel!, widget.realm);
|
_chatController.getInitialEvents(_channel!, widget.realm);
|
||||||
_listenMessages();
|
_listenMessages();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -211,7 +218,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return ResponsiveRootContainer(
|
||||||
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
title: AppBarTitle(title),
|
title: AppBarTitle(title),
|
||||||
@ -247,7 +255,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
.then((value) {
|
.then((value) {
|
||||||
if (value == false) AppRouter.instance.pop();
|
if (value == false) AppRouter.instance.pop();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
final resp = Channel.fromJson(value as Map<String, dynamic>);
|
final resp =
|
||||||
|
Channel.fromJson(value as Map<String, dynamic>);
|
||||||
_getChannel(alias: resp.alias);
|
_getChannel(alias: resp.alias);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -283,6 +292,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ChatEventList(
|
child: ChatEventList(
|
||||||
|
noAnimated:
|
||||||
|
_prefs.getBool('non_animated_message_list') ??
|
||||||
|
false,
|
||||||
scope: widget.realm,
|
scope: widget.realm,
|
||||||
channel: _channel!,
|
channel: _channel!,
|
||||||
chatController: _chatController,
|
chatController: _chatController,
|
||||||
@ -348,6 +360,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import 'package:solian/providers/content/channel.dart';
|
|||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class ChannelOrganizeArguments {
|
class ChannelOrganizeArguments {
|
||||||
@ -114,8 +115,7 @@ class _ChannelOrganizeScreenState extends State<ChannelOrganizeScreen> {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Material(
|
return ResponsiveRootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: AppBarTitle('channelOrganizing'.tr),
|
title: AppBarTitle('channelOrganizing'.tr),
|
||||||
|
@ -19,6 +19,7 @@ import 'package:solian/widgets/app_bar_title.dart';
|
|||||||
import 'package:solian/widgets/channel/channel_list.dart';
|
import 'package:solian/widgets/channel/channel_list.dart';
|
||||||
import 'package:solian/widgets/chat/call/chat_call_indicator.dart';
|
import 'package:solian/widgets/chat/call/chat_call_indicator.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:solian/widgets/sidebar/empty_placeholder.dart';
|
import 'package:solian/widgets/sidebar/empty_placeholder.dart';
|
||||||
|
|
||||||
class ChatScreen extends StatelessWidget {
|
class ChatScreen extends StatelessWidget {
|
||||||
@ -26,9 +27,8 @@ class ChatScreen extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return const ResponsiveRootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
child: ChatList(),
|
||||||
child: const ChatList(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,8 +40,7 @@ class ChatListShell extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
@ -70,6 +69,8 @@ class _ChatListState extends State<ChatList> {
|
|||||||
|
|
||||||
late final ChannelProvider _channels = Get.find();
|
late final ChannelProvider _channels = Get.find();
|
||||||
|
|
||||||
|
bool _isBusy = true;
|
||||||
|
|
||||||
List<Channel> _sortChannels(List<Channel> channels) {
|
List<Channel> _sortChannels(List<Channel> channels) {
|
||||||
channels.sort(
|
channels.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
@ -118,18 +119,25 @@ class _ChatListState extends State<ChatList> {
|
|||||||
final ctrl = ChatEventController();
|
final ctrl = ChatEventController();
|
||||||
await ctrl.initialize();
|
await ctrl.initialize();
|
||||||
final messages = await ctrl.src.getLastInAllChannels();
|
final messages = await ctrl.src.getLastInAllChannels();
|
||||||
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_lastMessages = messages
|
_lastMessages = messages
|
||||||
.map((k, v) => MapEntry(k, v.firstOrNull))
|
.map((k, v) => MapEntry(k, v.firstOrNull))
|
||||||
.cast<int, LocalMessageEventTableData>();
|
.cast<int, LocalMessageEventTableData>();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_loadLastMessages().then((_) {
|
_loadLastMessages().then((_) {
|
||||||
_loadAllChannels();
|
if (!mounted) return;
|
||||||
|
_loadAllChannels().then((_) {
|
||||||
|
if (mounted) {
|
||||||
|
setState(() => _isBusy = false);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,18 +149,10 @@ class _ChatListState extends State<ChatList> {
|
|||||||
return Obx(
|
return Obx(
|
||||||
() => DefaultTabController(
|
() => DefaultTabController(
|
||||||
length: 2 + realms.availableRealms.length,
|
length: 2 + realms.availableRealms.length,
|
||||||
|
child: ResponsiveRootContainer(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: Obx(() {
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
final adaptive = AppBarLeadingButton.adaptive(context);
|
|
||||||
if (adaptive != null) return adaptive;
|
|
||||||
if (_channels.isLoading.value) {
|
|
||||||
return const CircularProgressIndicator(
|
|
||||||
strokeWidth: 3,
|
|
||||||
).paddingAll(18);
|
|
||||||
}
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}),
|
|
||||||
title: AppBarTitle('chat'.tr),
|
title: AppBarTitle('chat'.tr),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
toolbarHeight: AppTheme.toolbarHeight(context),
|
toolbarHeight: AppTheme.toolbarHeight(context),
|
||||||
@ -166,7 +166,8 @@ class _ChatListState extends State<ChatList> {
|
|||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text('channelOrganizeCommon'.tr),
|
title: Text('channelOrganizeCommon'.tr),
|
||||||
leading: const Icon(Icons.tag),
|
leading: const Icon(Icons.tag),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 8),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
AppRouter.instance.pushNamed('channelOrganizing').then(
|
AppRouter.instance.pushNamed('channelOrganizing').then(
|
||||||
@ -185,7 +186,8 @@ class _ChatListState extends State<ChatList> {
|
|||||||
FontAwesomeIcons.userGroup,
|
FontAwesomeIcons.userGroup,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 8),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final ChannelProvider channels = Get.find();
|
final ChannelProvider channels = Get.find();
|
||||||
@ -217,7 +219,8 @@ class _ChatListState extends State<ChatList> {
|
|||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 14,
|
radius: 14,
|
||||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.forum,
|
Icons.forum,
|
||||||
size: 16,
|
size: 16,
|
||||||
@ -249,7 +252,7 @@ class _ChatListState extends State<ChatList> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
AccountAvatar(
|
AttachedCircleAvatar(
|
||||||
content: x.avatar,
|
content: x.avatar,
|
||||||
radius: 14,
|
radius: 14,
|
||||||
fallbackWidget: const Icon(
|
fallbackWidget: const Icon(
|
||||||
@ -277,6 +280,26 @@ class _ChatListState extends State<ChatList> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
const ChatCallCurrentIndicator(),
|
const ChatCallCurrentIndicator(),
|
||||||
|
if (_isBusy)
|
||||||
|
Container(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surfaceContainerLow
|
||||||
|
.withOpacity(0.8),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 16,
|
||||||
|
width: 16,
|
||||||
|
child: CircularProgressIndicator(strokeWidth: 2.5),
|
||||||
|
),
|
||||||
|
const Gap(8),
|
||||||
|
Text('loading'.tr)
|
||||||
|
],
|
||||||
|
).paddingSymmetric(vertical: 8),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
children: [
|
children: [
|
||||||
@ -318,6 +341,7 @@ class _ChatListState extends State<ChatList> {
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,11 +75,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
final src = Get.find<MessagesFetchingProvider>();
|
final src = Get.find<MessagesFetchingProvider>();
|
||||||
final out = await src.getWhatsNewEvents(_lastRead.messagesLastReadAt!);
|
final out = await src.getWhatsNewEvents(_lastRead.messagesLastReadAt!);
|
||||||
if (out == null) return;
|
if (out == null) return;
|
||||||
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_currentMessages = out.$1;
|
_currentMessages = out.$1;
|
||||||
_currentMessagesCount = out.$2;
|
_currentMessagesCount = out.$2;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool _signingDaily = true;
|
bool _signingDaily = true;
|
||||||
DailySignRecord? _signRecord;
|
DailySignRecord? _signRecord;
|
||||||
@ -89,14 +91,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
try {
|
try {
|
||||||
_signRecord = await _dailySign.getToday();
|
_signRecord = await _dailySign.getToday();
|
||||||
_dailySign.listLastRecord(14).then((value) {
|
_dailySign.listLastRecord(14).then((value) {
|
||||||
|
if (mounted) {
|
||||||
setState(() => _signRecordHistory = value);
|
setState(() => _signRecordHistory = value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
context.showErrorDialog(e);
|
context.showErrorDialog(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
setState(() => _signingDaily = false);
|
setState(() => _signingDaily = false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _signDaily() async {
|
Future<void> _signDaily() async {
|
||||||
setState(() => _signingDaily = true);
|
setState(() => _signingDaily = true);
|
||||||
@ -147,7 +153,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
),
|
),
|
||||||
Text(DateFormat('yyyy/MM/dd').format(DateTime.now().toUtc())),
|
Text(DateFormat('yyyy/MM/dd').format(DateTime.now().toUtc())),
|
||||||
],
|
],
|
||||||
).paddingOnly(top: 8, left: 18, right: 18, bottom: 12),
|
).paddingOnly(top: 16, left: 18, right: 18, bottom: 12),
|
||||||
Card(
|
Card(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -354,7 +360,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_forward),
|
icon: const Icon(Icons.arrow_forward),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
AppRouter.instance.goNamed('feed');
|
AppRouter.instance.goNamed('explore');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -383,6 +389,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
onUpdate: (_) {
|
onUpdate: (_) {
|
||||||
_pullPosts();
|
_pullPosts();
|
||||||
},
|
},
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 8,
|
||||||
|
horizontal: 4,
|
||||||
|
),
|
||||||
backgroundColor: Theme.of(context)
|
backgroundColor: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.surfaceContainerLow,
|
.surfaceContainerLow,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
@ -6,15 +7,16 @@ import 'package:get/get.dart';
|
|||||||
import 'package:solian/controllers/post_list_controller.dart';
|
import 'package:solian/controllers/post_list_controller.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/navigation.dart';
|
import 'package:solian/providers/navigation.dart';
|
||||||
import 'package:solian/router.dart';
|
|
||||||
import 'package:solian/screens/account/notification.dart';
|
import 'package:solian/screens/account/notification.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/account/signin_required_overlay.dart';
|
import 'package:solian/widgets/account/signin_required_overlay.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/navigation/realm_switcher.dart';
|
import 'package:solian/widgets/navigation/realm_switcher.dart';
|
||||||
|
import 'package:solian/widgets/posts/post_creation.dart';
|
||||||
|
import 'package:solian/widgets/posts/post_list.dart';
|
||||||
import 'package:solian/widgets/posts/post_shuffle_swiper.dart';
|
import 'package:solian/widgets/posts/post_shuffle_swiper.dart';
|
||||||
import 'package:solian/widgets/posts/post_warped_list.dart';
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class ExploreScreen extends StatefulWidget {
|
class ExploreScreen extends StatefulWidget {
|
||||||
const ExploreScreen({super.key});
|
const ExploreScreen({super.key});
|
||||||
@ -56,8 +58,7 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
|
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
@ -80,26 +81,35 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
body: NestedScrollView(
|
body: NestedScrollView(
|
||||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||||
return [
|
return [
|
||||||
SliverAppBar(
|
SliverLayoutBuilder(
|
||||||
flexibleSpace: SizedBox(
|
builder: (context, constraints) {
|
||||||
|
final scrollOffset = constraints.scrollOffset;
|
||||||
|
final colorChangeOffset = 120;
|
||||||
|
|
||||||
|
final scrollProgress =
|
||||||
|
(scrollOffset / colorChangeOffset).clamp(0.0, 1.0);
|
||||||
|
final blurSigma = lerpDouble(0, 10, scrollProgress) ?? 0;
|
||||||
|
|
||||||
|
return SliverAppBar(
|
||||||
|
flexibleSpace: ClipRRect(
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(
|
||||||
|
sigmaX: blurSigma,
|
||||||
|
sigmaY: blurSigma,
|
||||||
|
),
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
height: 48,
|
height: 48,
|
||||||
child: const Row(
|
child: const Row(
|
||||||
children: [
|
children: [
|
||||||
RealmSwitcher(),
|
RealmSwitcher(),
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 8),
|
).paddingSymmetric(horizontal: 8),
|
||||||
).paddingOnly(top: MediaQuery.of(context).padding.top),
|
|
||||||
floating: true,
|
|
||||||
toolbarHeight: AppTheme.toolbarHeight(context),
|
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
|
||||||
actions: [
|
|
||||||
const BackgroundStateWidget(),
|
|
||||||
const NotificationButton(),
|
|
||||||
SizedBox(
|
|
||||||
width: AppTheme.isLargeScreen(context) ? 8 : 16,
|
|
||||||
),
|
),
|
||||||
],
|
TabBar(
|
||||||
bottom: TabBar(
|
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
dividerHeight: 0.3,
|
dividerHeight: 0.3,
|
||||||
tabAlignment: TabAlignment.fill,
|
tabAlignment: TabAlignment.fill,
|
||||||
@ -128,7 +138,8 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.shuffle_on_outlined, size: 20),
|
const Icon(Icons.shuffle_on_outlined,
|
||||||
|
size: 20),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
Text('postListShuffle'.tr),
|
Text('postListShuffle'.tr),
|
||||||
],
|
],
|
||||||
@ -136,6 +147,24 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
).paddingOnly(top: MediaQuery.of(context).padding.top),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
expandedHeight: 96,
|
||||||
|
snap: true,
|
||||||
|
floating: true,
|
||||||
|
toolbarHeight: AppTheme.toolbarHeight(context),
|
||||||
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
|
actions: [
|
||||||
|
const BackgroundStateWidget(),
|
||||||
|
const NotificationButton(),
|
||||||
|
SizedBox(
|
||||||
|
width: AppTheme.isLargeScreen(context) ? 8 : 16,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
@ -156,7 +185,13 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => _postController.reloadAllOver(),
|
onRefresh: () => _postController.reloadAllOver(),
|
||||||
child: CustomScrollView(slivers: [
|
child: CustomScrollView(slivers: [
|
||||||
PostWarpedListWidget(
|
ControlledPostListWidget(
|
||||||
|
padding: AppTheme.isLargeScreen(context)
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: 4,
|
||||||
|
vertical: 8,
|
||||||
|
)
|
||||||
|
: EdgeInsets.zero,
|
||||||
controller: _postController.pagingController,
|
controller: _postController.pagingController,
|
||||||
onUpdate: () => _postController.reloadAllOver(),
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
),
|
),
|
||||||
@ -167,7 +202,10 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
onRefresh: () => _postController.reloadAllOver(),
|
onRefresh: () => _postController.reloadAllOver(),
|
||||||
child: CustomScrollView(slivers: [
|
child: CustomScrollView(slivers: [
|
||||||
PostWarpedListWidget(
|
ControlledPostListWidget(
|
||||||
|
padding: AppTheme.isLargeScreen(context)
|
||||||
|
? EdgeInsets.symmetric(horizontal: 16)
|
||||||
|
: EdgeInsets.zero,
|
||||||
controller: _postController.pagingController,
|
controller: _postController.pagingController,
|
||||||
onUpdate: () => _postController.reloadAllOver(),
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
),
|
),
|
||||||
@ -202,106 +240,3 @@ class _ExploreScreenState extends State<ExploreScreen>
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PostCreatePopup extends StatelessWidget {
|
|
||||||
final bool hideDraftBox;
|
|
||||||
|
|
||||||
const PostCreatePopup({
|
|
||||||
super.key,
|
|
||||||
this.hideDraftBox = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final AuthProvider auth = Get.find();
|
|
||||||
|
|
||||||
if (auth.isAuthorized.isFalse) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
|
|
||||||
final List<dynamic> actionList = [
|
|
||||||
(
|
|
||||||
icon: const Icon(Icons.post_add),
|
|
||||||
label: 'postEditorModeStory'.tr,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(
|
|
||||||
context,
|
|
||||||
AppRouter.instance.pushNamed(
|
|
||||||
'postEditor',
|
|
||||||
queryParameters: {
|
|
||||||
'mode': 0.toString(),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
(
|
|
||||||
icon: const Icon(Icons.description),
|
|
||||||
label: 'postEditorModeArticle'.tr,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(
|
|
||||||
context,
|
|
||||||
AppRouter.instance.pushNamed(
|
|
||||||
'postEditor',
|
|
||||||
queryParameters: {
|
|
||||||
'mode': 1.toString(),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
(
|
|
||||||
icon: const Icon(Icons.drafts),
|
|
||||||
label: 'draftBoxOpen'.tr,
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(
|
|
||||||
context,
|
|
||||||
AppRouter.instance.pushNamed('draftBox'),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
];
|
|
||||||
|
|
||||||
return SizedBox(
|
|
||||||
height: MediaQuery.of(context).size.height * 0.38,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'postNew'.tr,
|
|
||||||
style: Theme.of(context).textTheme.headlineSmall,
|
|
||||||
).paddingOnly(left: 24, right: 24, top: 32, bottom: 16),
|
|
||||||
Expanded(
|
|
||||||
child: GridView.count(
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
crossAxisCount: 3,
|
|
||||||
children: actionList
|
|
||||||
.map((x) => Card(
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
child: InkWell(
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
|
||||||
onTap: x.onTap,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
x.icon,
|
|
||||||
const Gap(8),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
x.label,
|
|
||||||
overflow: TextOverflow.fade,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
).paddingAll(18),
|
|
||||||
),
|
|
||||||
))
|
|
||||||
.toList(),
|
|
||||||
).paddingSymmetric(horizontal: 20),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -9,6 +9,7 @@ import 'package:solian/widgets/app_bar_leading.dart';
|
|||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
import 'package:solian/widgets/posts/post_action.dart';
|
import 'package:solian/widgets/posts/post_action.dart';
|
||||||
import 'package:solian/widgets/posts/post_owned_list.dart';
|
import 'package:solian/widgets/posts/post_owned_list.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class DraftBoxScreen extends StatefulWidget {
|
class DraftBoxScreen extends StatefulWidget {
|
||||||
const DraftBoxScreen({super.key});
|
const DraftBoxScreen({super.key});
|
||||||
@ -54,8 +55,7 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||||
import 'package:solian/models/pagination.dart';
|
import 'package:solian/models/pagination.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
import 'package:solian/widgets/posts/post_warped_list.dart';
|
import 'package:solian/widgets/posts/post_list.dart';
|
||||||
|
|
||||||
import '../../models/post.dart';
|
import '../../models/post.dart';
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class _FeedSearchScreenState extends State<FeedSearchScreen> {
|
|||||||
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
PostWarpedListWidget(
|
ControlledPostListWidget(
|
||||||
controller: _pagingController,
|
controller: _pagingController,
|
||||||
onUpdate: () => _pagingController.refresh(),
|
onUpdate: () => _pagingController.refresh(),
|
||||||
),
|
),
|
||||||
|
@ -4,6 +4,7 @@ import 'package:solian/exts.dart';
|
|||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
import 'package:solian/providers/last_read.dart';
|
import 'package:solian/providers/last_read.dart';
|
||||||
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/posts/post_item.dart';
|
import 'package:solian/widgets/posts/post_item.dart';
|
||||||
import 'package:solian/widgets/posts/post_replies.dart';
|
import 'package:solian/widgets/posts/post_replies.dart';
|
||||||
|
|
||||||
@ -24,11 +25,11 @@ class PostDetailScreen extends StatefulWidget {
|
|||||||
class _PostDetailScreenState extends State<PostDetailScreen> {
|
class _PostDetailScreenState extends State<PostDetailScreen> {
|
||||||
Post? item;
|
Post? item;
|
||||||
|
|
||||||
Future<Post?> getDetail() async {
|
Future<Post?> _getDetail() async {
|
||||||
if (widget.post != null) {
|
if (widget.post != null) {
|
||||||
|
setState(() {
|
||||||
item = widget.post;
|
item = widget.post;
|
||||||
Get.find<LastReadProvider>().feedLastReadAt = item?.id;
|
});
|
||||||
return widget.post;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final PostProvider provider = Get.find();
|
final PostProvider provider = Get.find();
|
||||||
@ -47,10 +48,8 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return FutureBuilder(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
future: _getDetail(),
|
||||||
child: FutureBuilder(
|
|
||||||
future: getDetail(),
|
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (!snapshot.hasData || snapshot.data == null) {
|
if (!snapshot.hasData || snapshot.data == null) {
|
||||||
return const Center(
|
return const Center(
|
||||||
@ -69,11 +68,18 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
isFullContent: true,
|
isFullContent: true,
|
||||||
isShowReply: false,
|
isShowReply: false,
|
||||||
isContentSelectable: true,
|
isContentSelectable: true,
|
||||||
|
padding: AppTheme.isLargeScreen(context)
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: 4,
|
||||||
|
vertical: 8,
|
||||||
|
)
|
||||||
|
: EdgeInsets.zero,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: const Divider(thickness: 0.3, height: 1)
|
child: const Divider(thickness: 0.3, height: 1).paddingOnly(
|
||||||
.paddingOnly(top: 4),
|
top: 8,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: Align(
|
child: Align(
|
||||||
@ -84,14 +90,21 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
).paddingOnly(left: 24, right: 24, top: 16),
|
).paddingOnly(left: 24, right: 24, top: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PostReplyList(item: item!),
|
PostReplyList(
|
||||||
|
item: item!,
|
||||||
|
padding: AppTheme.isLargeScreen(context)
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: 4,
|
||||||
|
vertical: 8,
|
||||||
|
)
|
||||||
|
: EdgeInsets.zero,
|
||||||
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: SizedBox(height: MediaQuery.of(context).padding.bottom),
|
child: SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import 'package:solian/widgets/app_bar_title.dart';
|
|||||||
import 'package:solian/widgets/markdown_text_content.dart';
|
import 'package:solian/widgets/markdown_text_content.dart';
|
||||||
import 'package:solian/widgets/posts/post_item.dart';
|
import 'package:solian/widgets/posts/post_item.dart';
|
||||||
import 'package:badges/badges.dart' as badges;
|
import 'package:badges/badges.dart' as badges;
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class PostPublishArguments {
|
class PostPublishArguments {
|
||||||
final Post? edit;
|
final Post? edit;
|
||||||
@ -151,8 +152,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
@ -273,116 +273,69 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
),
|
),
|
||||||
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: DefaultTabController(
|
||||||
|
length: 2,
|
||||||
|
child: AppTheme.isLargeScreen(context)
|
||||||
|
? Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: _PostEditorTextField(
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: ListView(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16,
|
|
||||||
vertical: 8,
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
maxLines: null,
|
|
||||||
autofocus: true,
|
|
||||||
autocorrect: true,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
controller:
|
|
||||||
_editorController.contentController,
|
|
||||||
focusNode: _contentFocusNode,
|
focusNode: _contentFocusNode,
|
||||||
decoration: InputDecoration.collapsed(
|
controller: _editorController,
|
||||||
hintText: 'postContentPlaceholder'.tr,
|
onUpdate: () => setState(() {}),
|
||||||
),
|
|
||||||
onTapOutside: (_) => FocusManager
|
|
||||||
.instance.primaryFocus
|
|
||||||
?.unfocus(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(120)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
final textStyle = TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSurface
|
|
||||||
.withOpacity(0.75),
|
|
||||||
);
|
|
||||||
final showFactors = [
|
|
||||||
_editorController.isRestoreFromLocal.value,
|
|
||||||
_editorController.lastSaveTime.value != null,
|
|
||||||
];
|
|
||||||
final doShow = showFactors.any((x) => x);
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 4,
|
|
||||||
horizontal: 16,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
if (showFactors[0])
|
|
||||||
Text('postRestoreFromLocal'.tr,
|
|
||||||
style: textStyle)
|
|
||||||
.paddingOnly(right: 4),
|
|
||||||
if (showFactors[0])
|
|
||||||
InkWell(
|
|
||||||
child: Text('clear'.tr, style: textStyle),
|
|
||||||
onTap: () {
|
|
||||||
_editorController.localClear();
|
|
||||||
_editorController.currentClear();
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (showFactors.where((x) => x).length > 1)
|
|
||||||
Text(
|
|
||||||
'·',
|
|
||||||
style: textStyle,
|
|
||||||
).paddingSymmetric(horizontal: 8),
|
|
||||||
if (showFactors[1])
|
|
||||||
Text(
|
|
||||||
'postAutoSaveAt'.trParams({
|
|
||||||
'date': DateFormat('HH:mm:ss').format(
|
|
||||||
_editorController.lastSaveTime.value ??
|
|
||||||
DateTime.now(),
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.animate(
|
|
||||||
key: const Key('post-editor-hint-animation'),
|
|
||||||
target: doShow ? 1 : 0,
|
|
||||||
)
|
|
||||||
.fade(curve: Curves.easeInOut, duration: 300.ms);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (AppTheme.isLargeScreen(context))
|
|
||||||
const VerticalDivider(width: 0.3, thickness: 0.3)
|
const VerticalDivider(width: 0.3, thickness: 0.3)
|
||||||
.paddingSymmetric(
|
.paddingSymmetric(horizontal: 16),
|
||||||
horizontal: 16,
|
|
||||||
),
|
|
||||||
if (AppTheme.isLargeScreen(context))
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(top: 12, bottom: 64),
|
||||||
child: MarkdownTextContent(
|
child: MarkdownTextContent(
|
||||||
isAutoWarp: _editorController.mode.value == 0,
|
isAutoWarp: _editorController.mode.value == 0,
|
||||||
content: _editorController.contentController.text,
|
content:
|
||||||
|
_editorController.contentController.text,
|
||||||
parentId: 'post-editor-preview',
|
parentId: 'post-editor-preview',
|
||||||
).paddingOnly(top: 12, right: 16),
|
).paddingOnly(right: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
TabBar(
|
||||||
|
tabs: [
|
||||||
|
const Tab(icon: Icon(Icons.edit)),
|
||||||
|
const Tab(icon: Icon(Icons.preview)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
children: [
|
||||||
|
_PostEditorTextField(
|
||||||
|
focusNode: _contentFocusNode,
|
||||||
|
controller: _editorController,
|
||||||
|
onUpdate: () => setState(() {}),
|
||||||
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 12,
|
||||||
|
bottom: 64,
|
||||||
|
),
|
||||||
|
child: MarkdownTextContent(
|
||||||
|
isAutoWarp:
|
||||||
|
_editorController.mode.value == 0,
|
||||||
|
content: _editorController
|
||||||
|
.contentController.text,
|
||||||
|
parentId: 'post-editor-preview',
|
||||||
|
).paddingOnly(left: 16, right: 16),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Material(
|
Material(
|
||||||
@ -391,6 +344,26 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Divider(thickness: 0.3, height: 0.3),
|
const Divider(thickness: 0.3, height: 0.3),
|
||||||
|
SizedBox(
|
||||||
|
height: 40,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: MarkdownToolbar(
|
||||||
|
width: 38,
|
||||||
|
height: 38,
|
||||||
|
iconSize: 20,
|
||||||
|
spacing: 8,
|
||||||
|
hideImage: true,
|
||||||
|
useIncludedTextField: false,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
|
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||||
|
controller: _editorController.contentController,
|
||||||
|
focusNode: _contentFocusNode,
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(20)),
|
||||||
|
).paddingSymmetric(horizontal: 12),
|
||||||
|
),
|
||||||
|
).paddingOnly(top: 12),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 56,
|
height: 56,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
@ -520,7 +493,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
top: -4,
|
top: -4,
|
||||||
end: -6,
|
end: -6,
|
||||||
),
|
),
|
||||||
child: const Icon(Icons.preview),
|
child: const Icon(Icons.wallpaper),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
@ -547,18 +520,6 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
_editorController.editPublishDate(context);
|
_editorController.editPublishDate(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
MarkdownToolbar(
|
|
||||||
hideImage: true,
|
|
||||||
useIncludedTextField: false,
|
|
||||||
backgroundColor:
|
|
||||||
Theme.of(context).colorScheme.surface,
|
|
||||||
iconColor: Theme.of(context).colorScheme.onSurface,
|
|
||||||
controller: _editorController.contentController,
|
|
||||||
focusNode: _contentFocusNode,
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(20)),
|
|
||||||
width: 40,
|
|
||||||
).paddingSymmetric(horizontal: 2),
|
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 6, vertical: 8),
|
).paddingSymmetric(horizontal: 6, vertical: 8),
|
||||||
),
|
),
|
||||||
@ -578,3 +539,101 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _PostEditorTextField extends StatelessWidget {
|
||||||
|
final FocusNode focusNode;
|
||||||
|
final PostEditorController controller;
|
||||||
|
final Function onUpdate;
|
||||||
|
|
||||||
|
const _PostEditorTextField({
|
||||||
|
required this.focusNode,
|
||||||
|
required this.controller,
|
||||||
|
required this.onUpdate,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 8,
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
maxLines: null,
|
||||||
|
autofocus: true,
|
||||||
|
autocorrect: true,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
controller: controller.contentController,
|
||||||
|
focusNode: focusNode,
|
||||||
|
decoration: InputDecoration.collapsed(
|
||||||
|
hintText: 'postContentPlaceholder'.tr,
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Gap(120)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() {
|
||||||
|
final textStyle = TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.75),
|
||||||
|
);
|
||||||
|
final showFactors = [
|
||||||
|
controller.isRestoreFromLocal.value,
|
||||||
|
controller.lastSaveTime.value != null,
|
||||||
|
];
|
||||||
|
final doShow = showFactors.any((x) => x);
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 4,
|
||||||
|
horizontal: 16,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
if (showFactors[0])
|
||||||
|
Text('postRestoreFromLocal'.tr, style: textStyle)
|
||||||
|
.paddingOnly(right: 4),
|
||||||
|
if (showFactors[0])
|
||||||
|
InkWell(
|
||||||
|
child: Text('clear'.tr, style: textStyle),
|
||||||
|
onTap: () {
|
||||||
|
controller.localClear();
|
||||||
|
controller.currentClear();
|
||||||
|
onUpdate();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (showFactors.where((x) => x).length > 1)
|
||||||
|
Text(
|
||||||
|
'·',
|
||||||
|
style: textStyle,
|
||||||
|
).paddingSymmetric(horizontal: 8),
|
||||||
|
if (showFactors[1])
|
||||||
|
Text(
|
||||||
|
'postAutoSaveAt'.trParams({
|
||||||
|
'date': DateFormat('HH:mm:ss').format(
|
||||||
|
controller.lastSaveTime.value ?? DateTime.now(),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.animate(
|
||||||
|
key: const Key('post-editor-hint-animation'),
|
||||||
|
target: doShow ? 1 : 0,
|
||||||
|
)
|
||||||
|
.fade(curve: Curves.easeInOut, duration: 300.ms);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -15,6 +15,7 @@ import 'package:solian/widgets/app_bar_leading.dart';
|
|||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
import 'package:solian/widgets/auto_cache_image.dart';
|
import 'package:solian/widgets/auto_cache_image.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
|
|
||||||
class RealmListScreen extends StatefulWidget {
|
class RealmListScreen extends StatefulWidget {
|
||||||
@ -58,8 +59,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
|
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
@ -99,6 +99,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: () => _getRealms(),
|
onRefresh: () => _getRealms(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
itemCount: _realms.length,
|
itemCount: _realms.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final element = _realms[index];
|
final element = _realms[index];
|
||||||
@ -155,7 +156,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
size: 18,
|
size: 18,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: AccountAvatar(
|
: AttachedCircleAvatar(
|
||||||
content: element.avatar!,
|
content: element.avatar!,
|
||||||
bgColor: Theme.of(context).colorScheme.primary,
|
bgColor: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
|
@ -7,6 +7,7 @@ import 'package:solian/router.dart';
|
|||||||
import 'package:solian/screens/realms/realm_organize.dart';
|
import 'package:solian/screens/realms/realm_organize.dart';
|
||||||
import 'package:solian/widgets/realms/realm_deletion.dart';
|
import 'package:solian/widgets/realms/realm_deletion.dart';
|
||||||
import 'package:solian/widgets/realms/realm_member.dart';
|
import 'package:solian/widgets/realms/realm_member.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class RealmDetailScreen extends StatefulWidget {
|
class RealmDetailScreen extends StatefulWidget {
|
||||||
final String alias;
|
final String alias;
|
||||||
@ -86,7 +87,8 @@ class _RealmDetailScreenState extends State<RealmDetailScreen> {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Column(
|
return RootContainer(
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
@ -141,6 +143,7 @@ class _RealmDetailScreenState extends State<RealmDetailScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import 'package:solian/router.dart';
|
|||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class RealmOrganizeArguments {
|
class RealmOrganizeArguments {
|
||||||
@ -189,8 +190,7 @@ class _RealmOrganizeScreenState extends State<RealmOrganizeScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
|
@ -16,6 +16,7 @@ import 'package:solian/theme.dart';
|
|||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/channel/channel_list.dart';
|
import 'package:solian/widgets/channel/channel_list.dart';
|
||||||
import 'package:solian/widgets/posts/post_list.dart';
|
import 'package:solian/widgets/posts/post_list.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class RealmViewScreen extends StatefulWidget {
|
class RealmViewScreen extends StatefulWidget {
|
||||||
final String alias;
|
final String alias;
|
||||||
@ -86,8 +87,7 @@ class _RealmViewScreenState extends State<RealmViewScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return RootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 2,
|
length: 2,
|
||||||
child: NestedScrollView(
|
child: NestedScrollView(
|
||||||
|
@ -1,16 +1,23 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:in_app_review/in_app_review.dart';
|
import 'package:in_app_review/in_app_review.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:solian/exceptions/request.dart';
|
import 'package:solian/exceptions/request.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/models/theme.dart';
|
||||||
import 'package:solian/platform.dart';
|
import 'package:solian/platform.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/database/database.dart';
|
import 'package:solian/providers/database/database.dart';
|
||||||
import 'package:solian/providers/theme_switcher.dart';
|
import 'package:solian/providers/theme_switcher.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/theme.dart';
|
|
||||||
import 'package:solian/widgets/reports/abuse_report.dart';
|
import 'package:solian/widgets/reports/abuse_report.dart';
|
||||||
|
|
||||||
class SettingScreen extends StatefulWidget {
|
class SettingScreen extends StatefulWidget {
|
||||||
@ -22,6 +29,7 @@ class SettingScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _SettingScreenState extends State<SettingScreen> {
|
class _SettingScreenState extends State<SettingScreen> {
|
||||||
SharedPreferences? _prefs;
|
SharedPreferences? _prefs;
|
||||||
|
String _docBasepath = '/';
|
||||||
|
|
||||||
Widget _buildCaptionHeader(String title) {
|
Widget _buildCaptionHeader(String title) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -32,39 +40,38 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildThemeColorButton(String label, Color color) {
|
static final List<SolianThemeData> _presentTheme = [
|
||||||
return IconButton(
|
SolianThemeData(
|
||||||
icon: Icon(Icons.circle, color: color),
|
id: 'themeColorRed',
|
||||||
tooltip: label,
|
seedColor: const Color.fromRGBO(154, 98, 91, 1),
|
||||||
onPressed: () {
|
|
||||||
context.read<ThemeSwitcher>().setTheme(
|
|
||||||
AppTheme.build(
|
|
||||||
Brightness.light,
|
|
||||||
seedColor: color,
|
|
||||||
),
|
),
|
||||||
AppTheme.build(
|
SolianThemeData(
|
||||||
Brightness.dark,
|
id: 'themeColorBlue',
|
||||||
seedColor: color,
|
seedColor: const Color.fromRGBO(103, 96, 193, 1),
|
||||||
|
),
|
||||||
|
SolianThemeData(
|
||||||
|
id: 'themeColorMiku',
|
||||||
|
seedColor: const Color.fromRGBO(56, 120, 126, 1),
|
||||||
|
),
|
||||||
|
SolianThemeData(
|
||||||
|
id: 'themeColorKagamine',
|
||||||
|
seedColor: const Color.fromRGBO(244, 183, 63, 1),
|
||||||
|
),
|
||||||
|
SolianThemeData(
|
||||||
|
id: 'themeColorLuka',
|
||||||
|
seedColor: const Color.fromRGBO(243, 174, 218, 1),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
_prefs?.setInt('global_theme_color', color.value);
|
|
||||||
context.clearSnackbar();
|
|
||||||
context.showSnackbar('themeColorApplied'.tr);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
static final List<(String, Color)> _presentTheme = [
|
|
||||||
('themeColorRed', const Color.fromRGBO(154, 98, 91, 1)),
|
|
||||||
('themeColorBlue', const Color.fromRGBO(103, 96, 193, 1)),
|
|
||||||
('themeColorMiku', const Color.fromRGBO(56, 120, 126, 1)),
|
|
||||||
('themeColorKagamine', const Color.fromRGBO(244, 183, 63, 1)),
|
|
||||||
('themeColorLuka', const Color.fromRGBO(243, 174, 218, 1)),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
getApplicationDocumentsDirectory().then((dir) {
|
||||||
|
_docBasepath = dir.path;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
SharedPreferences.getInstance().then((inst) {
|
SharedPreferences.getInstance().then((inst) {
|
||||||
_prefs = inst;
|
_prefs = inst;
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
@ -75,19 +82,103 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return ListView(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: ListView(
|
|
||||||
children: [
|
children: [
|
||||||
_buildCaptionHeader('themeColor'.tr),
|
_buildCaptionHeader('theme'.tr),
|
||||||
SizedBox(
|
ListTile(
|
||||||
height: 56,
|
leading: const Icon(Icons.palette),
|
||||||
child: ListView(
|
contentPadding: const EdgeInsets.symmetric(horizontal: 22),
|
||||||
scrollDirection: Axis.horizontal,
|
title: Text('globalTheme'.tr),
|
||||||
children: _presentTheme
|
trailing: DropdownButtonHideUnderline(
|
||||||
.map((x) => _buildThemeColorButton(x.$1, x.$2))
|
child: DropdownButton2<SolianThemeData>(
|
||||||
|
isExpanded: true,
|
||||||
|
hint: Text(
|
||||||
|
'theme'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Theme.of(context).hintColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
items: _presentTheme
|
||||||
|
.map((SolianThemeData item) =>
|
||||||
|
DropdownMenuItem<SolianThemeData>(
|
||||||
|
value: item,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.circle, color: item.seedColor),
|
||||||
|
const Gap(8),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
item.id.tr,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
).paddingSymmetric(horizontal: 12, vertical: 8),
|
value: (_prefs?.containsKey('global_theme') ?? false)
|
||||||
|
? SolianThemeData.fromJson(
|
||||||
|
jsonDecode(_prefs!.getString('global_theme')!),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
onChanged: (SolianThemeData? value) {
|
||||||
|
context.read<ThemeSwitcher>().setThemeData(value);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
buttonStyleData: const ButtonStyleData(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
height: 40,
|
||||||
|
width: 140,
|
||||||
|
),
|
||||||
|
menuItemStyleData: const MenuItemStyleData(
|
||||||
|
height: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CheckboxListTile(
|
||||||
|
secondary: const Icon(Icons.military_tech),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 22),
|
||||||
|
title: Text('agedTheme'.tr),
|
||||||
|
subtitle: Text('agedThemeDesc'.tr),
|
||||||
|
value: _prefs?.getBool('aged_theme') ?? false,
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
context.read<ThemeSwitcher>().setAgedTheme(value);
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (!PlatformInfo.isWeb)
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.wallpaper),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 22, right: 31),
|
||||||
|
title: Text('appBackgroundImage'.tr),
|
||||||
|
subtitle: Text('appBackgroundImageDesc'.tr),
|
||||||
|
trailing: File('$_docBasepath/app_background_image').existsSync()
|
||||||
|
? const Icon(Icons.check_box)
|
||||||
|
: const Icon(Icons.check_box_outline_blank),
|
||||||
|
onTap: () async {
|
||||||
|
if (File('$_docBasepath/app_background_image').existsSync()) {
|
||||||
|
File('$_docBasepath/app_background_image').deleteSync();
|
||||||
|
} else {
|
||||||
|
final image = await ImagePicker().pickImage(
|
||||||
|
source: ImageSource.gallery,
|
||||||
|
);
|
||||||
|
if (image == null) return;
|
||||||
|
|
||||||
|
await File(image.path)
|
||||||
|
.copy('$_docBasepath/app_background_image');
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
_buildCaptionHeader('notification'.tr),
|
_buildCaptionHeader('notification'.tr),
|
||||||
Tooltip(
|
Tooltip(
|
||||||
@ -107,8 +198,7 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
value:
|
value: _prefs?.getBool('service_background_notification') ?? false,
|
||||||
_prefs?.getBool('service_background_notification') ?? false,
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_prefs
|
_prefs
|
||||||
?.setBool('service_background_notification', value ?? false)
|
?.setBool('service_background_notification', value ?? false)
|
||||||
@ -126,9 +216,7 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
subtitle: Text('updateCheckStrictlyDesc'.tr),
|
subtitle: Text('updateCheckStrictlyDesc'.tr),
|
||||||
value: _prefs?.getBool('check_update_strictly') ?? false,
|
value: _prefs?.getBool('check_update_strictly') ?? false,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_prefs
|
_prefs?.setBool('check_update_strictly', value ?? false).then((_) {
|
||||||
?.setBool('check_update_strictly', value ?? false)
|
|
||||||
.then((_) {
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -181,6 +269,21 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
_buildCaptionHeader('performance'.tr),
|
||||||
|
CheckboxListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 22),
|
||||||
|
secondary: const Icon(Icons.message),
|
||||||
|
title: Text('animatedMessageList'.tr),
|
||||||
|
subtitle: Text('animatedMessageListDesc'.tr),
|
||||||
|
value: _prefs?.getBool('non_animated_message_list') ?? false,
|
||||||
|
onChanged: (value) {
|
||||||
|
_prefs
|
||||||
|
?.setBool('non_animated_message_list', value ?? false)
|
||||||
|
.then((_) {
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
_buildCaptionHeader('more'.tr),
|
_buildCaptionHeader('more'.tr),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.delete_sweep),
|
leading: const Icon(Icons.delete_sweep),
|
||||||
@ -231,7 +334,6 @@ class _SettingScreenState extends State<SettingScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ class RootShell extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: rootScaffoldKey,
|
key: rootScaffoldKey,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
bottomNavigationBar: showBottomNavigation
|
bottomNavigationBar: showBottomNavigation
|
||||||
? AppNavigationBottom(
|
? AppNavigationBottom(
|
||||||
initialIndex: destNames.indexOf(routeName ?? 'page'),
|
initialIndex: destNames.indexOf(routeName ?? 'page'),
|
||||||
|
@ -5,10 +5,12 @@ import 'package:solian/theme.dart';
|
|||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class TitleShell extends StatelessWidget {
|
class TitleShell extends StatelessWidget {
|
||||||
final bool showAppBar;
|
final bool showAppBar;
|
||||||
final bool isCenteredTitle;
|
final bool isCenteredTitle;
|
||||||
|
final bool isResponsive;
|
||||||
final String? title;
|
final String? title;
|
||||||
final GoRouterState? state;
|
final GoRouterState? state;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
@ -20,13 +22,14 @@ class TitleShell extends StatelessWidget {
|
|||||||
this.state,
|
this.state,
|
||||||
this.showAppBar = true,
|
this.showAppBar = true,
|
||||||
this.isCenteredTitle = false,
|
this.isCenteredTitle = false,
|
||||||
|
this.isResponsive = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
assert(state != null || title != null);
|
assert(state != null || title != null);
|
||||||
|
|
||||||
return Scaffold(
|
final widget = Scaffold(
|
||||||
appBar: showAppBar
|
appBar: showAppBar
|
||||||
? AppBar(
|
? AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
@ -45,5 +48,11 @@ class TitleShell extends StatelessWidget {
|
|||||||
: null,
|
: null,
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (isResponsive) {
|
||||||
|
return ResponsiveRootContainer(child: widget);
|
||||||
|
} else {
|
||||||
|
return RootContainer(child: widget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:solian/models/theme.dart';
|
||||||
import 'package:solian/platform.dart';
|
import 'package:solian/platform.dart';
|
||||||
|
|
||||||
abstract class AppTheme {
|
abstract class AppTheme {
|
||||||
@ -41,6 +42,10 @@ abstract class AppTheme {
|
|||||||
snackBarTheme: const SnackBarThemeData(
|
snackBarTheme: const SnackBarThemeData(
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
),
|
),
|
||||||
|
scaffoldBackgroundColor: Colors.transparent,
|
||||||
|
appBarTheme: const AppBarTheme(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
),
|
||||||
fontFamily: 'Comfortaa',
|
fontFamily: 'Comfortaa',
|
||||||
fontFamilyFallback: [
|
fontFamilyFallback: [
|
||||||
'NotoSansSC',
|
'NotoSansSC',
|
||||||
@ -55,4 +60,37 @@ abstract class AppTheme {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ThemeData buildFromData(
|
||||||
|
Brightness brightness,
|
||||||
|
SolianThemeData data, {
|
||||||
|
bool useMaterial3 = true,
|
||||||
|
}) {
|
||||||
|
return ThemeData(
|
||||||
|
brightness: brightness,
|
||||||
|
useMaterial3: useMaterial3,
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
brightness: brightness,
|
||||||
|
seedColor: data.seedColor,
|
||||||
|
),
|
||||||
|
snackBarTheme: const SnackBarThemeData(
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
scaffoldBackgroundColor: Colors.transparent,
|
||||||
|
appBarTheme: const AppBarTheme(backgroundColor: Colors.transparent),
|
||||||
|
fontFamily: data.fontFamily ?? 'Comfortaa',
|
||||||
|
fontFamilyFallback: data.fontFamilyFallback ??
|
||||||
|
[
|
||||||
|
'NotoSansSC',
|
||||||
|
'NotoSansHK',
|
||||||
|
'NotoSansJP',
|
||||||
|
if (PlatformInfo.isWeb) 'NotoSansEmoji',
|
||||||
|
],
|
||||||
|
typography: Typography.material2021(
|
||||||
|
colorScheme: brightness == Brightness.light
|
||||||
|
? const ColorScheme.light()
|
||||||
|
: const ColorScheme.dark(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
|
import 'package:solian/widgets/account/account_profile_popup.dart';
|
||||||
import 'package:solian/widgets/auto_cache_image.dart';
|
import 'package:solian/widgets/auto_cache_image.dart';
|
||||||
|
|
||||||
class AccountAvatar extends StatelessWidget {
|
class AttachedCircleAvatar extends StatelessWidget {
|
||||||
final dynamic content;
|
final dynamic content;
|
||||||
final Color? bgColor;
|
final Color? bgColor;
|
||||||
final Color? feColor;
|
final Color? feColor;
|
||||||
final double? radius;
|
final double? radius;
|
||||||
final Widget? fallbackWidget;
|
final Widget? fallbackWidget;
|
||||||
|
|
||||||
const AccountAvatar({
|
const AttachedCircleAvatar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.content,
|
required this.content,
|
||||||
this.bgColor,
|
this.bgColor,
|
||||||
@ -39,7 +40,7 @@ class AccountAvatar extends StatelessWidget {
|
|||||||
child: isEmpty
|
child: isEmpty
|
||||||
? (fallbackWidget ??
|
? (fallbackWidget ??
|
||||||
Icon(
|
Icon(
|
||||||
Icons.account_circle,
|
Icons.image,
|
||||||
size: radius != null ? radius! * 1.2 : 24,
|
size: radius != null ? radius! * 1.2 : 24,
|
||||||
color: feColor,
|
color: feColor,
|
||||||
))
|
))
|
||||||
@ -48,6 +49,54 @@ class AccountAvatar extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AccountAvatar extends StatelessWidget {
|
||||||
|
final dynamic content;
|
||||||
|
final String username;
|
||||||
|
final Color? bgColor;
|
||||||
|
final Color? feColor;
|
||||||
|
final double? radius;
|
||||||
|
final Widget? fallbackWidget;
|
||||||
|
|
||||||
|
const AccountAvatar({
|
||||||
|
super.key,
|
||||||
|
required this.content,
|
||||||
|
required this.username,
|
||||||
|
this.bgColor,
|
||||||
|
this.feColor,
|
||||||
|
this.radius,
|
||||||
|
this.fallbackWidget,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
child: AttachedCircleAvatar(
|
||||||
|
content: content,
|
||||||
|
bgColor: bgColor,
|
||||||
|
feColor: feColor,
|
||||||
|
radius: radius,
|
||||||
|
fallbackWidget: (fallbackWidget ??
|
||||||
|
Icon(
|
||||||
|
Icons.account_circle,
|
||||||
|
size: radius != null ? radius! * 1.2 : 24,
|
||||||
|
color: feColor,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
showModalBottomSheet(
|
||||||
|
useRootNavigator: true,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AccountProfilePopup(
|
||||||
|
name: username,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class AccountProfileImage extends StatelessWidget {
|
class AccountProfileImage extends StatelessWidget {
|
||||||
final dynamic content;
|
final dynamic content;
|
||||||
final BoxFit fit;
|
final BoxFit fit;
|
||||||
|
@ -84,7 +84,7 @@ class AccountHeadingWidget extends StatelessWidget {
|
|||||||
Positioned(
|
Positioned(
|
||||||
bottom: -30,
|
bottom: -30,
|
||||||
left: 32,
|
left: 32,
|
||||||
child: AccountAvatar(content: avatar, radius: 40),
|
child: AttachedCircleAvatar(content: avatar, radius: 40),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -89,8 +89,7 @@ class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
|||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.75,
|
height: MediaQuery.of(context).size.height * 0.75,
|
||||||
child: Column(
|
child: ListView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
AccountHeadingWidget(
|
AccountHeadingWidget(
|
||||||
avatar: _userinfo!.avatar,
|
avatar: _userinfo!.avatar,
|
||||||
@ -118,7 +117,7 @@ class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
|||||||
const VisualDensity(horizontal: -4, vertical: -2),
|
const VisualDensity(horizontal: -4, vertical: -2),
|
||||||
trailing: const Icon(Icons.chevron_right),
|
trailing: const Icon(Icons.chevron_right),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
AppRouter.instance.goNamed(
|
AppRouter.instance.pushNamed(
|
||||||
'accountProfilePage',
|
'accountProfilePage',
|
||||||
pathParameters: {'name': _userinfo!.name},
|
pathParameters: {'name': _userinfo!.name},
|
||||||
);
|
);
|
||||||
|
@ -138,7 +138,7 @@ class _AccountSelectorState extends State<AccountSelector> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(element.nick),
|
title: Text(element.nick),
|
||||||
subtitle: Text(element.name),
|
subtitle: Text(element.name),
|
||||||
leading: AccountAvatar(content: element.avatar),
|
leading: AttachedCircleAvatar(content: element.avatar),
|
||||||
trailing: widget.trailingBuilder != null
|
trailing: widget.trailingBuilder != null
|
||||||
? widget.trailingBuilder!(element)
|
? widget.trailingBuilder!(element)
|
||||||
: _checkSelected(element)
|
: _checkSelected(element)
|
||||||
|
@ -23,7 +23,7 @@ class SilverRelativeList extends StatelessWidget {
|
|||||||
title: Text(element.related.nick),
|
title: Text(element.related.nick),
|
||||||
subtitle: Text(element.related.name),
|
subtitle: Text(element.related.name),
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
child: AccountAvatar(content: element.related.avatar),
|
child: AttachedCircleAvatar(content: element.related.avatar),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
@ -56,7 +56,7 @@ class _RelativeSelectorState extends State<RelativeSelector> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(element.nick),
|
title: Text(element.nick),
|
||||||
subtitle: Text(element.name),
|
subtitle: Text(element.name),
|
||||||
leading: AccountAvatar(content: element.avatar),
|
leading: AttachedCircleAvatar(content: element.avatar),
|
||||||
trailing: widget.trailingBuilder != null
|
trailing: widget.trailingBuilder != null
|
||||||
? widget.trailingBuilder!(element)
|
? widget.trailingBuilder!(element)
|
||||||
: null,
|
: null,
|
||||||
|
@ -1,28 +1,22 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:solian/shells/root_shell.dart';
|
|
||||||
|
|
||||||
class AppBarLeadingButton extends StatelessWidget {
|
class AppBarLeadingButton extends StatelessWidget {
|
||||||
const AppBarLeadingButton({super.key});
|
final bool forceBack;
|
||||||
|
|
||||||
static Widget? adaptive(BuildContext context) {
|
const AppBarLeadingButton({super.key, this.forceBack = false});
|
||||||
final hasContent =
|
|
||||||
Navigator.canPop(context) || rootScaffoldKey.currentState!.hasDrawer;
|
static Widget? adaptive(BuildContext context, {bool forceBack = false}) {
|
||||||
return hasContent ? const AppBarLeadingButton() : null;
|
final hasContent = Navigator.canPop(context) || forceBack;
|
||||||
|
return hasContent ? AppBarLeadingButton(forceBack: forceBack) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (Navigator.canPop(context)) {
|
if (Navigator.canPop(context) || forceBack) {
|
||||||
return BackButton(
|
return BackButton(
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (rootScaffoldKey.currentState!.hasDrawer) {
|
|
||||||
return DrawerButton(
|
|
||||||
onPressed: () => rootScaffoldKey.currentState!.openDrawer(),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
IgnorePointer(
|
IgnorePointer(
|
||||||
child: AccountAvatar(
|
child: AttachedCircleAvatar(
|
||||||
content: widget.item.account!.avatar,
|
content: widget.item.account!.avatar,
|
||||||
radius: 19,
|
radius: 19,
|
||||||
),
|
),
|
||||||
|
@ -155,11 +155,18 @@ class _AttachmentItemImage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (showBadge && badge != null)
|
if (showBadge && badge != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 12,
|
right: 8,
|
||||||
bottom: 8,
|
bottom: 4,
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Chip(label: Text(badge!)),
|
child: Chip(
|
||||||
|
label: Text(badge!),
|
||||||
|
labelStyle: GoogleFonts.robotoMono(),
|
||||||
|
visualDensity: const VisualDensity(
|
||||||
|
horizontal: -4,
|
||||||
|
vertical: -2,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (showHideButton && item.isMature)
|
if (showHideButton && item.isMature)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:carousel_slider/carousel_slider.dart';
|
|
||||||
import 'package:dismissible_page/dismissible_page.dart';
|
import 'package:dismissible_page/dismissible_page.dart';
|
||||||
import 'package:flutter/material.dart' hide CarouselController;
|
import 'package:flutter/material.dart' hide CarouselController;
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
@ -15,27 +14,29 @@ import 'package:solian/widgets/sized_container.dart';
|
|||||||
|
|
||||||
class AttachmentList extends StatefulWidget {
|
class AttachmentList extends StatefulWidget {
|
||||||
final String parentId;
|
final String parentId;
|
||||||
final List<String> attachmentsId;
|
final List<String>? attachmentIds;
|
||||||
|
final List<Attachment>? attachments;
|
||||||
final bool isGrid;
|
final bool isGrid;
|
||||||
final bool isColumn;
|
final bool isColumn;
|
||||||
final bool isForceGrid;
|
final bool isFullWidth;
|
||||||
final bool autoload;
|
final bool autoload;
|
||||||
final double flatMaxHeight;
|
|
||||||
final double columnMaxWidth;
|
final double columnMaxWidth;
|
||||||
|
|
||||||
|
final EdgeInsets? padding;
|
||||||
final double? width;
|
final double? width;
|
||||||
final double? viewport;
|
final double? viewport;
|
||||||
|
|
||||||
const AttachmentList({
|
const AttachmentList({
|
||||||
super.key,
|
super.key,
|
||||||
required this.parentId,
|
required this.parentId,
|
||||||
required this.attachmentsId,
|
this.attachmentIds,
|
||||||
|
this.attachments,
|
||||||
this.isGrid = false,
|
this.isGrid = false,
|
||||||
this.isColumn = false,
|
this.isColumn = false,
|
||||||
this.isForceGrid = false,
|
this.isFullWidth = false,
|
||||||
this.autoload = false,
|
this.autoload = false,
|
||||||
this.flatMaxHeight = 720,
|
|
||||||
this.columnMaxWidth = 480,
|
this.columnMaxWidth = 480,
|
||||||
|
this.padding,
|
||||||
this.width,
|
this.width,
|
||||||
this.viewport,
|
this.viewport,
|
||||||
});
|
});
|
||||||
@ -50,21 +51,21 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
|
|
||||||
double _aspectRatio = 1;
|
double _aspectRatio = 1;
|
||||||
|
|
||||||
List<Attachment?> _attachmentsMeta = List.empty();
|
List<Attachment?> _attachments = List.empty();
|
||||||
|
|
||||||
void _getMetadataList() {
|
void _getMetadataList() {
|
||||||
final AttachmentProvider attach = Get.find();
|
final AttachmentProvider attach = Get.find();
|
||||||
|
|
||||||
if (widget.attachmentsId.isEmpty) {
|
if (widget.attachmentIds?.isEmpty ?? false) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
_attachmentsMeta = List.filled(widget.attachmentsId.length, null);
|
_attachments = List.filled(widget.attachmentIds!.length, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
attach.listMetadata(widget.attachmentsId).then((result) {
|
attach.listMetadata(widget.attachmentIds!).then((result) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_attachmentsMeta = result;
|
_attachments = result;
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -76,7 +77,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
bool isConsistent = true;
|
bool isConsistent = true;
|
||||||
double? consistentValue;
|
double? consistentValue;
|
||||||
int portrait = 0, square = 0, landscape = 0;
|
int portrait = 0, square = 0, landscape = 0;
|
||||||
for (var entry in _attachmentsMeta) {
|
for (var entry in _attachments) {
|
||||||
if (entry == null) continue;
|
if (entry == null) continue;
|
||||||
if (entry.metadata?['ratio'] != null) {
|
if (entry.metadata?['ratio'] != null) {
|
||||||
if (entry.metadata?['ratio'] is int) {
|
if (entry.metadata?['ratio'] is int) {
|
||||||
@ -117,10 +118,9 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
item: element,
|
item: element,
|
||||||
parentId: widget.parentId,
|
parentId: widget.parentId,
|
||||||
width: width ?? widget.width,
|
width: width ?? widget.width,
|
||||||
badgeContent: '${idx + 1}/${_attachmentsMeta.length}',
|
badgeContent: '${idx + 1}/${_attachments.length}',
|
||||||
showBadge:
|
showBadge: _attachments.length > 1 && !widget.isGrid && !widget.isColumn,
|
||||||
_attachmentsMeta.length > 1 && !widget.isGrid && !widget.isColumn,
|
showBorder: _attachments.length > 1,
|
||||||
showBorder: widget.attachmentsId.length > 1,
|
|
||||||
showMature: _showMature,
|
showMature: _showMature,
|
||||||
autoload: widget.autoload,
|
autoload: widget.autoload,
|
||||||
onReveal: (value) {
|
onReveal: (value) {
|
||||||
@ -132,7 +132,16 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
assert(widget.attachmentIds != null || widget.attachments != null);
|
||||||
|
if (widget.attachments == null) {
|
||||||
_getMetadataList();
|
_getMetadataList();
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_attachments = widget.attachments!;
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
_calculateAspectRatio();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Color get _unFocusColor =>
|
Color get _unFocusColor =>
|
||||||
@ -140,7 +149,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (widget.attachmentsId.isEmpty) {
|
if (widget.attachmentIds?.isEmpty ?? widget.attachments!.isEmpty) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,9 +162,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
color: _unFocusColor,
|
color: _unFocusColor,
|
||||||
).paddingOnly(right: 5),
|
).paddingOnly(right: 5),
|
||||||
Text(
|
Text(
|
||||||
'attachmentHint'.trParams(
|
'attachmentHint'.trParams({'count': _attachments.toString()}),
|
||||||
{'count': widget.attachmentsId.length.toString()},
|
|
||||||
),
|
|
||||||
style: TextStyle(color: _unFocusColor, fontSize: 12),
|
style: TextStyle(color: _unFocusColor, fontSize: 12),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -165,21 +172,79 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
.fadeIn(duration: 1250.ms);
|
.fadeIn(duration: 1250.ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const radius = BorderRadius.all(Radius.circular(8));
|
||||||
|
|
||||||
|
if (widget.isFullWidth && _attachments.length == 1) {
|
||||||
|
final element = _attachments.first;
|
||||||
|
double ratio = element!.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
||||||
|
return Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxHeight: 640,
|
||||||
|
),
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: ratio,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.symmetric(
|
||||||
|
horizontal: BorderSide(
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: _buildEntry(element, 0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final isNotPureImage = _attachments.any(
|
||||||
|
(x) => x?.mimetype.split('/').firstOrNull != 'image',
|
||||||
|
);
|
||||||
|
if (widget.isGrid && !isNotPureImage) {
|
||||||
|
return GridView.builder(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
primary: false,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: math.min(3, _attachments.length),
|
||||||
|
mainAxisSpacing: 8.0,
|
||||||
|
crossAxisSpacing: 8.0,
|
||||||
|
),
|
||||||
|
itemCount: _attachments.length,
|
||||||
|
itemBuilder: (context, idx) {
|
||||||
|
final element = _attachments[idx];
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: radius,
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: radius,
|
||||||
|
child: _buildEntry(element, idx),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (widget.isColumn) {
|
if (widget.isColumn) {
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
const radius = BorderRadius.all(Radius.circular(8));
|
|
||||||
return Wrap(
|
return Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: widget.attachmentsId.map((x) {
|
children: _attachments.map((x) {
|
||||||
final element = _attachmentsMeta[idx];
|
final element = _attachments[idx];
|
||||||
idx++;
|
idx++;
|
||||||
if (element == null) return const SizedBox.shrink();
|
if (element == null) return const SizedBox.shrink();
|
||||||
double ratio = element.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
double ratio = element.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
|
||||||
),
|
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: widget.columnMaxWidth,
|
maxWidth: widget.columnMaxWidth,
|
||||||
maxHeight: 640,
|
maxHeight: 640,
|
||||||
@ -205,27 +270,31 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final isNotPureImage = _attachmentsMeta.any(
|
|
||||||
(x) => x?.mimetype.split('/').firstOrNull != 'image',
|
|
||||||
);
|
|
||||||
if (widget.isGrid && (widget.isForceGrid || !isNotPureImage)) {
|
|
||||||
const radius = BorderRadius.all(Radius.circular(8));
|
|
||||||
return GridView.builder(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
primary: false,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
shrinkWrap: true,
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: math.min(3, widget.attachmentsId.length),
|
|
||||||
mainAxisSpacing: 8.0,
|
|
||||||
crossAxisSpacing: 8.0,
|
|
||||||
),
|
|
||||||
itemCount: widget.attachmentsId.length,
|
|
||||||
itemBuilder: (context, idx) {
|
|
||||||
final element = _attachmentsMeta[idx];
|
|
||||||
return Container(
|
return Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxHeight: 320,
|
||||||
|
),
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: widget.padding,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: _attachments.length,
|
||||||
|
itemBuilder: (context, idx) {
|
||||||
|
final element = _attachments[idx];
|
||||||
|
if (element == null) const SizedBox.shrink();
|
||||||
|
final ratio = element!.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
||||||
|
return Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: math.min(
|
||||||
|
widget.columnMaxWidth,
|
||||||
|
MediaQuery.of(context).size.width -
|
||||||
|
(widget.padding?.horizontal ?? 0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: ratio,
|
||||||
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context).dividerColor,
|
color: Theme.of(context).dividerColor,
|
||||||
width: 1,
|
width: 1,
|
||||||
@ -236,37 +305,11 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
borderRadius: radius,
|
borderRadius: radius,
|
||||||
child: _buildEntry(element, idx),
|
child: _buildEntry(element, idx),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).paddingSymmetric(horizontal: 24);
|
separatorBuilder: (context, _) => const Gap(8),
|
||||||
}
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
maxHeight: widget.flatMaxHeight,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
|
||||||
border: Border.symmetric(
|
|
||||||
horizontal: BorderSide(
|
|
||||||
width: 0.3,
|
|
||||||
color: Theme.of(context).dividerColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: CarouselSlider.builder(
|
|
||||||
options: CarouselOptions(
|
|
||||||
aspectRatio: _aspectRatio,
|
|
||||||
viewportFraction:
|
|
||||||
widget.viewport ?? (widget.attachmentsId.length > 1 ? 0.95 : 1),
|
|
||||||
enableInfiniteScroll: false,
|
|
||||||
),
|
|
||||||
itemCount: _attachmentsMeta.length,
|
|
||||||
itemBuilder: (context, idx, _) {
|
|
||||||
final element = _attachmentsMeta[idx];
|
|
||||||
return _buildEntry(element, idx);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -319,6 +362,7 @@ class AttachmentListEntry extends StatelessWidget {
|
|||||||
width: width ?? MediaQuery.of(context).size.width,
|
width: width ?? MediaQuery.of(context).size.width,
|
||||||
height: height,
|
height: height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
border: showBorder
|
border: showBorder
|
||||||
? Border.symmetric(
|
? Border.symmetric(
|
||||||
vertical: BorderSide(
|
vertical: BorderSide(
|
||||||
|
@ -205,7 +205,7 @@ class _ChannelListWidgetState extends State<ChannelListWidget> {
|
|||||||
item.members!.where((e) => e.account.id != widget.selfId).firstOrNull;
|
item.members!.where((e) => e.account.id != widget.selfId).firstOrNull;
|
||||||
|
|
||||||
if (item.type == 1 && otherside != null) {
|
if (item.type == 1 && otherside != null) {
|
||||||
final avatar = AccountAvatar(
|
final avatar = AttachedCircleAvatar(
|
||||||
content: otherside.account.avatar,
|
content: otherside.account.avatar,
|
||||||
radius: 20,
|
radius: 20,
|
||||||
bgColor: Theme.of(context).colorScheme.primary,
|
bgColor: Theme.of(context).colorScheme.primary,
|
||||||
@ -241,7 +241,7 @@ class _ChannelListWidgetState extends State<ChannelListWidget> {
|
|||||||
padding: const EdgeInsets.all(2),
|
padding: const EdgeInsets.all(2),
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
),
|
),
|
||||||
badgeContent: AccountAvatar(
|
badgeContent: AttachedCircleAvatar(
|
||||||
content: item.realm?.avatar,
|
content: item.realm?.avatar,
|
||||||
radius: 10,
|
radius: 10,
|
||||||
fallbackWidget: const Icon(
|
fallbackWidget: const Icon(
|
||||||
|
@ -152,7 +152,8 @@ class _ChannelMemberListPopupState extends State<ChannelMemberListPopup> {
|
|||||||
title: Text(element.account.nick),
|
title: Text(element.account.nick),
|
||||||
subtitle: Text(element.account.name),
|
subtitle: Text(element.account.name),
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
child: AccountAvatar(content: element.account.avatar),
|
child:
|
||||||
|
AttachedCircleAvatar(content: element.account.avatar),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
@ -74,7 +74,7 @@ class _NoContentWidgetState extends State<NoContentWidget>
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
child: AccountAvatar(
|
child: AttachedCircleAvatar(
|
||||||
content: widget.userinfo!.avatar,
|
content: widget.userinfo!.avatar,
|
||||||
bgColor: Colors.transparent,
|
bgColor: Colors.transparent,
|
||||||
radius: radius,
|
radius: radius,
|
||||||
|
@ -78,7 +78,7 @@ class ChatEvent extends StatelessWidget {
|
|||||||
child: AttachmentList(
|
child: AttachmentList(
|
||||||
key: Key('m${item.uuid}attachments'),
|
key: Key('m${item.uuid}attachments'),
|
||||||
parentId: item.uuid,
|
parentId: item.uuid,
|
||||||
attachmentsId: attachments,
|
attachmentIds: attachments,
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -220,7 +220,7 @@ class ChatEvent extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
AccountAvatar(
|
AttachedCircleAvatar(
|
||||||
content: item.sender.account.avatar,
|
content: item.sender.account.avatar,
|
||||||
radius: 9,
|
radius: 9,
|
||||||
),
|
),
|
||||||
@ -250,7 +250,8 @@ class ChatEvent extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
child: AccountAvatar(content: item.sender.account.avatar),
|
child:
|
||||||
|
AttachedCircleAvatar(content: item.sender.account.avatar),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:solian/controllers/chat_events_controller.dart';
|
import 'package:solian/controllers/chat_events_controller.dart';
|
||||||
import 'package:solian/models/channel.dart';
|
import 'package:solian/models/channel.dart';
|
||||||
@ -9,6 +10,7 @@ import 'package:solian/widgets/chat/chat_event_action.dart';
|
|||||||
import 'package:very_good_infinite_list/very_good_infinite_list.dart';
|
import 'package:very_good_infinite_list/very_good_infinite_list.dart';
|
||||||
|
|
||||||
class ChatEventList extends StatelessWidget {
|
class ChatEventList extends StatelessWidget {
|
||||||
|
final bool noAnimated;
|
||||||
final String scope;
|
final String scope;
|
||||||
final Channel channel;
|
final Channel channel;
|
||||||
final ChatEventController chatController;
|
final ChatEventController chatController;
|
||||||
@ -23,6 +25,7 @@ class ChatEventList extends StatelessWidget {
|
|||||||
required this.chatController,
|
required this.chatController,
|
||||||
required this.onEdit,
|
required this.onEdit,
|
||||||
required this.onReply,
|
required this.onReply,
|
||||||
|
this.noAnimated = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
bool _checkMessageMergeable(Event? a, Event? b) {
|
bool _checkMessageMergeable(Event? a, Event? b) {
|
||||||
@ -63,7 +66,8 @@ class ChatEventList extends StatelessWidget {
|
|||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
child: ChatEvent(
|
child: Builder(builder: (context) {
|
||||||
|
final widget = ChatEvent(
|
||||||
key: Key('m${item!.uuid}'),
|
key: Key('m${item!.uuid}'),
|
||||||
item: item,
|
item: item,
|
||||||
isMerged: isMerged,
|
isMerged: isMerged,
|
||||||
@ -71,7 +75,23 @@ class ChatEventList extends StatelessWidget {
|
|||||||
).paddingOnly(
|
).paddingOnly(
|
||||||
top: !isMerged ? 8 : 0,
|
top: !isMerged ? 8 : 0,
|
||||||
bottom: !hasMerged ? 8 : 0,
|
bottom: !hasMerged ? 8 : 0,
|
||||||
),
|
);
|
||||||
|
|
||||||
|
if (noAnimated) {
|
||||||
|
return widget;
|
||||||
|
} else {
|
||||||
|
return widget
|
||||||
|
.animate(
|
||||||
|
key: Key('animated-m${item.uuid}'),
|
||||||
|
)
|
||||||
|
.slideY(
|
||||||
|
curve: Curves.fastLinearToSlowEaseIn,
|
||||||
|
duration: 250.ms,
|
||||||
|
begin: 0.5,
|
||||||
|
end: 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
@ -79,7 +99,7 @@ class ChatEventList extends StatelessWidget {
|
|||||||
builder: (context) => ChatEventAction(
|
builder: (context) => ChatEventAction(
|
||||||
channel: channel,
|
channel: channel,
|
||||||
realm: channel.realm,
|
realm: channel.realm,
|
||||||
item: item,
|
item: item!,
|
||||||
onEdit: () {
|
onEdit: () {
|
||||||
onEdit(item);
|
onEdit(item);
|
||||||
},
|
},
|
||||||
|
@ -443,7 +443,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
|||||||
.map(
|
.map(
|
||||||
(x) => ChatMessageSuggestion(
|
(x) => ChatMessageSuggestion(
|
||||||
type: 'users',
|
type: 'users',
|
||||||
leading: AccountAvatar(content: x.avatar),
|
leading: AttachedCircleAvatar(content: x.avatar),
|
||||||
display: x.nick,
|
display: x.nick,
|
||||||
content: '@${x.name}',
|
content: '@${x.name}',
|
||||||
),
|
),
|
||||||
|
@ -2,15 +2,21 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/models/link.dart';
|
||||||
import 'package:solian/providers/link_expander.dart';
|
import 'package:solian/providers/link_expander.dart';
|
||||||
import 'package:solian/widgets/auto_cache_image.dart';
|
import 'package:solian/widgets/auto_cache_image.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
class LinkExpansion extends StatelessWidget {
|
class LinkExpansion extends StatefulWidget {
|
||||||
final String content;
|
final String content;
|
||||||
|
|
||||||
const LinkExpansion({super.key, required this.content});
|
const LinkExpansion({super.key, required this.content});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LinkExpansion> createState() => _LinkExpansionState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LinkExpansionState extends State<LinkExpansion> {
|
||||||
Widget _buildImage(String url, {double? width, double? height}) {
|
Widget _buildImage(String url, {double? width, double? height}) {
|
||||||
if (url.endsWith('svg')) {
|
if (url.endsWith('svg')) {
|
||||||
return SvgPicture.network(url, width: width, height: height);
|
return SvgPicture.network(url, width: width, height: height);
|
||||||
@ -22,61 +28,74 @@ class LinkExpansion extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
List<LinkMeta>? _meta;
|
||||||
Widget build(BuildContext context) {
|
|
||||||
|
Future<void> _doExpand() async {
|
||||||
final linkRegex = RegExp(
|
final linkRegex = RegExp(
|
||||||
r'(?<!\()(?:(?:https?):\/\/|www\.)(?:[-_a-z0-9]+\.)*(?:[-a-z0-9]+\.[-a-z0-9]+)[^\s<]*[^\s<?!.,:*_~]',
|
r'(?<!\()(?:(?:https?):\/\/|www\.)(?:[-_a-z0-9]+\.)*(?:[-a-z0-9]+\.[-a-z0-9]+)[^\s<]*[^\s<?!.,:*_~]',
|
||||||
);
|
);
|
||||||
final matches = linkRegex.allMatches(content);
|
final matches = linkRegex.allMatches(widget.content);
|
||||||
if (matches.isEmpty) {
|
if (matches.isEmpty) return;
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
|
|
||||||
final LinkExpandProvider expandController = Get.find();
|
final LinkExpandProvider expandController = Get.find();
|
||||||
|
|
||||||
return Wrap(
|
if (matches.isEmpty) return;
|
||||||
children: matches.map((x) {
|
|
||||||
return Container(
|
List<LinkMeta> out = List.empty(growable: true);
|
||||||
constraints: BoxConstraints(
|
for (final x in matches) {
|
||||||
maxWidth: matches.length == 1 ? 480 : 340,
|
final result = await expandController.expandLink(x.group(0)!);
|
||||||
),
|
if (result != null) out.add(result);
|
||||||
child: FutureBuilder(
|
|
||||||
future: expandController.expandLink(x.group(0)!),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (!snapshot.hasData) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setState(() => _meta = out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_doExpand();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (_meta?.isEmpty ?? true) return const SizedBox.shrink();
|
||||||
|
|
||||||
|
return Wrap(
|
||||||
|
children: _meta!.map((x) {
|
||||||
|
return Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: _meta!.length == 1 ? 480 : 340,
|
||||||
|
),
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) {
|
||||||
final isRichDescription = [
|
final isRichDescription = [
|
||||||
'solsynth.dev',
|
'solsynth.dev',
|
||||||
].contains(Uri.parse(snapshot.data!.url).host);
|
].contains(Uri.parse(x.url).host);
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Card(
|
child: Card(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if ([
|
if ([(x.icon?.isNotEmpty ?? false), x.siteName != null]
|
||||||
(snapshot.data!.icon?.isNotEmpty ?? false),
|
.any((x) => x))
|
||||||
snapshot.data!.siteName != null
|
|
||||||
].any((x) => x))
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (snapshot.data!.icon?.isNotEmpty ?? false)
|
if (x.icon?.isNotEmpty ?? false)
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(8),
|
Radius.circular(8),
|
||||||
),
|
),
|
||||||
child: _buildImage(
|
child: _buildImage(
|
||||||
snapshot.data!.icon!,
|
x.icon!,
|
||||||
width: 32,
|
width: 32,
|
||||||
height: 32,
|
height: 32,
|
||||||
),
|
),
|
||||||
).paddingOnly(right: 8),
|
).paddingOnly(right: 8),
|
||||||
if (snapshot.data!.siteName != null)
|
if (x.siteName != null)
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
snapshot.data!.siteName!,
|
x.siteName!,
|
||||||
style: Theme.of(context).textTheme.labelLarge,
|
style: Theme.of(context).textTheme.labelLarge,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@ -84,32 +103,27 @@ class LinkExpansion extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
).paddingOnly(
|
).paddingOnly(
|
||||||
bottom: (snapshot.data!.icon?.isNotEmpty ?? false)
|
bottom: (x.icon?.isNotEmpty ?? false) ? 8 : 4,
|
||||||
? 8
|
|
||||||
: 4,
|
|
||||||
),
|
),
|
||||||
if (snapshot.data!.image != null &&
|
if (x.image != null &&
|
||||||
(snapshot.data!.image?.startsWith('http') ?? false))
|
(x.image?.startsWith('http') ?? false))
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(8),
|
Radius.circular(8),
|
||||||
),
|
),
|
||||||
child: _buildImage(
|
child: _buildImage(x.image!),
|
||||||
snapshot.data!.image!,
|
|
||||||
),
|
|
||||||
).paddingOnly(bottom: 8),
|
).paddingOnly(bottom: 8),
|
||||||
Text(
|
Text(
|
||||||
snapshot.data!.title ?? 'No Title',
|
x.title ?? 'No Title',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
),
|
),
|
||||||
if (snapshot.data!.description != null &&
|
if (x.description != null && isRichDescription)
|
||||||
isRichDescription)
|
MarkdownBody(data: x.description!)
|
||||||
MarkdownBody(data: snapshot.data!.description!)
|
else if (x.description != null)
|
||||||
else if (snapshot.data!.description != null)
|
|
||||||
Text(
|
Text(
|
||||||
snapshot.data!.description!,
|
x.description!,
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@ -117,7 +131,7 @@ class LinkExpansion extends StatelessWidget {
|
|||||||
).paddingAll(12),
|
).paddingAll(12),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrlString(x.group(0)!);
|
launchUrlString(x.url);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown_selectionarea/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:markdown/markdown.dart' as markdown;
|
import 'package:markdown/markdown.dart' as markdown;
|
||||||
import 'package:markdown/markdown.dart';
|
import 'package:path/path.dart';
|
||||||
import 'package:solian/providers/stickers.dart';
|
import 'package:solian/providers/stickers.dart';
|
||||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||||
import 'package:solian/widgets/auto_cache_image.dart';
|
import 'package:solian/widgets/auto_cache_image.dart';
|
||||||
|
import 'package:syntax_highlight/syntax_highlight.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
import 'account/account_profile_popup.dart';
|
import 'account/account_profile_popup.dart';
|
||||||
@ -39,11 +43,6 @@ class MarkdownTextContent extends StatelessWidget {
|
|||||||
// Getting paragraph
|
// Getting paragraph
|
||||||
var paragraph = paragraphs[idx];
|
var paragraph = paragraphs[idx];
|
||||||
|
|
||||||
// Auto adding new-lines
|
|
||||||
if (isAutoWarp) {
|
|
||||||
paragraph = paragraph.replaceAll('\n', '\\\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Matching stickers
|
// Matching stickers
|
||||||
final stickerMatch = stickerRegex.allMatches(paragraph);
|
final stickerMatch = stickerRegex.allMatches(paragraph);
|
||||||
final isOnlySticker =
|
final isOnlySticker =
|
||||||
@ -58,7 +57,7 @@ class MarkdownTextContent extends StatelessWidget {
|
|||||||
styleSheet: MarkdownStyleSheet.fromTheme(
|
styleSheet: MarkdownStyleSheet.fromTheme(
|
||||||
Theme.of(context),
|
Theme.of(context),
|
||||||
).copyWith(
|
).copyWith(
|
||||||
textScaleFactor: isLargeText ? 1.1 : 1,
|
textScaler: TextScaler.linear(isLargeText ? 1.1 : 1),
|
||||||
blockquote: TextStyle(
|
blockquote: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
@ -74,15 +73,32 @@ class MarkdownTextContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
codeblockDecoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
width: 0.3,
|
||||||
),
|
),
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||||
|
color: Theme.of(context).colorScheme.surface.withOpacity(0.5),
|
||||||
|
)),
|
||||||
|
builders: {
|
||||||
|
'code': _MarkdownTextCodeElement(),
|
||||||
|
},
|
||||||
|
softLineBreak: true,
|
||||||
extensionSet: markdown.ExtensionSet(
|
extensionSet: markdown.ExtensionSet(
|
||||||
markdown.ExtensionSet.gitHubFlavored.blockSyntaxes,
|
<markdown.BlockSyntax>[
|
||||||
|
markdown.CodeBlockSyntax(),
|
||||||
|
...markdown.ExtensionSet.commonMark.blockSyntaxes,
|
||||||
|
...markdown.ExtensionSet.gitHubFlavored.blockSyntaxes,
|
||||||
|
],
|
||||||
<markdown.InlineSyntax>[
|
<markdown.InlineSyntax>[
|
||||||
|
if (isAutoWarp) markdown.LineBreakSyntax(),
|
||||||
_UserNameCardInlineSyntax(),
|
_UserNameCardInlineSyntax(),
|
||||||
_CustomEmoteInlineSyntax(),
|
_CustomEmoteInlineSyntax(),
|
||||||
markdown.EmojiSyntax(),
|
|
||||||
markdown.AutolinkSyntax(),
|
markdown.AutolinkSyntax(),
|
||||||
markdown.AutolinkExtensionSyntax(),
|
markdown.AutolinkExtensionSyntax(),
|
||||||
|
markdown.CodeSyntax(),
|
||||||
|
...markdown.ExtensionSet.commonMark.inlineSyntaxes,
|
||||||
...markdown.ExtensionSet.gitHubFlavored.inlineSyntaxes
|
...markdown.ExtensionSet.gitHubFlavored.inlineSyntaxes
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -184,7 +200,7 @@ class MarkdownTextContent extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (idx < paragraphs.length - 1) {
|
if (idx < paragraphs.length - 1) {
|
||||||
contentWidgets.add(const Gap(4));
|
contentWidgets.add(isAutoWarp ? const Gap(4) : const Gap(8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +221,7 @@ class MarkdownTextContent extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _UserNameCardInlineSyntax extends InlineSyntax {
|
class _UserNameCardInlineSyntax extends markdown.InlineSyntax {
|
||||||
_UserNameCardInlineSyntax() : super(r'@[a-zA-Z0-9_]+');
|
_UserNameCardInlineSyntax() : super(r'@[a-zA-Z0-9_]+');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -221,7 +237,7 @@ class _UserNameCardInlineSyntax extends InlineSyntax {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CustomEmoteInlineSyntax extends InlineSyntax {
|
class _CustomEmoteInlineSyntax extends markdown.InlineSyntax {
|
||||||
_CustomEmoteInlineSyntax() : super(r':([-\w]+):');
|
_CustomEmoteInlineSyntax() : super(r':([-\w]+):');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -241,3 +257,48 @@ class _CustomEmoteInlineSyntax extends InlineSyntax {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _MarkdownTextCodeElement extends MarkdownElementBuilder {
|
||||||
|
@override
|
||||||
|
Widget? visitElementAfter(
|
||||||
|
markdown.Element element,
|
||||||
|
TextStyle? preferredStyle,
|
||||||
|
) {
|
||||||
|
var language = '';
|
||||||
|
|
||||||
|
if (element.attributes['class'] != null) {
|
||||||
|
String lg = element.attributes['class'] as String;
|
||||||
|
language = lg.substring(9).trim();
|
||||||
|
}
|
||||||
|
return SizedBox(
|
||||||
|
child: FutureBuilder(
|
||||||
|
future: (() async {
|
||||||
|
final docPath = '../../../';
|
||||||
|
final highlightingPath =
|
||||||
|
join(docPath, 'assets/highlighting', language);
|
||||||
|
await Highlighter.initialize([highlightingPath]);
|
||||||
|
return Highlighter(
|
||||||
|
language: highlightingPath,
|
||||||
|
theme: PlatformDispatcher.instance.platformBrightness ==
|
||||||
|
Brightness.light
|
||||||
|
? await HighlighterTheme.loadLightTheme()
|
||||||
|
: await HighlighterTheme.loadDarkTheme(),
|
||||||
|
);
|
||||||
|
})(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
final highlighter = snapshot.data!;
|
||||||
|
return Text.rich(
|
||||||
|
highlighter.highlight(element.textContent.trim()),
|
||||||
|
style: GoogleFonts.robotoMono(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Text(
|
||||||
|
element.textContent.trim(),
|
||||||
|
style: GoogleFonts.robotoMono(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
).paddingAll(8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -69,7 +69,7 @@ class _AppAccountWidgetState extends State<AppAccountWidget> {
|
|||||||
bottom: 0,
|
bottom: 0,
|
||||||
end: -2,
|
end: -2,
|
||||||
),
|
),
|
||||||
child: AccountAvatar(
|
child: AttachedCircleAvatar(
|
||||||
radius: 14,
|
radius: 14,
|
||||||
content: auth.userProfile.value!['avatar'],
|
content: auth.userProfile.value!['avatar'],
|
||||||
),
|
),
|
||||||
|
@ -27,7 +27,9 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return NavigationRail(
|
return Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: NavigationRail(
|
||||||
selectedIndex: _currentIndex,
|
selectedIndex: _currentIndex,
|
||||||
labelType: NavigationRailLabelType.selected,
|
labelType: NavigationRailLabelType.selected,
|
||||||
groupAlignment: -1,
|
groupAlignment: -1,
|
||||||
@ -48,7 +50,8 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
|
|||||||
tooltip: AppNavigation.destinations.last.label,
|
tooltip: AppNavigation.destinations.last.label,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() => _currentIndex = null);
|
setState(() => _currentIndex = null);
|
||||||
AppRouter.instance.goNamed(AppNavigation.destinations.last.page);
|
AppRouter.instance
|
||||||
|
.goNamed(AppNavigation.destinations.last.page);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -60,6 +63,7 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
|
|||||||
).paddingOnly(
|
).paddingOnly(
|
||||||
top: max(16, MediaQuery.of(context).padding.top),
|
top: max(16, MediaQuery.of(context).padding.top),
|
||||||
bottom: max(16, MediaQuery.of(context).padding.bottom),
|
bottom: max(16, MediaQuery.of(context).padding.bottom),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class RealmSwitcher extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
if (item != null)
|
if (item != null)
|
||||||
AccountAvatar(
|
AttachedCircleAvatar(
|
||||||
content: item.avatar,
|
content: item.avatar,
|
||||||
radius: 14,
|
radius: 14,
|
||||||
fallbackWidget: const Icon(
|
fallbackWidget: const Icon(
|
||||||
|
108
lib/widgets/posts/post_creation.dart
Normal file
108
lib/widgets/posts/post_creation.dart
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/providers/auth.dart';
|
||||||
|
import 'package:solian/router.dart';
|
||||||
|
|
||||||
|
class PostCreatePopup extends StatelessWidget {
|
||||||
|
final bool hideDraftBox;
|
||||||
|
|
||||||
|
const PostCreatePopup({
|
||||||
|
super.key,
|
||||||
|
this.hideDraftBox = false,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
|
|
||||||
|
if (auth.isAuthorized.isFalse) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<dynamic> actionList = [
|
||||||
|
(
|
||||||
|
icon: const Icon(Icons.post_add),
|
||||||
|
label: 'postEditorModeStory'.tr,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(
|
||||||
|
context,
|
||||||
|
AppRouter.instance.pushNamed(
|
||||||
|
'postEditor',
|
||||||
|
queryParameters: {
|
||||||
|
'mode': 0.toString(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
icon: const Icon(Icons.description),
|
||||||
|
label: 'postEditorModeArticle'.tr,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(
|
||||||
|
context,
|
||||||
|
AppRouter.instance.pushNamed(
|
||||||
|
'postEditor',
|
||||||
|
queryParameters: {
|
||||||
|
'mode': 1.toString(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
icon: const Icon(Icons.drafts),
|
||||||
|
label: 'draftBoxOpen'.tr,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(
|
||||||
|
context,
|
||||||
|
AppRouter.instance.pushNamed('draftBox'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.38,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'postNew'.tr,
|
||||||
|
style: Theme.of(context).textTheme.headlineSmall,
|
||||||
|
).paddingOnly(left: 24, right: 24, top: 32, bottom: 16),
|
||||||
|
Expanded(
|
||||||
|
child: GridView.count(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
crossAxisCount: 3,
|
||||||
|
children: actionList
|
||||||
|
.map((x) => Card(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
|
onTap: x.onTap,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
x.icon,
|
||||||
|
const Gap(8),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
x.label,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingAll(18),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
).paddingSymmetric(horizontal: 20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -8,11 +8,11 @@ import 'package:get/get.dart';
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/screens/posts/post_detail.dart';
|
import 'package:solian/screens/posts/post_detail.dart';
|
||||||
import 'package:solian/shells/title_shell.dart';
|
import 'package:solian/shells/title_shell.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/account/account_avatar.dart';
|
import 'package:solian/widgets/account/account_avatar.dart';
|
||||||
import 'package:solian/widgets/account/account_profile_popup.dart';
|
|
||||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||||
import 'package:solian/widgets/link_expansion.dart';
|
import 'package:solian/widgets/link_expansion.dart';
|
||||||
import 'package:solian/widgets/markdown_text_content.dart';
|
import 'package:solian/widgets/markdown_text_content.dart';
|
||||||
@ -35,8 +35,12 @@ class PostItem extends StatefulWidget {
|
|||||||
final bool isContentSelectable;
|
final bool isContentSelectable;
|
||||||
final bool showFeaturedReply;
|
final bool showFeaturedReply;
|
||||||
final String? attachmentParent;
|
final String? attachmentParent;
|
||||||
|
|
||||||
|
final EdgeInsets? padding;
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
|
||||||
|
final Function? onComment;
|
||||||
|
|
||||||
const PostItem({
|
const PostItem({
|
||||||
super.key,
|
super.key,
|
||||||
required this.item,
|
required this.item,
|
||||||
@ -51,7 +55,9 @@ class PostItem extends StatefulWidget {
|
|||||||
this.isContentSelectable = false,
|
this.isContentSelectable = false,
|
||||||
this.showFeaturedReply = false,
|
this.showFeaturedReply = false,
|
||||||
this.attachmentParent,
|
this.attachmentParent,
|
||||||
|
this.padding,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
|
this.onComment,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -92,8 +98,6 @@ class _PostItemState extends State<PostItem> {
|
|||||||
item: item,
|
item: item,
|
||||||
).paddingSymmetric(horizontal: 12),
|
).paddingSymmetric(horizontal: 12),
|
||||||
_PostHeaderDividerWidget(item: item).paddingSymmetric(horizontal: 12),
|
_PostHeaderDividerWidget(item: item).paddingSymmetric(horizontal: 12),
|
||||||
Stack(
|
|
||||||
children: [
|
|
||||||
SizedContainer(
|
SizedContainer(
|
||||||
maxWidth: 640,
|
maxWidth: 640,
|
||||||
maxHeight: widget.isFullContent ? double.infinity : 80,
|
maxHeight: widget.isFullContent ? double.infinity : 80,
|
||||||
@ -110,43 +114,24 @@ class _PostItemState extends State<PostItem> {
|
|||||||
isSelectable: widget.isContentSelectable,
|
isSelectable: widget.isContentSelectable,
|
||||||
),
|
),
|
||||||
).paddingOnly(
|
).paddingOnly(
|
||||||
left: 16,
|
left: 12,
|
||||||
right: 12,
|
right: 12,
|
||||||
top: 2,
|
|
||||||
bottom: hasAttachment ? 4 : 0,
|
bottom: hasAttachment ? 4 : 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_contentHeight >= 80 && !widget.isFullContent)
|
if (_contentHeight >= 80 && !widget.isFullContent)
|
||||||
Align(
|
Opacity(
|
||||||
alignment: Alignment.bottomCenter,
|
opacity: 0.8,
|
||||||
child: IgnorePointer(
|
child: InkWell(child: Text('readMore'.tr)),
|
||||||
child: Container(
|
).paddingOnly(
|
||||||
height: 80,
|
left: 12,
|
||||||
decoration: BoxDecoration(
|
top: 4,
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.bottomCenter,
|
|
||||||
end: Alignment.topCenter,
|
|
||||||
colors: [
|
|
||||||
Theme.of(context).colorScheme.surfaceContainerLow,
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface
|
|
||||||
.withOpacity(0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
LinkExpansion(content: item.body['content']).paddingOnly(
|
LinkExpansion(content: item.body['content']).paddingOnly(
|
||||||
left: 8,
|
left: 8,
|
||||||
right: 8,
|
right: 8,
|
||||||
top: 4,
|
|
||||||
),
|
),
|
||||||
_PostFooterWidget(item: item).paddingOnly(left: 16),
|
|
||||||
if (attachments.isNotEmpty)
|
if (attachments.isNotEmpty)
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -162,39 +147,20 @@ class _PostItemState extends State<PostItem> {
|
|||||||
style: TextStyle(color: _unFocusColor),
|
style: TextStyle(color: _unFocusColor),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
).paddingOnly(left: 16, top: 4),
|
).paddingOnly(left: 14, top: 4),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OpenContainer(
|
return GestureDetector(
|
||||||
tappable: widget.isClickable,
|
child: Column(
|
||||||
closedBuilder: (_, openContainer) => Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_PostThumbnail(
|
_PostThumbnail(
|
||||||
rid: item.body['thumbnail'],
|
rid: item.body['thumbnail'],
|
||||||
parentId: widget.item.id.toString(),
|
parentId: widget.item.id.toString(),
|
||||||
).paddingOnly(bottom: 4),
|
).paddingOnly(bottom: 4),
|
||||||
Row(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
child: AccountAvatar(content: item.author.avatar),
|
|
||||||
onTap: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
useRootNavigator: true,
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
|
||||||
context: context,
|
|
||||||
builder: (context) => AccountProfilePopup(
|
|
||||||
name: item.author.name,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_PostHeaderWidget(
|
_PostHeaderWidget(
|
||||||
@ -202,12 +168,9 @@ class _PostItemState extends State<PostItem> {
|
|||||||
item: item,
|
item: item,
|
||||||
),
|
),
|
||||||
_PostHeaderDividerWidget(item: item),
|
_PostHeaderDividerWidget(item: item),
|
||||||
Stack(
|
|
||||||
children: [
|
|
||||||
SizedContainer(
|
SizedContainer(
|
||||||
maxWidth: 640,
|
maxWidth: 640,
|
||||||
maxHeight:
|
maxHeight: widget.isFullContent ? double.infinity : 320,
|
||||||
widget.isFullContent ? double.infinity : 320,
|
|
||||||
child: _MeasureSize(
|
child: _MeasureSize(
|
||||||
onChange: (size) {
|
onChange: (size) {
|
||||||
setState(() => _contentHeight = size.height);
|
setState(() => _contentHeight = size.height);
|
||||||
@ -219,48 +182,24 @@ class _PostItemState extends State<PostItem> {
|
|||||||
content: item.body['content'],
|
content: item.body['content'],
|
||||||
isAutoWarp: item.type == 'story',
|
isAutoWarp: item.type == 'story',
|
||||||
isSelectable: widget.isContentSelectable,
|
isSelectable: widget.isContentSelectable,
|
||||||
isLargeText: item.type == 'article' &&
|
isLargeText:
|
||||||
widget.isFullContent,
|
item.type == 'article' && widget.isFullContent,
|
||||||
).paddingOnly(left: 12, right: 8),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_contentHeight >= 320 && !widget.isFullContent)
|
if (_contentHeight >= 320 && !widget.isFullContent)
|
||||||
Align(
|
Opacity(
|
||||||
alignment: Alignment.bottomCenter,
|
opacity: 0.8,
|
||||||
child: IgnorePointer(
|
child: InkWell(child: Text('readMore'.tr)),
|
||||||
child: Container(
|
).paddingOnly(top: 4),
|
||||||
height: 320,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.bottomCenter,
|
|
||||||
end: Alignment.topCenter,
|
|
||||||
colors: [
|
|
||||||
(widget.backgroundColor ??
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface),
|
|
||||||
(widget.backgroundColor ??
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface)
|
|
||||||
.withOpacity(0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (widget.item.replyTo != null && widget.isShowEmbed)
|
if (widget.item.replyTo != null && widget.isShowEmbed)
|
||||||
Container(
|
Container(
|
||||||
constraints: const BoxConstraints(maxWidth: 480),
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: _PostEmbedWidget(
|
child: _PostEmbedWidget(
|
||||||
isClickable: widget.isClickable,
|
isClickable: widget.isClickable,
|
||||||
isOverrideEmbedClickable:
|
isOverrideEmbedClickable: widget.isOverrideEmbedClickable,
|
||||||
widget.isOverrideEmbedClickable,
|
|
||||||
item: widget.item.replyTo!,
|
item: widget.item.replyTo!,
|
||||||
username: widget.item.replyTo!.author.name,
|
username: widget.item.replyTo!.author.name,
|
||||||
hintText: 'postRepliedNotify',
|
hintText: 'postRepliedNotify',
|
||||||
@ -271,11 +210,10 @@ class _PostItemState extends State<PostItem> {
|
|||||||
if (widget.item.repostTo != null && widget.isShowEmbed)
|
if (widget.item.repostTo != null && widget.isShowEmbed)
|
||||||
Container(
|
Container(
|
||||||
constraints: const BoxConstraints(maxWidth: 480),
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: _PostEmbedWidget(
|
child: _PostEmbedWidget(
|
||||||
isClickable: widget.isClickable,
|
isClickable: widget.isClickable,
|
||||||
isOverrideEmbedClickable:
|
isOverrideEmbedClickable: widget.isOverrideEmbedClickable,
|
||||||
widget.isOverrideEmbedClickable,
|
|
||||||
item: widget.item.repostTo!,
|
item: widget.item.repostTo!,
|
||||||
username: widget.item.repostTo!.author.name,
|
username: widget.item.repostTo!.author.name,
|
||||||
hintText: 'postRepostedNotify',
|
hintText: 'postRepostedNotify',
|
||||||
@ -283,24 +221,21 @@ class _PostItemState extends State<PostItem> {
|
|||||||
id: widget.item.repostTo!.id.toString(),
|
id: widget.item.repostTo!.id.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_PostFooterWidget(item: item).paddingOnly(left: 12),
|
_PostFooterWidget(item: item),
|
||||||
LinkExpansion(content: item.body['content'])
|
LinkExpansion(content: item.body['content']),
|
||||||
.paddingOnly(top: 4),
|
|
||||||
],
|
],
|
||||||
|
).paddingSymmetric(
|
||||||
|
horizontal: (widget.padding?.horizontal ?? 0) + 16,
|
||||||
),
|
),
|
||||||
|
if (hasAttachment) const Gap(8),
|
||||||
|
_PostAttachmentWidget(
|
||||||
|
item: item,
|
||||||
|
padding: widget.padding,
|
||||||
),
|
),
|
||||||
],
|
if (widget.showFeaturedReply)
|
||||||
).paddingOnly(
|
_PostFeaturedReplyWidget(item: item).paddingSymmetric(
|
||||||
top: 10,
|
horizontal: (widget.padding?.horizontal ?? 0) + 12,
|
||||||
bottom:
|
|
||||||
(attachments.length == 1 && !AppTheme.isLargeScreen(context))
|
|
||||||
? 10
|
|
||||||
: 0,
|
|
||||||
right: 16,
|
|
||||||
left: 16,
|
|
||||||
),
|
),
|
||||||
_PostAttachmentWidget(item: item),
|
|
||||||
if (widget.showFeaturedReply) _PostFeaturedReplyWidget(item: item),
|
|
||||||
if (widget.isShowReply || widget.isReactable)
|
if (widget.isShowReply || widget.isReactable)
|
||||||
PostQuickAction(
|
PostQuickAction(
|
||||||
isShowReply: widget.isShowReply,
|
isShowReply: widget.isShowReply,
|
||||||
@ -312,33 +247,29 @@ class _PostItemState extends State<PostItem> {
|
|||||||
(item.metric!.reactionList[symbol] ?? 0) + changes;
|
(item.metric!.reactionList[symbol] ?? 0) + changes;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onComment: () {
|
||||||
|
if (widget.onComment != null) {
|
||||||
|
widget.onComment!();
|
||||||
|
}
|
||||||
|
},
|
||||||
).paddingOnly(
|
).paddingOnly(
|
||||||
top: (attachments.length == 1 && !AppTheme.isLargeScreen(context))
|
top: 8,
|
||||||
? 10
|
left: (widget.padding?.left ?? 0) + 14,
|
||||||
: 6,
|
right: (widget.padding?.right ?? 0) + 14,
|
||||||
left:
|
|
||||||
(attachments.length == 1 && !AppTheme.isLargeScreen(context))
|
|
||||||
? 24
|
|
||||||
: 60,
|
|
||||||
right: 16,
|
|
||||||
bottom: 10,
|
|
||||||
)
|
)
|
||||||
else
|
|
||||||
const Gap(10),
|
|
||||||
],
|
],
|
||||||
|
).paddingOnly(
|
||||||
|
top: widget.padding?.top ?? 0,
|
||||||
|
bottom: widget.padding?.bottom ?? 0,
|
||||||
),
|
),
|
||||||
openBuilder: (_, __) => TitleShell(
|
onTap: () {
|
||||||
title: 'postDetail'.tr,
|
if (widget.isClickable) {
|
||||||
child: PostDetailScreen(
|
AppRouter.instance.pushNamed(
|
||||||
id: item.id.toString(),
|
'postDetail',
|
||||||
post: item,
|
pathParameters: {'id': item.id.toString()},
|
||||||
),
|
);
|
||||||
),
|
}
|
||||||
closedElevation: 0,
|
},
|
||||||
openElevation: 0,
|
|
||||||
closedColor:
|
|
||||||
widget.backgroundColor ?? Theme.of(context).colorScheme.surface,
|
|
||||||
openColor: Theme.of(context).colorScheme.surface,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -350,7 +281,6 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final isLargeScreen = AppTheme.isLargeScreen(context);
|
|
||||||
final unFocusColor =
|
final unFocusColor =
|
||||||
Theme.of(context).colorScheme.onSurface.withOpacity(0.75);
|
Theme.of(context).colorScheme.onSurface.withOpacity(0.75);
|
||||||
|
|
||||||
@ -358,19 +288,17 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
|
|||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<String> attachments = item.body['attachments'] is List
|
|
||||||
? List.from(item.body['attachments']?.whereType<String>())
|
|
||||||
: List.empty();
|
|
||||||
|
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future:
|
future: Get.find<PostProvider>().listPostFeaturedReply(
|
||||||
Get.find<PostProvider>().listPostFeaturedReply(item.id.toString()),
|
item.id.toString(),
|
||||||
|
),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
if (!snapshot.hasData || snapshot.data!.isEmpty) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 8),
|
||||||
constraints: const BoxConstraints(maxWidth: 480),
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
child: Card(
|
child: Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
@ -384,7 +312,7 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
AccountAvatar(
|
AttachedCircleAvatar(
|
||||||
content: reply.author.avatar,
|
content: reply.author.avatar,
|
||||||
radius: 10,
|
radius: 10,
|
||||||
),
|
),
|
||||||
@ -456,16 +384,9 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
|
|||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
).animate().fadeIn(
|
||||||
.animate()
|
|
||||||
.fadeIn(
|
|
||||||
duration: 300.ms,
|
duration: 300.ms,
|
||||||
curve: Curves.easeIn,
|
curve: Curves.easeIn,
|
||||||
)
|
|
||||||
.paddingOnly(
|
|
||||||
top: (attachments.length == 1 && !isLargeScreen) ? 10 : 6,
|
|
||||||
left: (attachments.length == 1 && !isLargeScreen) ? 24 : 60,
|
|
||||||
right: 16,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -474,8 +395,9 @@ class _PostFeaturedReplyWidget extends StatelessWidget {
|
|||||||
|
|
||||||
class _PostAttachmentWidget extends StatelessWidget {
|
class _PostAttachmentWidget extends StatelessWidget {
|
||||||
final Post item;
|
final Post item;
|
||||||
|
final EdgeInsets? padding;
|
||||||
|
|
||||||
const _PostAttachmentWidget({required this.item});
|
const _PostAttachmentWidget({required this.item, required this.padding});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -485,25 +407,42 @@ class _PostAttachmentWidget extends StatelessWidget {
|
|||||||
? List.from(item.body['attachments']?.whereType<String>())
|
? List.from(item.body['attachments']?.whereType<String>())
|
||||||
: List.empty();
|
: List.empty();
|
||||||
|
|
||||||
if (attachments.length > 3) {
|
if (attachments.isEmpty) return const SizedBox.shrink();
|
||||||
|
|
||||||
|
if (attachments.length == 1 && !isLargeScreen) {
|
||||||
return AttachmentList(
|
return AttachmentList(
|
||||||
parentId: item.id.toString(),
|
parentId: item.id.toString(),
|
||||||
attachmentsId: attachments,
|
attachmentIds: item.preload == null ? attachments : null,
|
||||||
|
attachments: item.preload?.attachments,
|
||||||
autoload: false,
|
autoload: false,
|
||||||
isGrid: true,
|
isFullWidth: true,
|
||||||
).paddingOnly(left: 36, top: 4, bottom: 4);
|
);
|
||||||
} else if (attachments.length > 1 || isLargeScreen) {
|
} else if (attachments.length == 1) {
|
||||||
return AttachmentList(
|
return AttachmentList(
|
||||||
parentId: item.id.toString(),
|
parentId: item.id.toString(),
|
||||||
attachmentsId: attachments,
|
attachmentIds: item.preload == null ? attachments : null,
|
||||||
|
attachments: item.preload?.attachments,
|
||||||
autoload: false,
|
autoload: false,
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
).paddingOnly(left: 60, right: 24, top: 4, bottom: 4);
|
).paddingSymmetric(horizontal: (padding?.horizontal ?? 0) + 14);
|
||||||
|
} else if (attachments.length > 1 &&
|
||||||
|
attachments.length % 3 == 0 &&
|
||||||
|
!isLargeScreen) {
|
||||||
|
return AttachmentList(
|
||||||
|
parentId: item.id.toString(),
|
||||||
|
attachmentIds: item.preload == null ? attachments : null,
|
||||||
|
attachments: item.preload?.attachments,
|
||||||
|
autoload: false,
|
||||||
|
isGrid: true,
|
||||||
|
).paddingSymmetric(horizontal: (padding?.horizontal ?? 0) + 14);
|
||||||
} else {
|
} else {
|
||||||
return AttachmentList(
|
return AttachmentList(
|
||||||
flatMaxHeight: MediaQuery.of(context).size.width,
|
|
||||||
parentId: item.id.toString(),
|
parentId: item.id.toString(),
|
||||||
attachmentsId: attachments,
|
attachmentIds: item.preload == null ? attachments : null,
|
||||||
|
attachments: item.preload?.attachments,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: (padding?.horizontal ?? 0) + 14,
|
||||||
|
),
|
||||||
autoload: false,
|
autoload: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -545,16 +484,17 @@ class _PostEmbedWidget extends StatelessWidget {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: unFocusColor,
|
color: unFocusColor,
|
||||||
),
|
),
|
||||||
|
const Gap(6),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
hintText.trParams(
|
hintText.trParams(
|
||||||
{'username': '@$username'},
|
{'username': '@$username'},
|
||||||
),
|
),
|
||||||
style: TextStyle(color: unFocusColor),
|
style: TextStyle(color: unFocusColor),
|
||||||
).paddingOnly(left: 6),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
).paddingOnly(left: 12),
|
).paddingOnly(left: 2),
|
||||||
Card(
|
Card(
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
child: PostItem(
|
child: PostItem(
|
||||||
@ -574,7 +514,7 @@ class _PostEmbedWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
closedElevation: 0,
|
closedElevation: 0,
|
||||||
openElevation: 0,
|
openElevation: 0,
|
||||||
closedColor: Theme.of(context).colorScheme.surface,
|
closedColor: Colors.transparent,
|
||||||
openColor: Theme.of(context).colorScheme.surface,
|
openColor: Theme.of(context).colorScheme.surface,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -590,9 +530,7 @@ class _PostHeaderDividerWidget extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (item.body['description'] != null || item.body['title'] != null) {
|
if (item.body['description'] != null || item.body['title'] != null) {
|
||||||
return const Divider(thickness: 0.3, height: 1).paddingSymmetric(
|
return const Gap(8);
|
||||||
vertical: 8,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
@ -648,7 +586,7 @@ class _PostFooterWidget extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: widgets,
|
children: widgets,
|
||||||
).paddingOnly(top: 4);
|
).paddingSymmetric(vertical: 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -664,49 +602,59 @@ class _PostHeaderWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (isCompact)
|
|
||||||
AccountAvatar(
|
AccountAvatar(
|
||||||
content: item.author.avatar,
|
content: item.author.avatar,
|
||||||
radius: 10,
|
username: item.author.name,
|
||||||
).paddingOnly(left: 2, top: 1),
|
radius: isCompact ? 10 : null,
|
||||||
|
),
|
||||||
|
Gap(isCompact ? 6 : 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
item.author.nick,
|
item.author.nick,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
RelativeDate(item.publishedAt?.toLocal() ?? DateTime.now())
|
if (isCompact) const Gap(4),
|
||||||
.paddingOnly(left: 4),
|
if (isCompact)
|
||||||
|
RelativeDate(
|
||||||
|
item.publishedAt?.toLocal() ?? DateTime.now(),
|
||||||
|
).paddingOnly(top: 1),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (item.body['title'] != null)
|
if (!isCompact)
|
||||||
Text(
|
RelativeDate(item.publishedAt?.toLocal() ?? DateTime.now()),
|
||||||
item.body['title'],
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyMedium!
|
|
||||||
.copyWith(fontSize: 15),
|
|
||||||
),
|
|
||||||
if (item.body['description'] != null)
|
|
||||||
Text(
|
|
||||||
item.body['description'],
|
|
||||||
style: Theme.of(context).textTheme.bodySmall,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
).paddingOnly(left: isCompact ? 6 : 12),
|
),
|
||||||
),
|
),
|
||||||
if (item.type == 'article')
|
if (item.type == 'article')
|
||||||
Badge(
|
Badge(
|
||||||
label: Text('article'.tr),
|
label: Text('article'.tr),
|
||||||
).paddingOnly(top: 3),
|
).paddingOnly(top: 3),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
const Gap(8),
|
||||||
|
if (item.body['title'] != null)
|
||||||
|
Text(
|
||||||
|
item.body['title'],
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
if (item.body['description'] != null)
|
||||||
|
Text(
|
||||||
|
item.body['description'],
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ import 'package:get/get.dart';
|
|||||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
|
import 'package:solian/router.dart';
|
||||||
|
import 'package:solian/screens/posts/post_editor.dart';
|
||||||
import 'package:solian/widgets/posts/post_action.dart';
|
import 'package:solian/widgets/posts/post_action.dart';
|
||||||
import 'package:solian/widgets/posts/post_item.dart';
|
import 'package:solian/widgets/posts/post_item.dart';
|
||||||
|
|
||||||
@ -12,6 +14,7 @@ class PostListWidget extends StatelessWidget {
|
|||||||
final bool isNestedClickable;
|
final bool isNestedClickable;
|
||||||
final PagingController<int, Post> controller;
|
final PagingController<int, Post> controller;
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
final EdgeInsets? padding;
|
||||||
|
|
||||||
const PostListWidget({
|
const PostListWidget({
|
||||||
super.key,
|
super.key,
|
||||||
@ -20,6 +23,7 @@ class PostListWidget extends StatelessWidget {
|
|||||||
this.isClickable = true,
|
this.isClickable = true,
|
||||||
this.isNestedClickable = true,
|
this.isNestedClickable = true,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
|
this.padding,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -29,7 +33,9 @@ class PostListWidget extends StatelessWidget {
|
|||||||
pagingController: controller,
|
pagingController: controller,
|
||||||
builderDelegate: PagedChildBuilderDelegate<Post>(
|
builderDelegate: PagedChildBuilderDelegate<Post>(
|
||||||
itemBuilder: (context, item, index) {
|
itemBuilder: (context, item, index) {
|
||||||
return PostListEntryWidget(
|
return Padding(
|
||||||
|
padding: padding ?? EdgeInsets.zero,
|
||||||
|
child: PostListEntryWidget(
|
||||||
isShowEmbed: isShowEmbed,
|
isShowEmbed: isShowEmbed,
|
||||||
isNestedClickable: isNestedClickable,
|
isNestedClickable: isNestedClickable,
|
||||||
isClickable: isClickable,
|
isClickable: isClickable,
|
||||||
@ -39,6 +45,7 @@ class PostListWidget extends StatelessWidget {
|
|||||||
onUpdate: () {
|
onUpdate: () {
|
||||||
controller.refresh();
|
controller.refresh();
|
||||||
},
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -48,25 +55,25 @@ class PostListWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PostListEntryWidget extends StatelessWidget {
|
class PostListEntryWidget extends StatelessWidget {
|
||||||
final int renderOrder;
|
|
||||||
final bool isShowEmbed;
|
final bool isShowEmbed;
|
||||||
final bool isNestedClickable;
|
final bool isNestedClickable;
|
||||||
final bool isClickable;
|
final bool isClickable;
|
||||||
final bool showFeaturedReply;
|
final bool showFeaturedReply;
|
||||||
final Post item;
|
final Post item;
|
||||||
final Function onUpdate;
|
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
final EdgeInsets? padding;
|
||||||
|
final Function onUpdate;
|
||||||
|
|
||||||
const PostListEntryWidget({
|
const PostListEntryWidget({
|
||||||
super.key,
|
super.key,
|
||||||
this.renderOrder = 0,
|
|
||||||
required this.isShowEmbed,
|
required this.isShowEmbed,
|
||||||
required this.isNestedClickable,
|
required this.isNestedClickable,
|
||||||
required this.isClickable,
|
required this.isClickable,
|
||||||
required this.showFeaturedReply,
|
required this.showFeaturedReply,
|
||||||
required this.item,
|
required this.item,
|
||||||
required this.onUpdate,
|
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
|
this.padding,
|
||||||
|
required this.onUpdate,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -78,7 +85,24 @@ class PostListEntryWidget extends StatelessWidget {
|
|||||||
isShowEmbed: isShowEmbed,
|
isShowEmbed: isShowEmbed,
|
||||||
isClickable: isNestedClickable,
|
isClickable: isNestedClickable,
|
||||||
showFeaturedReply: showFeaturedReply,
|
showFeaturedReply: showFeaturedReply,
|
||||||
|
padding: padding,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
|
onComment: () {
|
||||||
|
AppRouter.instance
|
||||||
|
.pushNamed(
|
||||||
|
'postEditor',
|
||||||
|
extra: PostPublishArguments(reply: item),
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
if (value is Future) {
|
||||||
|
value.then((_) {
|
||||||
|
onUpdate();
|
||||||
|
});
|
||||||
|
} else if (value != null) {
|
||||||
|
onUpdate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
).paddingSymmetric(vertical: 8),
|
).paddingSymmetric(vertical: 8),
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
@ -101,3 +125,49 @@ class PostListEntryWidget extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ControlledPostListWidget extends StatelessWidget {
|
||||||
|
final bool isShowEmbed;
|
||||||
|
final bool isClickable;
|
||||||
|
final bool isNestedClickable;
|
||||||
|
final bool isPinned;
|
||||||
|
final PagingController<int, Post> controller;
|
||||||
|
final EdgeInsets? padding;
|
||||||
|
final Function? onUpdate;
|
||||||
|
|
||||||
|
const ControlledPostListWidget({
|
||||||
|
super.key,
|
||||||
|
required this.controller,
|
||||||
|
this.isShowEmbed = true,
|
||||||
|
this.isClickable = true,
|
||||||
|
this.isNestedClickable = true,
|
||||||
|
this.isPinned = true,
|
||||||
|
this.padding,
|
||||||
|
this.onUpdate,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return PagedSliverList<int, Post>.separated(
|
||||||
|
addRepaintBoundaries: true,
|
||||||
|
pagingController: controller,
|
||||||
|
builderDelegate: PagedChildBuilderDelegate<Post>(
|
||||||
|
itemBuilder: (context, item, index) {
|
||||||
|
if (item.pinnedAt != null && !isPinned) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
return PostListEntryWidget(
|
||||||
|
isShowEmbed: isShowEmbed,
|
||||||
|
isNestedClickable: isNestedClickable,
|
||||||
|
isClickable: isClickable,
|
||||||
|
showFeaturedReply: true,
|
||||||
|
padding: padding,
|
||||||
|
item: item,
|
||||||
|
onUpdate: onUpdate ?? () {},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
separatorBuilder: (_, __) => const Divider(thickness: 0.3, height: 0.3),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@ class PostQuickAction extends StatefulWidget {
|
|||||||
final Post item;
|
final Post item;
|
||||||
final bool isReactable;
|
final bool isReactable;
|
||||||
final bool isShowReply;
|
final bool isShowReply;
|
||||||
|
final Function onComment;
|
||||||
final void Function(String symbol, int num) onReact;
|
final void Function(String symbol, int num) onReact;
|
||||||
|
|
||||||
const PostQuickAction({
|
const PostQuickAction({
|
||||||
@ -18,6 +19,7 @@ class PostQuickAction extends StatefulWidget {
|
|||||||
required this.item,
|
required this.item,
|
||||||
this.isShowReply = true,
|
this.isShowReply = true,
|
||||||
this.isReactable = true,
|
this.isReactable = true,
|
||||||
|
required this.onComment,
|
||||||
required this.onReact,
|
required this.onReact,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -106,7 +108,11 @@ class _PostQuickActionState extends State<PostQuickAction> {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PostReplyListPopup(item: widget.item);
|
return PostReplyListPopup(item: widget.item);
|
||||||
},
|
},
|
||||||
);
|
).then((signal) {
|
||||||
|
if (signal == true) {
|
||||||
|
widget.onComment();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -8,11 +8,13 @@ import 'package:solian/widgets/posts/post_list.dart';
|
|||||||
|
|
||||||
class PostReplyList extends StatefulWidget {
|
class PostReplyList extends StatefulWidget {
|
||||||
final Post item;
|
final Post item;
|
||||||
|
final EdgeInsets? padding;
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
|
||||||
const PostReplyList({
|
const PostReplyList({
|
||||||
super.key,
|
super.key,
|
||||||
required this.item,
|
required this.item,
|
||||||
|
this.padding,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -53,6 +55,7 @@ class _PostReplyListState extends State<PostReplyList> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return PostListWidget(
|
return PostListWidget(
|
||||||
|
padding: widget.padding,
|
||||||
isShowEmbed: false,
|
isShowEmbed: false,
|
||||||
controller: _pagingController,
|
controller: _pagingController,
|
||||||
backgroundColor: widget.backgroundColor,
|
backgroundColor: widget.backgroundColor,
|
||||||
@ -70,16 +73,31 @@ class PostReplyListPopup extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
'postReplies'.tr,
|
'postReplies'.tr,
|
||||||
style: Theme.of(context).textTheme.headlineSmall,
|
style: Theme.of(context).textTheme.headlineSmall,
|
||||||
).paddingOnly(left: 24, right: 24, top: 32, bottom: 16),
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.add_comment),
|
||||||
|
visualDensity: const VisualDensity(horizontal: -4),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingOnly(left: 24, right: 24, top: 24, bottom: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
PostReplyList(
|
PostReplyList(
|
||||||
item: item,
|
item: item,
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
|
||||||
import 'package:solian/models/post.dart';
|
|
||||||
import 'package:solian/widgets/posts/post_list.dart';
|
|
||||||
|
|
||||||
class PostWarpedListWidget extends StatelessWidget {
|
|
||||||
final bool isShowEmbed;
|
|
||||||
final bool isClickable;
|
|
||||||
final bool isNestedClickable;
|
|
||||||
final bool isPinned;
|
|
||||||
final PagingController<int, Post> controller;
|
|
||||||
final Function? onUpdate;
|
|
||||||
|
|
||||||
const PostWarpedListWidget({
|
|
||||||
super.key,
|
|
||||||
required this.controller,
|
|
||||||
this.isShowEmbed = true,
|
|
||||||
this.isClickable = true,
|
|
||||||
this.isNestedClickable = true,
|
|
||||||
this.isPinned = true,
|
|
||||||
this.onUpdate,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return PagedSliverList<int, Post>.separated(
|
|
||||||
addRepaintBoundaries: true,
|
|
||||||
pagingController: controller,
|
|
||||||
builderDelegate: PagedChildBuilderDelegate<Post>(
|
|
||||||
itemBuilder: (context, item, index) {
|
|
||||||
if (item.pinnedAt != null && !isPinned) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
return PostListEntryWidget(
|
|
||||||
renderOrder: index,
|
|
||||||
isShowEmbed: isShowEmbed,
|
|
||||||
isNestedClickable: isNestedClickable,
|
|
||||||
isClickable: isClickable,
|
|
||||||
showFeaturedReply: true,
|
|
||||||
item: item,
|
|
||||||
onUpdate: onUpdate ?? () {},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
separatorBuilder: (_, __) => const Divider(thickness: 0.3, height: 0.3),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -149,7 +149,8 @@ class _RealmMemberListPopupState extends State<RealmMemberListPopup> {
|
|||||||
title: Text(element.account.nick),
|
title: Text(element.account.nick),
|
||||||
subtitle: Text(element.account.name),
|
subtitle: Text(element.account.name),
|
||||||
leading: GestureDetector(
|
leading: GestureDetector(
|
||||||
child: AccountAvatar(content: element.account.avatar),
|
child:
|
||||||
|
AttachedCircleAvatar(content: element.account.avatar),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
|
64
lib/widgets/root_container.dart
Normal file
64
lib/widgets/root_container.dart
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:solian/platform.dart';
|
||||||
|
import 'package:solian/theme.dart';
|
||||||
|
|
||||||
|
class RootContainer extends StatelessWidget {
|
||||||
|
final Widget? child;
|
||||||
|
|
||||||
|
const RootContainer({super.key, this.child});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return FutureBuilder(
|
||||||
|
future: PlatformInfo.isWeb
|
||||||
|
? Future.value(null)
|
||||||
|
: getApplicationDocumentsDirectory(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
final path = '${snapshot.data!.path}/app_background_image';
|
||||||
|
final file = File(path);
|
||||||
|
if (file.existsSync()) {
|
||||||
|
return Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
backgroundBlendMode: BlendMode.darken,
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
image: DecorationImage(
|
||||||
|
opacity: 0.2,
|
||||||
|
image: FileImage(file),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ResponsiveRootContainer extends StatelessWidget {
|
||||||
|
final Widget? child;
|
||||||
|
|
||||||
|
const ResponsiveRootContainer({super.key, this.child});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (AppTheme.isLargeScreen(context)) {
|
||||||
|
return child ?? SizedBox.shrink();
|
||||||
|
} else {
|
||||||
|
return RootContainer(child: child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class EmptyPagePlaceholder extends StatelessWidget {
|
class EmptyPagePlaceholder extends StatelessWidget {
|
||||||
const EmptyPagePlaceholder({super.key});
|
const EmptyPagePlaceholder({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return ResponsiveRootContainer(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||||
|
@ -29,7 +29,7 @@ import protocol_handler_macos
|
|||||||
import screen_brightness_macos
|
import screen_brightness_macos
|
||||||
import share_plus
|
import share_plus
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
import sqflite
|
import sqflite_darwin
|
||||||
import sqlite3_flutter_libs
|
import sqlite3_flutter_libs
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
import wakelock_plus
|
import wakelock_plus
|
||||||
|
@ -8,38 +8,38 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- file_selector_macos (0.0.1):
|
- file_selector_macos (0.0.1):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- Firebase/Analytics (11.0.0):
|
- Firebase/Analytics (11.2.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- Firebase/Core (11.0.0):
|
- Firebase/Core (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseAnalytics (~> 11.0.0)
|
- FirebaseAnalytics (~> 11.2.0)
|
||||||
- Firebase/CoreOnly (11.0.0):
|
- Firebase/CoreOnly (11.2.0):
|
||||||
- FirebaseCore (= 11.0.0)
|
- FirebaseCore (= 11.2.0)
|
||||||
- Firebase/Crashlytics (11.0.0):
|
- Firebase/Crashlytics (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseCrashlytics (~> 11.0.0)
|
- FirebaseCrashlytics (~> 11.2.0)
|
||||||
- Firebase/Messaging (11.0.0):
|
- Firebase/Messaging (11.2.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseMessaging (~> 11.0.0)
|
- FirebaseMessaging (~> 11.2.0)
|
||||||
- firebase_analytics (11.3.2):
|
- firebase_analytics (11.3.3):
|
||||||
- Firebase/Analytics (= 11.0.0)
|
- Firebase/Analytics (= 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- firebase_core (3.5.0):
|
- firebase_core (3.6.0):
|
||||||
- Firebase/CoreOnly (~> 11.0.0)
|
- Firebase/CoreOnly (~> 11.2.0)
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- firebase_crashlytics (4.1.2):
|
- firebase_crashlytics (4.1.3):
|
||||||
- Firebase/CoreOnly (~> 11.0.0)
|
- Firebase/CoreOnly (~> 11.2.0)
|
||||||
- Firebase/Crashlytics (~> 11.0.0)
|
- Firebase/Crashlytics (~> 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- firebase_messaging (15.1.2):
|
- firebase_messaging (15.1.3):
|
||||||
- Firebase/CoreOnly (~> 11.0.0)
|
- Firebase/CoreOnly (~> 11.2.0)
|
||||||
- Firebase/Messaging (~> 11.0.0)
|
- Firebase/Messaging (~> 11.2.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- FirebaseAnalytics (11.0.0):
|
- FirebaseAnalytics (11.2.0):
|
||||||
- FirebaseAnalytics/AdIdSupport (= 11.0.0)
|
- FirebaseAnalytics/AdIdSupport (= 11.2.0)
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
@ -47,24 +47,24 @@ PODS:
|
|||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseAnalytics/AdIdSupport (11.0.0):
|
- FirebaseAnalytics/AdIdSupport (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleAppMeasurement (= 11.0.0)
|
- GoogleAppMeasurement (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseCore (11.0.0):
|
- FirebaseCore (11.2.0):
|
||||||
- FirebaseCoreInternal (~> 11.0)
|
- FirebaseCoreInternal (~> 11.0)
|
||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- GoogleUtilities/Logger (~> 8.0)
|
- GoogleUtilities/Logger (~> 8.0)
|
||||||
- FirebaseCoreExtension (11.2.0):
|
- FirebaseCoreExtension (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseCoreInternal (11.2.0):
|
- FirebaseCoreInternal (11.3.0):
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- FirebaseCrashlytics (11.0.0):
|
- FirebaseCrashlytics (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- FirebaseRemoteConfigInterop (~> 11.0)
|
- FirebaseRemoteConfigInterop (~> 11.0)
|
||||||
@ -73,12 +73,12 @@ PODS:
|
|||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- PromisesObjC (~> 2.4)
|
- PromisesObjC (~> 2.4)
|
||||||
- FirebaseInstallations (11.2.0):
|
- FirebaseInstallations (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- GoogleUtilities/Environment (~> 8.0)
|
- GoogleUtilities/Environment (~> 8.0)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- PromisesObjC (~> 2.4)
|
- PromisesObjC (~> 2.4)
|
||||||
- FirebaseMessaging (11.0.0):
|
- FirebaseMessaging (11.2.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
- GoogleDataTransport (~> 10.0)
|
- GoogleDataTransport (~> 10.0)
|
||||||
@ -87,8 +87,8 @@ PODS:
|
|||||||
- GoogleUtilities/Reachability (~> 8.0)
|
- GoogleUtilities/Reachability (~> 8.0)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.0)
|
- GoogleUtilities/UserDefaults (~> 8.0)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- FirebaseRemoteConfigInterop (11.2.0)
|
- FirebaseRemoteConfigInterop (11.3.0)
|
||||||
- FirebaseSessions (11.2.0):
|
- FirebaseSessions (11.3.0):
|
||||||
- FirebaseCore (~> 11.0)
|
- FirebaseCore (~> 11.0)
|
||||||
- FirebaseCoreExtension (~> 11.0)
|
- FirebaseCoreExtension (~> 11.0)
|
||||||
- FirebaseInstallations (~> 11.0)
|
- FirebaseInstallations (~> 11.0)
|
||||||
@ -108,21 +108,21 @@ PODS:
|
|||||||
- gal (1.0.0):
|
- gal (1.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- GoogleAppMeasurement (11.0.0):
|
- GoogleAppMeasurement (11.2.0):
|
||||||
- GoogleAppMeasurement/AdIdSupport (= 11.0.0)
|
- GoogleAppMeasurement/AdIdSupport (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- GoogleAppMeasurement/AdIdSupport (11.0.0):
|
- GoogleAppMeasurement/AdIdSupport (11.2.0):
|
||||||
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.0.0)
|
- GoogleAppMeasurement/WithoutAdIdSupport (= 11.2.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
- "GoogleUtilities/NSData+zlib (~> 8.0)"
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- GoogleAppMeasurement/WithoutAdIdSupport (11.0.0):
|
- GoogleAppMeasurement/WithoutAdIdSupport (11.2.0):
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
- GoogleUtilities/AppDelegateSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
- GoogleUtilities/MethodSwizzler (~> 8.0)
|
||||||
- GoogleUtilities/Network (~> 8.0)
|
- GoogleUtilities/Network (~> 8.0)
|
||||||
@ -195,7 +195,7 @@ PODS:
|
|||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- sqflite (0.0.3):
|
- sqflite_darwin (0.0.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- "sqlite3 (3.46.1+1)":
|
- "sqlite3 (3.46.1+1)":
|
||||||
@ -249,7 +249,7 @@ DEPENDENCIES:
|
|||||||
- screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`)
|
- screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`)
|
||||||
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
||||||
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
|
- sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`)
|
||||||
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
|
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
|
||||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||||
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)
|
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)
|
||||||
@ -328,8 +328,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
|
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
|
||||||
sqflite:
|
sqflite_darwin:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin
|
:path: Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin
|
||||||
sqlite3_flutter_libs:
|
sqlite3_flutter_libs:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
@ -340,28 +340,28 @@ EXTERNAL SOURCES:
|
|||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
|
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
|
||||||
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
|
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
|
||||||
device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720
|
device_info_plus: f1aae8670672f75c4c8850ecbe0b2ddef62b0a22
|
||||||
file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d
|
file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d
|
||||||
Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9
|
Firebase: 98e6bf5278170668a7983e12971a66b2cd57fc8c
|
||||||
firebase_analytics: a2d0d907566e4a48e27745317f05b4b7db85edd9
|
firebase_analytics: 30ff72f6d4847ff0b479d8edd92fc8582e719072
|
||||||
firebase_core: c55630cdb8a01cf49eae741dd4bc8c93bdd546b8
|
firebase_core: e88f946a4601cb1854178cb07da241bba5a6508e
|
||||||
firebase_crashlytics: a359f1f75a23e560c8c97b743ab684ba795d7688
|
firebase_crashlytics: e09adc8a2db53e71b3ef3d085deb688a0c17467a
|
||||||
firebase_messaging: 12726b352752420d073ff075e328cc2f0ca14c47
|
firebase_messaging: e1b1c1504659e13d66131f62ec22919293cd0d11
|
||||||
FirebaseAnalytics: 27eb78b97880ea4a004839b9bac0b58880f5a92a
|
FirebaseAnalytics: c36efd5710c60c17558650fa58c2066eca7e9265
|
||||||
FirebaseCore: 3cf438f431f18c12cdf2aaf64434648b63f7e383
|
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
|
||||||
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de
|
FirebaseCoreExtension: 30bb063476ef66cd46925243d64ad8b2c8ac3264
|
||||||
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5
|
FirebaseCoreInternal: ac26d09a70c730e497936430af4e60fb0c68ec4e
|
||||||
FirebaseCrashlytics: 745d8f0221fe49c62865391d1bf56f5a12eeec0b
|
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
|
||||||
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a
|
FirebaseInstallations: 58cf94dabf1e2bb2fa87725a9be5c2249171cda0
|
||||||
FirebaseMessaging: d2d1d9c62c46dd2db49a952f7deb5b16ad2c9742
|
FirebaseMessaging: c9ec7b90c399c7a6100297e9d16f8a27fc7f7152
|
||||||
FirebaseRemoteConfigInterop: 477b26fdeb8fb5fbaf22fa9db5343b42289dc7db
|
FirebaseRemoteConfigInterop: c3a5c31b3c22079f41ba1dc645df889d9ce38cb9
|
||||||
FirebaseSessions: adcec8b72d0066a385e3affcd1bcb1ebb3908ce6
|
FirebaseSessions: 655ff17f3cc1a635cbdc2d69b953878001f9e25b
|
||||||
flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4
|
flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4
|
||||||
flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9
|
flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9
|
||||||
flutter_webrtc: 2b4e4a2de70a1485836e40fd71a7a94c77d49bd9
|
flutter_webrtc: 2b4e4a2de70a1485836e40fd71a7a94c77d49bd9
|
||||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||||
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
|
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
|
||||||
GoogleAppMeasurement: 6e49ffac7d3f2c3ded9cc663f912a13b67bbd0de
|
GoogleAppMeasurement: 76d4f8b36b03bd8381fa9a7fe2cc7f99c0a2e93a
|
||||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||||
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
|
||||||
in_app_review: a850789fad746e89bce03d4aeee8078b45a53fd0
|
in_app_review: a850789fad746e89bce03d4aeee8078b45a53fd0
|
||||||
@ -371,16 +371,16 @@ SPEC CHECKSUMS:
|
|||||||
media_kit_native_event_loop: 81fd5b45192b72f8b5b69eaf5b540f45777eb8d5
|
media_kit_native_event_loop: 81fd5b45192b72f8b5b69eaf5b540f45777eb8d5
|
||||||
media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5
|
media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5
|
||||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||||
package_info_plus: fa739dd842b393193c5ca93c26798dff6e3d0e0c
|
package_info_plus: d2f71247aab4b6521434f887276093acc70d214c
|
||||||
pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99
|
pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||||
protocol_handler_macos: d10a6c01d6373389ffd2278013ab4c47ed6d6daa
|
protocol_handler_macos: d10a6c01d6373389ffd2278013ab4c47ed6d6daa
|
||||||
screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda
|
screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda
|
||||||
share_plus: 36537c04ce0c3e3f5bd297ce4318b6d5ee5fd6cf
|
share_plus: a182a58e04e51647c0481aadabbc4de44b3a2bce
|
||||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
|
||||||
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
|
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
|
||||||
sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b
|
sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b
|
||||||
url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404
|
url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>CFBundleLocalizations</key>
|
<key>CFBundleLocalizations</key>
|
||||||
<array>
|
<array>
|
||||||
<string>zh_CN</string>
|
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
</array>
|
</array>
|
||||||
<key>NSUserActivityTypes</key>
|
<key>NSUserActivityTypes</key>
|
||||||
|
224
pubspec.lock
224
pubspec.lock
@ -13,10 +13,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _flutterfire_internals
|
name: _flutterfire_internals
|
||||||
sha256: "5fdcea390499dd26c808a3c662df5f4208d6bbc0643072eee94f1476249e2818"
|
sha256: "5534e701a2c505fed1f0799e652dd6ae23bd4d2c4cf797220e5ced5764a7c1c2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.43"
|
version: "1.3.44"
|
||||||
_macros:
|
_macros:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: dart
|
description: dart
|
||||||
@ -146,10 +146,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
sha256: dd09dd4e2b078992f42aac7f1a622f01882a8492fef08486b27ddde929c19f04
|
sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.12"
|
version: "2.4.13"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -198,14 +198,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
carousel_slider:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: carousel_slider
|
|
||||||
sha256: "7b006ec356205054af5beaef62e2221160ea36b90fb70a35e4deacd49d0349ae"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "5.0.0"
|
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -346,10 +338,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: device_info_plus
|
name: device_info_plus
|
||||||
sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074
|
sha256: db03b2d2a3fa466a4627709e1db58692c3f7f658e36a5942d342d86efedc4091
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.1.2"
|
version: "11.0.0"
|
||||||
device_info_plus_platform_interface:
|
device_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -386,10 +378,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: drift
|
name: drift
|
||||||
sha256: "5b561ec76fff260e1e0593a29ca0d058a140a4b4dfb11dcc0c3813820cd20200"
|
sha256: d6ff1ec6a0f3fa097dda6b776cf601f1f3d88b53b287288e09c1306f394fb1b3
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.20.2"
|
version: "2.20.3"
|
||||||
drift_dev:
|
drift_dev:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -450,10 +442,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.0"
|
version: "7.0.1"
|
||||||
file_picker:
|
file_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -466,18 +458,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_selector_linux
|
name: file_selector_linux
|
||||||
sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492"
|
sha256: "712ce7fab537ba532c8febdb1a8f167b32441e74acd68c3ccb2e36dcb52c4ab2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.2+1"
|
version: "0.9.3"
|
||||||
file_selector_macos:
|
file_selector_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_selector_macos
|
name: file_selector_macos
|
||||||
sha256: cb284e267f8e2a45a904b5c094d2ba51d0aabfc20b1538ab786d9ef7dc2bf75c
|
sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.4+1"
|
version: "0.9.4+2"
|
||||||
file_selector_platform_interface:
|
file_selector_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -490,42 +482,42 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_selector_windows
|
name: file_selector_windows
|
||||||
sha256: "2ad726953f6e8affbc4df8dc78b77c3b4a060967a291e528ef72ae846c60fb69"
|
sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.3+2"
|
version: "0.9.3+3"
|
||||||
firebase_analytics:
|
firebase_analytics:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_analytics
|
name: firebase_analytics
|
||||||
sha256: "9c52c099e9cbb852c7f1d2302c7eb34a15758834eca1877f7a779e6082f9882d"
|
sha256: "2c4e7b548d41b46e8aa08bc3bd1163146be7e6d48f678f2e6dd3114994e42458"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.3.2"
|
version: "11.3.3"
|
||||||
firebase_analytics_platform_interface:
|
firebase_analytics_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_analytics_platform_interface
|
name: firebase_analytics_platform_interface
|
||||||
sha256: "4ec57aee951832fdbf10ca722bbb83fe0001d6168d6c4cfea9ccee0df6afb1e0"
|
sha256: c259ae890c7d4c5d1675d35936be0b1fcd587fce9645948982cd87ad08df6222
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.4"
|
version: "4.2.5"
|
||||||
firebase_analytics_web:
|
firebase_analytics_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_analytics_web
|
name: firebase_analytics_web
|
||||||
sha256: "95c594fb1e8960992a607b135459e2f9ea3683dd8d01e6b845cace7c6665ec7e"
|
sha256: "5988d1fd022e55515c2a14811c9b5104c32acde115874a9a69ff7c77c4c05cd9"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.10+1"
|
version: "0.5.10+2"
|
||||||
firebase_core:
|
firebase_core:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
sha256: c7de9354eb2cd8bfe8059e1112174c9a58beda7051807207306bc48283277cfb
|
sha256: "51dfe2fbf3a984787a2e7b8592f2f05c986bfedd6fdacea3f9e0a7beb334de96"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.5.0"
|
version: "3.6.0"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -546,66 +538,66 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics
|
name: firebase_crashlytics
|
||||||
sha256: "7821f9d8373b91f2a5ca8214226891d5870e196a7376f66350f65204387e9c15"
|
sha256: "6899800fff1af819955aef740f18c4c8600f8b952a2a1ea97bc0872ebb257387"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.2"
|
version: "4.1.3"
|
||||||
firebase_crashlytics_platform_interface:
|
firebase_crashlytics_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_crashlytics_platform_interface
|
name: firebase_crashlytics_platform_interface
|
||||||
sha256: "8ed539fd9e9b6c07905f9f44c5f6d4785ac841a5a8195bd35586c8b1d54ec26d"
|
sha256: "97c47b0a1779a3d4118416a3f0c6c564cc59ad89095e899893204d4b2ad08f4c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.43"
|
version: "3.6.44"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging
|
name: firebase_messaging
|
||||||
sha256: "32ce60b747e755b48d7112d728d4f736ba82acd98ec825626558d444d385fa3a"
|
sha256: eb6e28a3a35deda61fe8634967c84215efc19133ba58d8e0fc6c9a2af2cba05e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "15.1.2"
|
version: "15.1.3"
|
||||||
firebase_messaging_platform_interface:
|
firebase_messaging_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging_platform_interface
|
name: firebase_messaging_platform_interface
|
||||||
sha256: "69671a0f1a40c7b7c46ad0283e6f34ca2a59a0362ca14a240a4ea01c46e8a521"
|
sha256: b316c4ee10d93d32c033644207afc282d9b2b4372f3cf9c6022f3558b3873d2d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.45"
|
version: "4.5.46"
|
||||||
firebase_messaging_web:
|
firebase_messaging_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging_web
|
name: firebase_messaging_web
|
||||||
sha256: "6890111a9d01d7b13d0f6fe74850812c334e903d2c80a2d9356a3abb8c3a9e9a"
|
sha256: d7f0147a1a9fe4313168e20154a01fd5cf332898de1527d3930ff77b8c7f5387
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.9.1"
|
version: "3.9.2"
|
||||||
firebase_performance:
|
firebase_performance:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_performance
|
name: firebase_performance
|
||||||
sha256: ed9a408b6d1f221fc0e2890dcf0733b604d1aea6cd3b897f97dd3f889f01ddfc
|
sha256: "0df8208afad64aa1d774bd267033312284bd73e68210caf6936dc1f8a8fa0878"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.0+7"
|
version: "0.10.0+8"
|
||||||
firebase_performance_platform_interface:
|
firebase_performance_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_performance_platform_interface
|
name: firebase_performance_platform_interface
|
||||||
sha256: bfcfbfcefeaf3853a72602675b786e13a609d49ac70fc325d302b5794b8b0c06
|
sha256: "97cc3fcda0a835142ff2e93b19dd72904d666a576e196f12cdaf492921e6ea44"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.4+43"
|
version: "0.1.4+44"
|
||||||
firebase_performance_web:
|
firebase_performance_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_performance_web
|
name: firebase_performance_web
|
||||||
sha256: "2ac9e44a1be7b20f1a7a3912d84bf2e1ec76398f2dadc07b6b7c3173d590e329"
|
sha256: "322a4ae99cb952cdfd788399f52421dd6ecd713723ac7e5e6bb7856bb28ef270"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.7+1"
|
version: "0.1.7+2"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -695,10 +687,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_card_swiper
|
name: flutter_card_swiper
|
||||||
sha256: "880ad669017154d6d1f8c3abd861db08af97b3b7b0f7d7d5cbde690a9253811d"
|
sha256: "1eacbfab31b572223042e03409726553aec431abe48af48c8d591d376d070d3d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.1"
|
version: "7.0.2"
|
||||||
flutter_keyboard_visibility:
|
flutter_keyboard_visibility:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -751,18 +743,18 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_launcher_icons
|
name: flutter_launcher_icons
|
||||||
sha256: a38f2f1b3c373d42bf08bd17d60e20d3c73abce7727607b4d085ec7d5acaa294
|
sha256: "619817c4b65b322b5104b6bb6dfe6cda62d9729bd7ad4303ecc8b4e690a67a77"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.14.0"
|
version: "0.14.1"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
|
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "5.0.0"
|
||||||
flutter_local_notifications:
|
flutter_local_notifications:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -791,18 +783,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_markdown
|
name: flutter_markdown
|
||||||
sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7
|
sha256: e17575ca576a34b46c58c91f9948891117a1bd97815d2e661813c7f90c647a78
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.3+1"
|
version: "0.7.3+2"
|
||||||
flutter_markdown_selectionarea:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_markdown_selectionarea
|
|
||||||
sha256: d4bc27e70a5c40ebdab23a4b81f75d53696a214d4d1f13c12045b38a0ddc58a2
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.6.17+1"
|
|
||||||
flutter_native_splash:
|
flutter_native_splash:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -815,10 +799,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_plugin_android_lifecycle
|
name: flutter_plugin_android_lifecycle
|
||||||
sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda"
|
sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.22"
|
version: "2.0.23"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -871,10 +855,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_shaders
|
name: flutter_shaders
|
||||||
sha256: "02750b545c01ff4d8e9bbe8f27a7731aa3778402506c67daa1de7f5fc3f4befe"
|
sha256: "34794acadd8275d971e02df03afee3dee0f98dbfb8c4837082ad0034f612a3e2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.2"
|
version: "0.1.3"
|
||||||
flutter_staggered_grid_view:
|
flutter_staggered_grid_view:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -969,10 +953,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: go_router
|
name: go_router
|
||||||
sha256: "2ddb88e9ad56ae15ee144ed10e33886777eb5ca2509a914850a5faa7b52ff459"
|
sha256: "6f1b756f6e863259a99135ff3c95026c3cdca17d10ebef2bba2261a25ddc8bbc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.7"
|
version: "14.3.0"
|
||||||
google_fonts:
|
google_fonts:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1073,10 +1057,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image_picker_android
|
name: image_picker_android
|
||||||
sha256: c0a6763d50b354793d0192afd0a12560b823147d3ded7c6b77daf658fa05cc85
|
sha256: d3e5e00fdfeca8fd4ffb3227001264d449cc8950414c2ff70b0e06b9c628e643
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.12+13"
|
version: "0.8.12+15"
|
||||||
image_picker_for_web:
|
image_picker_for_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1217,10 +1201,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
|
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "5.0.0"
|
||||||
livekit_client:
|
livekit_client:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1409,10 +1393,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: package_info_plus
|
name: package_info_plus
|
||||||
sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918
|
sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.0.2"
|
version: "8.0.3"
|
||||||
package_info_plus_platform_interface:
|
package_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1457,10 +1441,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
|
sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.10"
|
version: "2.2.12"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1777,18 +1761,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: share_plus
|
name: share_plus
|
||||||
sha256: "468c43f285207c84bcabf5737f33b914ceb8eb38398b91e5e3ad1698d1b72a52"
|
sha256: fec12c3c39f01e4df1ec6ad92b6e85503c5ca64ffd6e28d18c9ffe53fcc4cb11
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.2"
|
version: "10.0.3"
|
||||||
share_plus_platform_interface:
|
share_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: share_plus_platform_interface
|
name: share_plus_platform_interface
|
||||||
sha256: "6ababf341050edff57da8b6990f11f4e99eaba837865e2e6defe16d039619db5"
|
sha256: c57c0bbfec7142e3a0f55633be504b796af72e60e3c791b44d5a017b985f7a48
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "5.0.1"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1801,18 +1785,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_android
|
name: shared_preferences_android
|
||||||
sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e"
|
sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.2"
|
version: "2.3.3"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_foundation
|
name: shared_preferences_foundation
|
||||||
sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f
|
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.2"
|
version: "2.5.3"
|
||||||
shared_preferences_linux:
|
shared_preferences_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1910,18 +1894,42 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite
|
name: sqflite
|
||||||
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
|
sha256: "79a297dc3cc137e758c6a4baf83342b039e5a6d2436fcdf3f96a00adaaf2ad62"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.3+1"
|
version: "2.4.0"
|
||||||
|
sqflite_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_android
|
||||||
|
sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
sqflite_common:
|
sqflite_common:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite_common
|
name: sqflite_common
|
||||||
sha256: "4058172e418eb7e7f2058dcb7657d451a8fc264afa0dea4dbd0f304a57131611"
|
sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.4+3"
|
version: "2.5.4+5"
|
||||||
|
sqflite_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_darwin
|
||||||
|
sha256: "769733dddf94622d5541c73e4ddc6aa7b252d865285914b6fcd54a63c4b4f027"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1-1"
|
||||||
|
sqflite_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_platform_interface
|
||||||
|
sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
sqlite3:
|
sqlite3:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1982,10 +1990,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: synchronized
|
name: synchronized
|
||||||
sha256: "51b08572b9f091f8c3eb4d9d4be253f196ff0075d5ec9b10a884026d5b55d7bc"
|
sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.0+2"
|
version: "3.3.0+3"
|
||||||
|
syntax_highlight:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: syntax_highlight
|
||||||
|
sha256: ee33b6aa82cc722bb9b40152a792181dee222353b486c0255fde666a3e3a4997
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2062,18 +2078,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
|
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.0"
|
version: "6.3.1"
|
||||||
url_launcher_android:
|
url_launcher_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_android
|
name: url_launcher_android
|
||||||
sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab
|
sha256: "8fc3bae0b68c02c47c5c86fa8bfa74471d42687b0eded01b78de87872db745e2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.10"
|
version: "6.3.12"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2126,10 +2142,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: uuid
|
name: uuid
|
||||||
sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77
|
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.0"
|
version: "4.5.1"
|
||||||
vector_graphics:
|
vector_graphics:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2222,10 +2238,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web
|
name: web
|
||||||
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
|
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.1.0"
|
||||||
web_socket:
|
web_socket:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2254,10 +2270,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
|
sha256: e5c39a90447e7c81cfec14b041cdbd0d0916bd9ebbc7fe02ab69568be703b9bd
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.5.4"
|
version: "5.6.0"
|
||||||
win32_registry:
|
win32_registry:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2270,10 +2286,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xdg_directories
|
name: xdg_directories
|
||||||
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
|
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.1.0"
|
||||||
xml:
|
xml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
10
pubspec.yaml
10
pubspec.yaml
@ -2,7 +2,7 @@ name: solian
|
|||||||
description: "The Solar Network App"
|
description: "The Solar Network App"
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 1.3.6+2
|
version: 1.3.7+9
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.4 <4.0.0"
|
sdk: ">=3.3.4 <4.0.0"
|
||||||
@ -18,7 +18,6 @@ dependencies:
|
|||||||
flutter_markdown: ^0.7.1
|
flutter_markdown: ^0.7.1
|
||||||
flutter_animate: ^4.5.0
|
flutter_animate: ^4.5.0
|
||||||
flutter_secure_storage: ^9.2.1
|
flutter_secure_storage: ^9.2.1
|
||||||
carousel_slider: ^5.0.0
|
|
||||||
url_launcher: ^6.2.6
|
url_launcher: ^6.2.6
|
||||||
infinite_scroll_pagination: ^4.0.0
|
infinite_scroll_pagination: ^4.0.0
|
||||||
image_picker: ^1.1.1
|
image_picker: ^1.1.1
|
||||||
@ -38,7 +37,7 @@ dependencies:
|
|||||||
firebase_core: ^3.0.0
|
firebase_core: ^3.0.0
|
||||||
firebase_messaging: ^15.0.0
|
firebase_messaging: ^15.0.0
|
||||||
package_info_plus: ^8.0.0
|
package_info_plus: ^8.0.0
|
||||||
device_info_plus: ^10.1.0
|
device_info_plus: ^11.0.0
|
||||||
flutter_acrylic: ^1.1.4
|
flutter_acrylic: ^1.1.4
|
||||||
protocol_handler: ^0.2.0
|
protocol_handler: ^0.2.0
|
||||||
markdown: ^7.2.2
|
markdown: ^7.2.2
|
||||||
@ -49,7 +48,6 @@ dependencies:
|
|||||||
dismissible_page: ^1.0.2
|
dismissible_page: ^1.0.2
|
||||||
share_plus: ^10.0.0
|
share_plus: ^10.0.0
|
||||||
flutter_cache_manager: ^3.3.3
|
flutter_cache_manager: ^3.3.3
|
||||||
flutter_markdown_selectionarea: ^0.6.17+1
|
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
provider: ^6.1.2
|
provider: ^6.1.2
|
||||||
gal: ^2.3.0
|
gal: ^2.3.0
|
||||||
@ -84,12 +82,13 @@ dependencies:
|
|||||||
version: ^3.0.2
|
version: ^3.0.2
|
||||||
action_slider: ^0.7.0
|
action_slider: ^0.7.0
|
||||||
in_app_review: ^2.0.9
|
in_app_review: ^2.0.9
|
||||||
|
syntax_highlight: ^0.4.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
flutter_lints: ^4.0.0
|
flutter_lints: ^5.0.0
|
||||||
flutter_launcher_icons: ^0.14.0
|
flutter_launcher_icons: ^0.14.0
|
||||||
|
|
||||||
build_runner: ^2.4.12
|
build_runner: ^2.4.12
|
||||||
@ -103,6 +102,7 @@ flutter:
|
|||||||
assets:
|
assets:
|
||||||
- assets/logo.png
|
- assets/logo.png
|
||||||
- assets/locales/
|
- assets/locales/
|
||||||
|
- assets/highlighting/
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: NotoSansEmoji
|
- family: NotoSansEmoji
|
||||||
|
9
roadsign.toml
Normal file
9
roadsign.toml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
id = "solian"
|
||||||
|
|
||||||
|
[[locations]]
|
||||||
|
id = "solian"
|
||||||
|
host = ["sn.solsynth.dev"]
|
||||||
|
path = ["/"]
|
||||||
|
[[locations.destinations]]
|
||||||
|
id = "solian-web"
|
||||||
|
uri = "files:///workdir/solian?fallback=index.html&index=index.html"
|
Reference in New Issue
Block a user