fix time display
This commit is contained in:
parent
0e844936c7
commit
44bdefd99a
|
@ -85,10 +85,6 @@ class AccountSettings {
|
|||
}
|
||||
|
||||
class Settings {
|
||||
static const currentClientSecretKey = "currentsecret";
|
||||
late String currentClientSecret;
|
||||
static const currentClientIdkey = "currentclientid";
|
||||
late String currentClientId;
|
||||
late double postWidth = 0.8;
|
||||
static const postWidthKey = "post-width";
|
||||
late double maxPostWidth = 1000;
|
||||
|
@ -111,11 +107,6 @@ class Settings {
|
|||
Settings settings = Settings._create();
|
||||
|
||||
settings.prefs = await SharedPreferences.getInstance();
|
||||
|
||||
settings.currentClientSecret =
|
||||
settings.prefs.getString(currentClientSecretKey) ?? "";
|
||||
settings.currentClientId =
|
||||
settings.prefs.getString(currentClientIdkey) ?? "";
|
||||
settings.locale = Locale(settings.prefs.getString(localeKey) ?? "en");
|
||||
|
||||
settings.batchSize = settings.prefs.getInt(batchSizeKey) ?? 20;
|
||||
|
@ -160,16 +151,6 @@ class Settings {
|
|||
return prefs.setDouble(maxPostWidthKey, width);
|
||||
}
|
||||
|
||||
Future<bool> saveCurrentClientId(String id) async {
|
||||
currentClientId = id;
|
||||
return prefs.setString(currentClientIdkey, id);
|
||||
}
|
||||
|
||||
Future<bool> saveCurrentClientSecret(String secret) async {
|
||||
currentClientId = secret;
|
||||
return prefs.setString(currentClientSecretKey, secret);
|
||||
}
|
||||
|
||||
Future<bool> savePostWidth(double width) {
|
||||
postWidth = width;
|
||||
return prefs.setDouble(postWidthKey, width);
|
||||
|
|
|
@ -70,6 +70,7 @@ class _MakePostState extends State<MakePost> {
|
|||
@override
|
||||
void initState() {
|
||||
if (widget.inReplyTo != null) {
|
||||
visibility = widget.inReplyTo!.visibility;
|
||||
addAt(widget.inReplyTo!.account.acct);
|
||||
for (var element in widget.inReplyTo!.mentions) {
|
||||
addAt(element.acct);
|
||||
|
@ -174,7 +175,7 @@ class _MakePostState extends State<MakePost> {
|
|||
// send the post!!!
|
||||
onPressed: () async {
|
||||
final model = MakePostModel(
|
||||
spoilerText: spoilerText,
|
||||
spoilerText: spoilerText.trim(),
|
||||
identity: accountid,
|
||||
status: text,
|
||||
visibility: visibility,
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"media-not-supported": "media type not supported",
|
||||
"show-about-page": "show about page",
|
||||
"about": "about",
|
||||
"load-more": "load more",
|
||||
"account-settings": "account settings",
|
||||
"logout": "log out",
|
||||
"show-in-browser": "show in browser",
|
||||
|
@ -55,6 +56,13 @@
|
|||
"send-post": "computer, send post",
|
||||
"jacking-in": "jacking in...",
|
||||
"jack-in": "jack in",
|
||||
"add-account": "add account"
|
||||
"add-account": "add account",
|
||||
"day-1": "monday",
|
||||
"day-2": "tuesday",
|
||||
"day-3": "wednesday",
|
||||
"day-4": "thursday",
|
||||
"day-5": "friday",
|
||||
"day-6": "saturday",
|
||||
"day-7": "sunday"
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ class _WebloginState extends State<Weblogin> {
|
|||
}
|
||||
final app = oauth.App.fromJson(jsonDecode(appresponse.body));
|
||||
|
||||
var popupWin = html.window.open(
|
||||
html.WindowBase? popupWin = html.window.open(
|
||||
oauth.getAuthUrl(widget.url, app).toString(),
|
||||
"_blank",
|
||||
);
|
||||
|
@ -33,11 +33,8 @@ class _WebloginState extends State<Weblogin> {
|
|||
html.window.onMessage.listen((event) async {
|
||||
final uri = Uri.parse(event.data);
|
||||
if (uri.queryParameters.containsKey("code")) {
|
||||
// this null check needs to be here!
|
||||
// becuase this is null when compiling for
|
||||
// anything but web
|
||||
// this makes the compiler unhappy
|
||||
popupWin?.close();
|
||||
//ignore: ivalid_null_aware_operator
|
||||
//popupWin.close();
|
||||
final token = await oauth.getToken(
|
||||
uri.queryParameters["code"]!,
|
||||
app.clientId,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
import 'package:flutter/src/widgets/container.dart';
|
||||
import 'package:flutter/src/widgets/framework.dart';
|
||||
|
||||
class Search extends StatefulWidget {
|
||||
const Search({super.key});
|
||||
|
||||
@override
|
||||
State<Search> createState() => _SearchState();
|
||||
}
|
||||
|
||||
class _SearchState extends State<Search> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ class _MainScaffoldState extends State<MainScaffold> {
|
|||
}
|
||||
}
|
||||
});
|
||||
websocket.reloadWebsockets();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -39,7 +40,6 @@ class _MainScaffoldState extends State<MainScaffold> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
websocket.reloadWebsockets();
|
||||
final screens = [
|
||||
const Timeline(),
|
||||
chat(context),
|
||||
|
|
|
@ -26,17 +26,17 @@ class _PostOptionsState extends State<PostOptions> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final time = DateTime.parse(widget.model.createdAt).toLocal();
|
||||
List<Widget?> c = [
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
// title
|
||||
SelectableText("post-options".i18n(),
|
||||
style: Theme.of(context).textTheme.displayMedium),
|
||||
// time
|
||||
SelectableText(
|
||||
widget.model.createdAt
|
||||
.replaceAll("T", " ")
|
||||
.replaceAll("-", ".")
|
||||
.substring(0, 19),
|
||||
"${"day-${time.weekday}".i18n()} ${time.day}.${time.month}.${time.year} ${time.hour}:${time.minute} ${time.timeZoneName.toLowerCase()}",
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
Row(
|
||||
|
|
|
@ -31,11 +31,16 @@ class _ThreadState extends State<Thread> {
|
|||
}
|
||||
}
|
||||
|
||||
contentWarnings.map(
|
||||
(e) => e.trim(),
|
||||
);
|
||||
contentWarnings.removeWhere((element) => element == "");
|
||||
|
||||
if (sensitivePosts > 1 && c.length > 1) {
|
||||
String s = "";
|
||||
int i = 0;
|
||||
for (var element in contentWarnings) {
|
||||
if (i == 0) {
|
||||
if (i == 0 && i < contentWarnings.length - 1) {
|
||||
s = "$element;";
|
||||
} else if (i < contentWarnings.length - 1) {
|
||||
s = "$s $element;";
|
||||
|
|
Loading…
Reference in New Issue