1
0
mirror of https://github.com/go-vikunja/app synced 2024-09-16 12:51:46 +00:00

chore: dart format

This commit is contained in:
Benimautner 2024-06-06 23:12:07 +02:00
parent 88228e5f28
commit 6bfb34d788
9 changed files with 54 additions and 57 deletions

@ -179,8 +179,10 @@ class Client {
Map<String, dynamic> error;
error = _decoder.convert(response.body);
if(response.statusCode == 401 && globalNavigatorKey.currentContext != null) {
VikunjaGlobal.of(globalNavigatorKey.currentContext!).logoutUser(globalNavigatorKey.currentContext!);
if (response.statusCode == 401 &&
globalNavigatorKey.currentContext != null) {
VikunjaGlobal.of(globalNavigatorKey.currentContext!)
.logoutUser(globalNavigatorKey.currentContext!);
}
final SnackBar snackBar = SnackBar(

@ -274,7 +274,8 @@ class _BucketTaskCardState extends State<BucketTaskCard>
});
return true;
};
final DragTargetAccept<DragTargetDetails<TaskData>> dragTargetOnAccept = (data) {
final DragTargetAccept<DragTargetDetails<TaskData>> dragTargetOnAccept =
(data) {
final index = bucket.tasks.indexOf(widget.task);
widget.onAccept(data.data.task,
_dropLocation == DropLocation.above ? index : index + 1);

@ -96,7 +96,8 @@ class VikunjaGlobalState extends State<VikunjaGlobal> {
if (duration.inMinutes > 0) {
Workmanager().registerPeriodicTask("update-tasks", "update-tasks",
frequency: duration,
constraints: Constraints(networkType: NetworkType.connected, requiresDeviceIdle: true),
constraints: Constraints(
networkType: NetworkType.connected, requiresDeviceIdle: true),
initialDelay: Duration(seconds: 15),
inputData: {
"client_token": client.token,
@ -106,7 +107,8 @@ class VikunjaGlobalState extends State<VikunjaGlobal> {
Workmanager().registerPeriodicTask("refresh-token", "refresh-token",
frequency: Duration(hours: 12),
constraints: Constraints(networkType: NetworkType.connected, requiresDeviceIdle: true),
constraints: Constraints(
networkType: NetworkType.connected, requiresDeviceIdle: true),
initialDelay: Duration(seconds: 15));
});
});

@ -11,7 +11,9 @@ class TaskReminder {
final String relative_to;
DateTime reminder;
TaskReminder(this.reminder) : relative_period = 0, relative_to = "";
TaskReminder(this.reminder)
: relative_period = 0,
relative_to = "";
TaskReminder.fromJson(Map<String, dynamic> json)
: reminder = DateTime.parse(json['reminder']),
@ -19,10 +21,10 @@ class TaskReminder {
relative_to = json['relative_to'];
toJSON() => {
'relative_period': relative_period,
'relative_to': relative_to,
'reminder': reminder.toUtc().toIso8601String(),
};
'relative_period': relative_period,
'relative_to': relative_to,
'reminder': reminder.toUtc().toIso8601String(),
};
}
@JsonSerializable()
@ -143,9 +145,7 @@ class Task {
'description': description,
'identifier': identifier.isNotEmpty ? identifier : null,
'done': done,
'reminders': reminderDates
.map((date) => date.toJSON())
.toList(),
'reminders': reminderDates.map((date) => date.toJSON()).toList(),
'due_date': dueDate?.toUtc().toIso8601String(),
'start_date': startDate?.toUtc().toIso8601String(),
'end_date': endDate?.toUtc().toIso8601String(),

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

@ -149,38 +149,39 @@ class _TaskEditPageState extends State<TaskEditPage> {
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Row(
children: [
Padding(
padding:
EdgeInsets.only(right: 15, left: 2),
child: Icon(
Icons.description,
color: Colors.grey,
)),
Flexible(
child: GestureDetector(
onTap: () {
// open editdescription
Navigator.push(
context,
MaterialPageRoute(
builder: (buildContext) => EditDescription(initialText: _description,)
),
).then((description) => setState(() {
if (description != null) _description = description;
_changed = true;
}));
},
child: HtmlWidget(_description != null
? _description!
: "No description"),
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(right: 15, left: 2),
child: Icon(
Icons.description,
color: Colors.grey,
)),
Flexible(
child: GestureDetector(
onTap: () {
// open editdescription
Navigator.push(
context,
MaterialPageRoute(
builder: (buildContext) =>
EditDescription(
initialText: _description,
)),
).then((description) => setState(() {
if (description != null)
_description = description;
_changed = true;
}));
},
child: HtmlWidget(_description != null
? _description!
: "No description"),
),
),
),
],
)
),
],
)),
Padding(
padding: EdgeInsets.symmetric(vertical: 10.0),
child: VikunjaDateTimePicker(

@ -2,9 +2,6 @@ import 'package:html_editor_enhanced/html_editor.dart';
import 'package:flutter/material.dart';
class EditDescription extends StatefulWidget {
final String? initialText;
EditDescription({required this.initialText});
@ -31,7 +28,6 @@ class EditDescriptionState extends State<EditDescription> {
],
),
body: HtmlEditor(
controller: controller,
htmlEditorOptions: HtmlEditorOptions(
hint: "Your text here...",
@ -40,4 +36,4 @@ class EditDescriptionState extends State<EditDescription> {
),
);
}
}
}

@ -98,6 +98,6 @@ class LoginWithWebViewState extends State<LoginWithWebView> {
return true;
}
}
return false;
return false;
}
}

@ -8,15 +8,11 @@ ThemeData buildVikunjaDarkTheme() =>
_buildVikunjaTheme(ThemeData.dark(), isDark: true);
ThemeData buildVikunjaMaterialLightTheme() {
return ThemeData.light().copyWith(
);
return ThemeData.light().copyWith();
}
ThemeData buildVikunjaMaterialDarkTheme() {
return ThemeData.dark().copyWith(
);
return ThemeData.dark().copyWith();
}
ThemeData _buildVikunjaTheme(ThemeData base, {bool isDark = false}) {