Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benimautner committed Sep 26, 2024
2 parents 9800318 + 03bc86a commit edbf44b
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 194 deletions.
4 changes: 3 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
use flake
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ app.*.map.json
# VS Code
.vscode/settings.json

# Devenv
.devenv*
devenv.local.nix
.android/
local.properties

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"args": ["--flavor", "main"]
"args": ["--flavor", "unsigend"]
}
]
}
33 changes: 33 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ pkgs, lib, config, inputs, ... }:

{
enterShell = ''
export CHROME_EXECUTABLE=`which chromium`
'';

scripts = {
create-emulator.exec = "avdmanager create avd --force --name android-32 --package 'system-images;android-32;google_apis_playstore;x86_64'";
run-app.exec = "flutter run --flavor unsigned";
build-apk-unsigned.exec = "flutter build apk --flavor unsigned";
lint.exec = "dart format --set-exit-if-changed .";
lint-fix.exec = "dart format .";
};

android = {
enable = true;
flutter.enable = true;

platforms.version = [ "31" "33" "34" ];
cmake.version = [ "3.18.1" "3.22.1" ];
googleTVAddOns.enable = false;
ndk = {
enable = true;
version = [ "23.1.7779620" "26.1.10909125" ];
};
extras = [ ];
emulator = {
enable = true;
version = "34.1.9";
};
};
}
15 changes: 15 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable

# If you're using non-OSS software, you can set allowUnfree to true.
allowUnfree: true

# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
59 changes: 0 additions & 59 deletions flake.lock

This file was deleted.

50 changes: 0 additions & 50 deletions flake.nix

This file was deleted.

62 changes: 50 additions & 12 deletions lib/components/BucketTaskCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:provider/provider.dart';
import 'package:vikunja_app/components/label.dart';
import 'package:vikunja_app/models/task.dart';
import 'package:vikunja_app/pages/project/task_edit.dart';
import 'package:vikunja_app/utils/misc.dart';
Expand Down Expand Up @@ -86,6 +87,10 @@ class _BucketTaskCardState extends State<BucketTaskCard>
: Colors.white,
),
backgroundColor: vGreen,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(style: BorderStyle.none),
),
),
),
));
Expand All @@ -98,6 +103,7 @@ class _BucketTaskCardState extends State<BucketTaskCard>
widget.task.title,
style: (theme.textTheme.titleMedium ?? TextStyle(fontSize: 16))
.copyWith(
fontWeight: FontWeight.normal,
color: theme.brightness == Brightness.dark
? Colors.white
: Colors.black,
Expand All @@ -116,13 +122,27 @@ class _BucketTaskCardState extends State<BucketTaskCard>
child: Chip(
avatar: Icon(
Icons.calendar_month,
color: pastDue ? Colors.red : null,
color: pastDue
? Colors.red
: (theme.brightness == Brightness.dark
? Colors.grey[400]
: Colors.grey[600]),
),
label: Text(durationToHumanReadable(duration)),
labelStyle: (theme.textTheme.labelLarge ?? TextStyle()).copyWith(
color: pastDue ? Colors.red : null,
color: pastDue
? Colors.red
: (theme.brightness == Brightness.dark
? Colors.grey[400]
: Colors.grey[600]),
),
backgroundColor: theme.brightness == Brightness.dark
? Colors.grey[800]
: Colors.grey[200],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(style: BorderStyle.none),
),
backgroundColor: pastDue ? Colors.red.withAlpha(20) : null,
),
),
));
Expand All @@ -135,13 +155,7 @@ class _BucketTaskCardState extends State<BucketTaskCard>
);
widget.task.labels.sort((a, b) => a.title.compareTo(b.title));
widget.task.labels.asMap().forEach((i, label) {
labelRow.children.add(Chip(
label: Text(label.title),
labelStyle: theme.textTheme.labelLarge?.copyWith(
color: label.textColor,
),
backgroundColor: label.color,
));
labelRow.children.add(LabelComponent(label: label));
});
if (widget.task.hasCheckboxes) {
final checkboxStatistics = widget.task.checkboxStatistics;
Expand All @@ -158,6 +172,13 @@ class _BucketTaskCardState extends State<BucketTaskCard>
? ''
: '${checkboxStatistics.checked} of ') +
'${checkboxStatistics.total} tasks'),
backgroundColor: theme.brightness == Brightness.dark
? Colors.grey[800]
: Colors.grey[200],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(style: BorderStyle.none),
),
));
}
if (widget.task.attachments.isNotEmpty) {
Expand All @@ -166,25 +187,42 @@ class _BucketTaskCardState extends State<BucketTaskCard>
angle: -pi / 4.0,
child: Icon(Icons.attachment),
),
backgroundColor: theme.brightness == Brightness.dark
? Colors.grey[800]
: Colors.grey[200],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(style: BorderStyle.none),
),
));
}
if (widget.task.description.isNotEmpty) {
labelRow.children.add(Chip(
label: Icon(Icons.notes),
label: Icon(Icons.notes, size: 20.0),
backgroundColor: theme.brightness == Brightness.dark
? Colors.grey[800]
: Colors.grey[200],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(style: BorderStyle.none),
),
));
}

final rowConstraints = BoxConstraints(minHeight: chipHeight);
final card = Card(
color: widget.task.color,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
child: InkWell(
child: Theme(
data: Theme.of(context).copyWith(
// Remove enforced margins
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Padding(
padding: const EdgeInsets.all(4),
padding: const EdgeInsets.all(6),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
8 changes: 8 additions & 0 deletions lib/components/TaskBottomSheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class TaskBottomSheet extends StatefulWidget {

class TaskBottomSheetState extends State<TaskBottomSheet> {
Task _currentTask;
final double propertyPadding = 10.0;

TaskBottomSheetState(this._currentTask);

Expand Down Expand Up @@ -84,6 +85,7 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {
icon: Icon(Icons.edit)),
],
),
SizedBox(height: propertyPadding),
Wrap(
spacing: 10,
children: _currentTask.labels.map((Label label) {
Expand All @@ -94,12 +96,14 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {

// description with html rendering
Text("Description", style: theme.textTheme.headlineSmall),
SizedBox(height: propertyPadding),
Padding(
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
child: HtmlWidget(_currentTask.description.isNotEmpty
? _currentTask.description
: "No description"),
),
SizedBox(height: propertyPadding),
// Due date
Row(
children: [
Expand All @@ -110,6 +114,7 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {
: "No due date"),
],
),
SizedBox(height: propertyPadding),
// start date
Row(
children: [
Expand All @@ -121,6 +126,7 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {
: "No start date"),
],
),
SizedBox(height: propertyPadding),
// end date
Row(
children: [
Expand All @@ -131,6 +137,7 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {
: "No end date"),
],
),
SizedBox(height: propertyPadding),
// priority
Row(
children: [
Expand All @@ -141,6 +148,7 @@ class TaskBottomSheetState extends State<TaskBottomSheet> {
: "No priority"),
],
),
SizedBox(height: propertyPadding),
// progress
Row(
children: [
Expand Down
3 changes: 3 additions & 0 deletions lib/components/TaskTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class TaskTileState extends State<TaskTile> with AutomaticKeepAliveClientMixin {
onTap: () {
showModalBottomSheet<void>(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(10.0)),
),
builder: (BuildContext context) {
return TaskBottomSheet(
task: widget.task,
Expand Down
Loading

0 comments on commit edbf44b

Please sign in to comment.