Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: WebDAV Sync #217

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array/>
</dict>
</plist>
6 changes: 6 additions & 0 deletions lib/common/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import '../model/app_reminder_config.dart';
import '../model/app_sync_options.dart';
import '../model/habit_display.dart';
import '../model/habit_form.dart';
import '../theme/color.dart';
Expand Down Expand Up @@ -47,6 +48,7 @@ const int appCalendarBarMaxOccupyPrt = 70;
const int appCalendarBarMinOccupyPrt = 20;
const int appCalendarBarDefualtOccupyPrt = 50;
const int kHabitLargeScreenAdaptWidth = 600;
const int kHabitLargeScreenAdaptHeight = 400;
//#endregion

//#region l10n
Expand Down Expand Up @@ -81,6 +83,10 @@ const defaultSortDirection = HabitDisplaySortDirection.asc;
const defaultHabitsRecordScrollBehavior = HabitsRecordScrollBehavior.scrollable;
const defaultFirstDay = DateTime.monday;
const defaultAppReminder = AppReminderConfig.off;
const defaultAppSyncTimeout = Duration(seconds: 60);
const defaultAppSyncConnectTimeout = Duration(seconds: 10);
const int? defaultAppSyncConnectRetryCount = null; // null for infinity
const defaultAppSyncFetchInterval = AppSyncFetchInterval.minute5;
//#endregion

//#region habit-field
Expand Down
38 changes: 38 additions & 0 deletions lib/model/app_sync_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright 2025 Fries_I23
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import '../common/enums.dart';

enum AppSyncFetchInterval implements EnumWithDBCode {
manual(null),
minute5(Duration(minutes: 5)),
minute15(Duration(minutes: 15)),
minute30(Duration(minutes: 30)),
hour1(Duration(hours: 1));

final Duration? t;

const AppSyncFetchInterval(this.t);

@override
int get dbCode => t?.inSeconds ?? -1;

static AppSyncFetchInterval? getFromDBCode(int dbCode,
{AppSyncFetchInterval? withDefault = AppSyncFetchInterval.manual}) {
for (var value in AppSyncFetchInterval.values) {
if (value.dbCode == dbCode) return value;
}
return withDefault;
}
}
Loading