Compare commits
4 Commits
43f95cb321
...
main
Author | SHA1 | Date | |
---|---|---|---|
9cb8730d6d | |||
367c1cecbf | |||
d0440b221f | |||
13849aa439 |
42
.metadata
42
.metadata
@ -1,42 +0,0 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled.
|
||||
|
||||
version:
|
||||
revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
channel: stable
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
- platform: android
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
- platform: ios
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
- platform: linux
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
- platform: macos
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
- platform: windows
|
||||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
17
README.md
17
README.md
@ -1,4 +1,4 @@
|
||||
# nextcloud_reminder
|
||||
# todotxt_reminder
|
||||
|
||||
A Reminder based on todo.txt synced via nextcloud
|
||||
|
||||
@ -10,6 +10,7 @@ A Reminder based on todo.txt synced via nextcloud
|
||||
- [x] save/load data to/from disk
|
||||
- [x] adding/removing tasks
|
||||
- [x] respect ordering that was used when starting the app when saving.
|
||||
- [ ] add annoying pop-up message so you actually do your tasks ^^
|
||||
- [ ] add Nextcloud-login for getting a Token
|
||||
- [ ] use webdav for synchronizing with Nextcloud using that token
|
||||
- [ ] sorting by "next up", "priority"
|
||||
@ -18,7 +19,10 @@ A Reminder based on todo.txt synced via nextcloud
|
||||
- [ ] make application-settings
|
||||
- [ ] store/load settings
|
||||
- [ ] setting for number of days into the future
|
||||
- [ ] theme (light/dark mode, system theme)
|
||||
- [ ] theme
|
||||
- [x] light/dark mode
|
||||
- [ ] color theme by system colors
|
||||
- [ ] own primary/secondary color theme
|
||||
- [ ] fancy pop-animation & sound for the checkbox
|
||||
|
||||
## Current looks:
|
||||
@ -27,11 +31,14 @@ A Reminder based on todo.txt synced via nextcloud
|
||||

|
||||
|
||||
### Adding Tasks
|
||||

|
||||
(still missing repeat-options, currently defaults to daily.)
|
||||

|
||||
|
||||
### Details/Removing tasks
|
||||

|
||||
|
||||
### Complex repeat patterns
|
||||

|
||||

|
||||
|
||||
### Light/Dark theme
|
||||

|
||||

|
@ -26,10 +26,13 @@ apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
//compileSdkVersion flutter.compileSdkVersion
|
||||
compileSdkVersion 33 //default: 31, flutter_local_notification needs min 33
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
//coreLibraryDesugaringEnabled true //flutter_local_notification
|
||||
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
@ -43,14 +46,18 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder"
|
||||
applicationId "cloud.dresselhaus.todotxt_reminder"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
//minSdkVersion flutter.minSdkVersion
|
||||
minSdkVersion 20
|
||||
//targetSdkVersion flutter.targetSdkVersion
|
||||
targetSdkVersion 33 //flutter.targetSdkVersion //33 = Android 13 = needed for request of notification-permissions.
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
|
||||
//flutter_local_notification
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -67,5 +74,8 @@ flutter {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.0' //1.1.5
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation 'androidx.window:window:1.0.0' //flutter_local_notification for Android 12L
|
||||
implementation 'androidx.window:window-java:1.0.0' //flutter_local_notification for Android 12L
|
||||
}
|
||||
|
28
android/app/proguard-rules.pro
vendored
Normal file
28
android/app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
# FROM: https://github.com/MaikuB/flutter_local_notifications/blob/master/flutter_local_notifications/example/android/app/proguard-rules.pro
|
||||
## Gson rules
|
||||
# Gson uses generic type information stored in a class file when working with fields. Proguard
|
||||
# removes such information by default, so configure it to keep all of it.
|
||||
-keepattributes Signature
|
||||
|
||||
# For using GSON @Expose annotation
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# Gson specific classes
|
||||
-dontwarn sun.misc.**
|
||||
#-keep class com.google.gson.stream.** { *; }
|
||||
|
||||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||
-keep class * extends com.google.gson.TypeAdapter
|
||||
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||
-keep class * implements com.google.gson.JsonSerializer
|
||||
-keep class * implements com.google.gson.JsonDeserializer
|
||||
|
||||
# Prevent R8 from leaving Data object members always null
|
||||
-keepclassmembers,allowobfuscation class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder">
|
||||
package="cloud.dresselhaus.todotxt_reminder">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder">
|
||||
<application
|
||||
android:label="nextcloud_reminder"
|
||||
package="cloud.dresselhaus.todotxt_reminder">
|
||||
<application
|
||||
android:label="Todo.txt Reminder"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder
|
||||
package cloud.dresselhaus.todotxt_reminder
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
|
9
android/app/src/main/res/raw/keep.xml
Normal file
9
android/app/src/main/res/raw/keep.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- example from https://github.com/MaikuB/flutter_local_notifications/blob/master/flutter_local_notifications/example/android/app/src/main/res/raw/keep.xml
|
||||
See: https://pub.dev/packages/flutter_local_notifications#release-build-configuration
|
||||
-->
|
||||
<!--resources xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:keep="@drawable/*,@raw/slow_spring_board" /-->
|
||||
|
||||
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:keep="@drawable/*" />
|
@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder">
|
||||
package="cloud.dresselhaus.todotxt_reminder">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
|
@ -1,12 +1,12 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
ext.kotlin_version = '1.7.10'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath 'com.android.tools.build:gradle:7.3.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
|
||||
|
BIN
img/2023-01-13_addTask.png
Normal file
BIN
img/2023-01-13_addTask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
img/2023-01-13_theme_dark.png
Normal file
BIN
img/2023-01-13_theme_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
img/2023-01-13_theme_light.png
Normal file
BIN
img/2023-01-13_theme_light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -294,7 +294,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.nextcloudreminder.nextcloudReminder;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.todotxt_reminder;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@ -422,7 +422,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.nextcloudreminder.nextcloudReminder;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.todotxt_reminder;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@ -444,7 +444,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.nextcloudreminder.nextcloudReminder;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.todotxt_reminder;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Nextcloud Reminder</string>
|
||||
<string>Todo.txt Reminder</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@ -13,7 +13,7 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>nextcloud_reminder</string>
|
||||
<string>Todo.txt Reminder</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
|
@ -1,6 +1,8 @@
|
||||
import 'package:date_field/date_field.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:nextcloud_reminder/repeating_task.dart';
|
||||
import 'package:nextcloud_reminder/types/repeat.dart';
|
||||
import 'package:nextcloud_reminder/types/tasks.dart';
|
||||
@ -35,29 +37,60 @@ class _AddTaskWidgetState extends State<AddTaskWidget> {
|
||||
|
||||
String _prettyInterval(DateInterval d) {
|
||||
switch (d) {
|
||||
default:
|
||||
return d.toString();
|
||||
case DateInterval.daily: return "day";
|
||||
case DateInterval.weekly: return "week";
|
||||
case DateInterval.monthly: return "month";
|
||||
case DateInterval.monday: return "monday";
|
||||
case DateInterval.tuesday: return "tuesday";
|
||||
case DateInterval.wednesday: return "wednesday";
|
||||
case DateInterval.thursday: return "thursday";
|
||||
case DateInterval.friday: return "friday";
|
||||
case DateInterval.saturday: return "saturday";
|
||||
case DateInterval.sunday: return "sunday";
|
||||
case DateInterval.dayOfMonth: return "day of the month";
|
||||
case DateInterval.dayOfYear: return "day of the year";
|
||||
}
|
||||
}
|
||||
|
||||
Widget _repeatBuilder(BuildContext context, Tuple2<TextEditingController,ValueNotifier<DateInterval>> data) {
|
||||
return Row(
|
||||
return IntrinsicHeight(child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text("Repeat every " ),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: TextFormField(
|
||||
controller: data.item1,
|
||||
decoration: const InputDecoration(
|
||||
hintText: "1",
|
||||
decoration: InputDecoration(
|
||||
prefix: const Text("Repeat every "),
|
||||
suffix: () {
|
||||
if (data.item1.value.text.isEmpty) return const Text("");
|
||||
switch (data.item1.value.text.substring(data.item1.value.text.length - 1)) {
|
||||
case "1":
|
||||
return const Text("st");
|
||||
case "2":
|
||||
return const Text("nd");
|
||||
case "3":
|
||||
return const Text("rd");
|
||||
default:
|
||||
return const Text("th");
|
||||
}}(),
|
||||
border: const OutlineInputBorder()
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
keyboardType: const TextInputType.numberWithOptions(signed: false, decimal: false),
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||
onChanged: (_) {setState(() {
|
||||
//nothing just rerender.
|
||||
});},
|
||||
),
|
||||
),
|
||||
const Gap(4),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: DropdownButton<DateInterval>(
|
||||
//padding: const EdgeInsets.only(left: 30, right: 20),
|
||||
child: DropdownButtonFormField<DateInterval>(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
items: DateInterval.values.map((v) => DropdownMenuItem(value: v, child: Text(_prettyInterval(v)))).toList(),
|
||||
onChanged: (v) => setState(() {
|
||||
data.item2.value = v ?? data.item2.value;
|
||||
@ -65,11 +98,21 @@ class _AddTaskWidgetState extends State<AddTaskWidget> {
|
||||
value: data.item2.value,
|
||||
),
|
||||
),
|
||||
IconButton(onPressed: () => setState(() {
|
||||
_repeatEveryController.remove(data);
|
||||
}), icon: Icon(Icons.remove, color: Theme.of(context).errorColor,)),
|
||||
PreferredSize(
|
||||
preferredSize: const Size.square(40),
|
||||
child: IconButton(
|
||||
alignment: Alignment.topCenter,
|
||||
onPressed: () => setState(() {
|
||||
_repeatEveryController.remove(data);
|
||||
}),
|
||||
icon: Icon(Icons.remove, color: Theme.of(context).errorColor,)
|
||||
)),
|
||||
],
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
Widget _addPadding(Widget w) {
|
||||
return Padding(padding: EdgeInsets.all(4), child: w);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -83,7 +126,7 @@ class _AddTaskWidgetState extends State<AddTaskWidget> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextFormField(
|
||||
_addPadding(TextFormField(
|
||||
// The validator receives the text that the user has entered.
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
@ -91,13 +134,14 @@ class _AddTaskWidgetState extends State<AddTaskWidget> {
|
||||
}
|
||||
return null;
|
||||
},
|
||||
autofocus: true,
|
||||
controller: _titleController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Taskname"
|
||||
),
|
||||
),
|
||||
)),
|
||||
|
||||
DateTimeField(
|
||||
_addPadding(DateTimeField(
|
||||
onDateSelected: (v) => setState(() { _beginDate = v; }),
|
||||
selectedDate: _beginDate,
|
||||
decoration: const InputDecoration(
|
||||
@ -105,39 +149,41 @@ class _AddTaskWidgetState extends State<AddTaskWidget> {
|
||||
labelText: "Begin"
|
||||
),
|
||||
mode: DateTimeFieldPickerMode.date,
|
||||
),
|
||||
] + _repeatEveryController.map((c) => _repeatBuilder(context,c)).toList()
|
||||
)),
|
||||
] + _repeatEveryController.map((c) => _addPadding(_repeatBuilder(context,c))).toList()
|
||||
+ [
|
||||
ElevatedButton(onPressed: () => setState(() {
|
||||
_repeatEveryController.add(_emptyRepetition());
|
||||
}), child: const Text("add repetition")),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
// Validate returns true if the form is valid, or false otherwise.
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// If the form is valid, display a snackbar. In the real world,
|
||||
// you'd often call a server or save the information in a database.
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Task added.')),
|
||||
);
|
||||
var repeats = _repeatEveryController.map((e) => RepeatInterval(interval: e.item2.value, every: int.parse(e.item1.text))).toList();
|
||||
var meta = repeats.map((e) => e.toString()).join("/");
|
||||
widget.onSave(RepeatingTask(
|
||||
task: TaskExtra(
|
||||
title: _titleController.text,
|
||||
begin: _beginDate,
|
||||
meta: {"repeat": meta},
|
||||
repeat: repeats,
|
||||
)
|
||||
));
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
child: const Text('Submit'),
|
||||
),
|
||||
),
|
||||
_addPadding(_addPadding(Row(
|
||||
children: [
|
||||
ElevatedButton(onPressed: () => setState(() {
|
||||
_repeatEveryController.add(_emptyRepetition());
|
||||
}), child: const Text("add repetition")),
|
||||
Expanded(child: Container()),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
// Validate returns true if the form is valid, or false otherwise.
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// If the form is valid, display a snackbar. In the real world,
|
||||
// you'd often call a server or save the information in a database.
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Task added.')),
|
||||
);
|
||||
var repeats = _repeatEveryController.map((e) => RepeatInterval(interval: e.item2.value, every: int.parse(e.item1.text))).toList();
|
||||
var meta = repeats.map((e) => e.toString()).join("/");
|
||||
widget.onSave(RepeatingTask(
|
||||
task: TaskExtra(
|
||||
title: _titleController.text,
|
||||
begin: _beginDate,
|
||||
meta: {"repeat": meta},
|
||||
repeat: repeats,
|
||||
)
|
||||
));
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
child: const Text('Submit'),
|
||||
),
|
||||
]
|
||||
))),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
@ -1,24 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:intl/intl_standalone.dart';
|
||||
import 'package:nextcloud_reminder/homescreen.dart';
|
||||
|
||||
|
||||
void main() {
|
||||
runApp(const TodoTxtReminderApp());
|
||||
findSystemLocale().then((value) =>
|
||||
initializeDateFormatting(value).then((_) =>
|
||||
runApp(const TodoTxtReminderApp())
|
||||
));
|
||||
}
|
||||
|
||||
class TodoTxtReminderApp extends StatelessWidget {
|
||||
const TodoTxtReminderApp({super.key});
|
||||
static const primaryColor = Colors.pink;
|
||||
static const secondaryColor = Colors.amber;
|
||||
|
||||
getInteractColor(Color a, Color b) {
|
||||
return (Set<MaterialState> states) {
|
||||
const Set<MaterialState> interactiveStates = <MaterialState>{
|
||||
MaterialState.pressed,
|
||||
MaterialState.hovered,
|
||||
MaterialState.focused,
|
||||
};
|
||||
if (states.any(interactiveStates.contains)) {
|
||||
return b;
|
||||
}
|
||||
return a;
|
||||
};
|
||||
}
|
||||
|
||||
Color getColor(Set<MaterialState> states) {
|
||||
return getInteractColor(primaryColor, secondaryColor)(states);
|
||||
}
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const inputDecorationTheme = InputDecorationTheme(border: OutlineInputBorder(), focusColor: secondaryColor);
|
||||
|
||||
return MaterialApp(
|
||||
title: 'Nextcloud Reminder',
|
||||
title: 'Todo.txt Reminder',
|
||||
theme: ThemeData(
|
||||
// This is the theme of your application.
|
||||
primarySwatch: Colors.blue,
|
||||
brightness: Brightness.light,
|
||||
colorScheme: ThemeData.light().colorScheme.copyWith(primary: primaryColor, secondary: secondaryColor, background: primaryColor.shade50),
|
||||
inputDecorationTheme: inputDecorationTheme,
|
||||
checkboxTheme: ThemeData.light().checkboxTheme.copyWith(
|
||||
fillColor: MaterialStateProperty.resolveWith(getColor),
|
||||
checkColor: MaterialStateProperty.resolveWith(getInteractColor(Colors.white,Colors.black))
|
||||
),
|
||||
),
|
||||
home: const HomeWidget(title: 'todo.txt reminder'),
|
||||
darkTheme: ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
colorScheme: ThemeData.dark().colorScheme.copyWith(primary: primaryColor, secondary: secondaryColor, background: primaryColor.shade500.withAlpha(32)),
|
||||
inputDecorationTheme: inputDecorationTheme,
|
||||
checkboxTheme: ThemeData.dark().checkboxTheme.copyWith(
|
||||
fillColor: MaterialStateProperty.resolveWith(getColor),
|
||||
checkColor: MaterialStateProperty.resolveWith(getInteractColor(Colors.white,Colors.black))
|
||||
),
|
||||
),
|
||||
themeMode: ThemeMode.system,
|
||||
home: const HomeWidget(title: 'Todo.txt Reminder'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,9 @@ class _RepeatingTaskState extends State<RepeatingTask> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(),)),
|
||||
decoration: BoxDecoration(border: Border(
|
||||
bottom: BorderSide(color: Theme.of(context).colorScheme.background, width: 1),
|
||||
),),
|
||||
margin: const EdgeInsets.all(0.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -1,4 +1,7 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:nextcloud_reminder/repeating_task.dart';
|
||||
import 'package:nextcloud_reminder/types/tasks.dart';
|
||||
|
||||
@ -26,6 +29,7 @@ class ScrollTable extends StatefulWidget {
|
||||
|
||||
class _ScrollTableState extends State<ScrollTable> {
|
||||
final List<RepeatingTask> _content = [];
|
||||
final _contentStart = DateTime.now();
|
||||
|
||||
addTask(RepeatingTask task) {
|
||||
setState(() {
|
||||
@ -52,7 +56,7 @@ class _ScrollTableState extends State<ScrollTable> {
|
||||
children: [ Text(t.task.title),
|
||||
Text("Projects: ${t.task.projects.isEmpty ? "none" : t.task.projects.join(", ")}"),
|
||||
Text("Contexts: ${t.task.contexts.isEmpty ? "none" : t.task.contexts.join(", ")}"),
|
||||
Padding(padding: EdgeInsets.only(top: 16),
|
||||
Padding(padding: const EdgeInsets.only(top: 16),
|
||||
child: Text(t.task.meta.isEmpty ? "" : "Meta:", style: Theme.of(context).textTheme.bodyLarge,)
|
||||
),
|
||||
] + List.of(t.task.meta.entries.map((e) => Text("${e.key}: ${e.value}"))),
|
||||
@ -75,19 +79,51 @@ class _ScrollTableState extends State<ScrollTable> {
|
||||
});
|
||||
}
|
||||
|
||||
Widget _todoHeader(BuildContext context) {
|
||||
return Container(
|
||||
width: 200,
|
||||
height: 60,
|
||||
alignment: Alignment.bottomLeft,
|
||||
padding: const EdgeInsets.only(left: 8, right: 8, bottom: 12),
|
||||
decoration: BoxDecoration(color: Theme.of(context).colorScheme.background),
|
||||
child: Text("TODO", style: Theme.of(context).textTheme.titleSmall?.copyWith(color: Theme.of(context).colorScheme.primary),),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _datesHeader(BuildContext context) {
|
||||
return Row(
|
||||
children: List.generate(10, (i) => Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
alignment: Alignment.bottomCenter,
|
||||
padding: const EdgeInsets.only(left: 8, right: 8, bottom: 16),
|
||||
decoration: BoxDecoration(color: Theme.of(context).colorScheme.background),
|
||||
child: Transform.rotate(angle: -pi/3,
|
||||
child: Text(DateFormat.Md().format(_contentStart.add(Duration(days: i))),
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(color: Theme.of(context).colorScheme.primary),),
|
||||
)
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
List<Widget> _buildTitles(BuildContext context) {
|
||||
return List<Widget>.from(_content.map((RepeatingTask t) =>
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
width: 150.0,
|
||||
width: 200.0,
|
||||
height: 60.0,
|
||||
margin: const EdgeInsets.only(left: 4, top: 1),
|
||||
decoration: const BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(),)),
|
||||
child: TextButton(
|
||||
margin: const EdgeInsets.only(top: 1),
|
||||
decoration: BoxDecoration(color: Theme.of(context).canvasColor, border: Border(bottom: BorderSide(color: Theme.of(context).colorScheme.background, width: 1),)),
|
||||
child: SizedBox(width: 200, child: TextButton(
|
||||
onPressed: () => _showDetailsAndRemoveTask(context,t),
|
||||
style: const ButtonStyle(alignment: AlignmentDirectional.centerStart),
|
||||
child: Text(t.task.title,
|
||||
style: Theme.of(context).textTheme.labelMedium),
|
||||
)
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.left,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
)
|
||||
)),
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -97,19 +133,19 @@ class _ScrollTableState extends State<ScrollTable> {
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
//TODO: Text in container wie bei _buildTitles oben und width/height/margin/etc. festnageln.
|
||||
children: List<Widget>.from([Text("Todo", style: Theme.of(context).dataTableTheme.headingTextStyle,)]) + _buildTitles(context),
|
||||
children: List<Widget>.from([_todoHeader(context)]) + _buildTitles(context),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: List<Widget>.from([Text("header ... date, date, date .. fancy turned 60 degrees", style: Theme.of(context).dataTableTheme.headingTextStyle)]) + List<Widget>.from(_content),
|
||||
children: [_datesHeader(context)] + List<Widget>.from(_content),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -26,7 +26,9 @@ class _TaskItemState extends State<TaskItem>{
|
||||
alignment: Alignment.center,
|
||||
width: 60.0,
|
||||
height: 60.0,
|
||||
color: Colors.white,
|
||||
decoration: BoxDecoration(border: Border(
|
||||
left: BorderSide(color: Theme.of(context).colorScheme.background, width: 1)
|
||||
),),
|
||||
margin: const EdgeInsets.all(0.0),
|
||||
child: _done == null ? null : Checkbox(value: _done, onChanged: (newState) => setState(() {
|
||||
_done = newState!;
|
||||
|
@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)
|
||||
|
||||
# The name of the executable created for the application. Change this to change
|
||||
# the on-disk name of your application.
|
||||
set(BINARY_NAME "nextcloud_reminder")
|
||||
set(BINARY_NAME "Todo.txt Reminder")
|
||||
# The unique GTK application identifier for this application. See:
|
||||
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||
set(APPLICATION_ID "cloud.dresselhaus.nextcloud_reminder.nextcloud_reminder")
|
||||
set(APPLICATION_ID "cloud.dresselhaus.todotxt_reminder")
|
||||
|
||||
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||
# versions of CMake.
|
||||
|
8
local.properties
Normal file
8
local.properties
Normal file
@ -0,0 +1,8 @@
|
||||
## This file must *NOT* be checked into Version Control Systems,
|
||||
# as it contains information specific to your local configuration.
|
||||
#
|
||||
# Location of the SDK. This is only used by Gradle.
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#Sun Jan 15 22:45:27 CET 2023
|
||||
sdk.dir=C\:\\Users\\Drezi\\AppData\\Local\\Android\\Sdk
|
@ -5,10 +5,12 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import flutter_local_notifications
|
||||
import flutter_window_close
|
||||
import path_provider_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||
FlutterWindowClosePlugin.register(with: registry.registrar(forPlugin: "FlutterWindowClosePlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
}
|
||||
|
@ -5,10 +5,10 @@
|
||||
// 'flutter create' template.
|
||||
|
||||
// The application's name. By default this is also the title of the Flutter window.
|
||||
PRODUCT_NAME = nextcloud_reminder
|
||||
PRODUCT_NAME = Todo.txt Reminder;
|
||||
|
||||
// The application's bundle identifier
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.nextcloudreminder.nextcloudReminder
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cloud.dresselhaus.todotxt_reminder;
|
||||
|
||||
// The copyright displayed in application information
|
||||
PRODUCT_COPYRIGHT = Copyright © 2023 cloud.dresselhaus.nextcloud_reminder. All rights reserved.
|
||||
|
62
pubspec.lock
62
pubspec.lock
@ -1,6 +1,13 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -50,6 +57,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
dbus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dbus
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.7.8"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -83,6 +97,27 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
flutter_local_notifications:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_local_notifications
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "13.0.0"
|
||||
flutter_local_notifications_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
flutter_local_notifications_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -100,8 +135,15 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
gap:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: gap
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
intl:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
url: "https://pub.dartlang.org"
|
||||
@ -183,7 +225,7 @@ packages:
|
||||
name: path_provider_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.6"
|
||||
version: "2.0.7"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -273,6 +315,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.12"
|
||||
timezone:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timezone
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.1"
|
||||
tuple:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -300,7 +349,14 @@ packages:
|
||||
name: xdg_directories
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0+2"
|
||||
version: "0.2.0+3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
sdks:
|
||||
dart: ">=2.18.6 <3.0.0"
|
||||
flutter: ">=3.0.0"
|
||||
|
@ -42,6 +42,9 @@ dependencies:
|
||||
flutter_window_close: ^0.2.2
|
||||
collection: ^1.16.0
|
||||
date_field: ^3.0.2
|
||||
gap: ^2.0.1
|
||||
intl: ^0.17.0
|
||||
flutter_local_notifications: ^13.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
@ -90,12 +90,12 @@ BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "cloud.dresselhaus.nextcloud_reminder" "\0"
|
||||
VALUE "FileDescription", "nextcloud_reminder" "\0"
|
||||
VALUE "FileDescription", "Todo.txt Reminder" "\0"
|
||||
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
||||
VALUE "InternalName", "nextcloud_reminder" "\0"
|
||||
VALUE "InternalName", "Todo.txt Reminder" "\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023 cloud.dresselhaus.nextcloud_reminder. All rights reserved." "\0"
|
||||
VALUE "OriginalFilename", "nextcloud_reminder.exe" "\0"
|
||||
VALUE "ProductName", "nextcloud_reminder" "\0"
|
||||
VALUE "ProductName", "Todo.txt Reminder" "\0"
|
||||
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
||||
END
|
||||
END
|
||||
|
@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||
FlutterWindow window(project);
|
||||
Win32Window::Point origin(10, 10);
|
||||
Win32Window::Size size(1280, 720);
|
||||
if (!window.CreateAndShow(L"nextcloud_reminder", origin, size)) {
|
||||
if (!window.CreateAndShow(L"Todo.txt Reminder", origin, size)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
window.SetQuitOnClose(true);
|
||||
|
Reference in New Issue
Block a user