-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add backend connection to my tasks screen
* feat: add backend connection to my tasks screen * fix: move close of modal to correct scope * chore: revert change to config * fix: fix imports
- Loading branch information
Showing
20 changed files
with
332 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
/pubspec.lock | ||
**/doc/api/ | ||
.dart_tool/ | ||
.packages | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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 and should not be manually edited. | ||
|
||
version: | ||
revision: 18a827f3933c19f51862dde3fa472197683249d6 | ||
channel: stable | ||
|
||
project_type: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.1 | ||
|
||
* TODO: Describe initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Features | ||
|
||
#### Time | ||
- TimedValueUpdater: For updating a value after <X> seconds | ||
|
||
## Getting started | ||
|
||
Add the package to your `pubspec.yaml` | ||
|
||
## Usage | ||
|
||
Import the widget that you want to use: | ||
e.g. `import 'package:helpwave_utils/time.dart';` | ||
|
||
## Additional information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
50 changes: 50 additions & 0 deletions
50
packages/helpwave_util/lib/src/time/timed_value_updater.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'dart:async'; | ||
|
||
/// A Class for updating a value and returning it after [timeToCallback] amount of seconds | ||
/// | ||
/// WARNING: must be disposed | ||
class TimedValueUpdater<T> { | ||
|
||
/// The call | ||
final void Function(T value) callback; | ||
|
||
/// The Duration until the [callback] is called after a update | ||
final Duration timeToCallback; | ||
|
||
/// The current value, which will be returned by the [callback] | ||
T _value; | ||
|
||
/// The timer for the callback | ||
Timer? _timer; | ||
|
||
T get value => this._value; | ||
|
||
set value(T newValue) { | ||
this._value = newValue; | ||
_timer?.cancel(); | ||
resetTimer(); | ||
} | ||
|
||
TimedValueUpdater(this._value, { | ||
required this.callback, | ||
this.timeToCallback = const Duration(seconds: 3), | ||
}); | ||
|
||
/// Resets the update timer, when the value was just updated | ||
void resetTimer() { | ||
_timer = Timer.periodic(this.timeToCallback, (_) => this.callback(_value)); | ||
} | ||
|
||
/// Cancels the [Timer] | ||
void cancelTimer({bool isNotifying = false}) { | ||
if(isNotifying){ | ||
this.callback(_value); | ||
} | ||
_timer?.cancel(); | ||
} | ||
|
||
/// Should be called when the object holding this is disposed | ||
void dispose({bool isNotifying = false}) { | ||
cancelTimer(isNotifying: isNotifying); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'src/time/timed_value_updater.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: helpwave_util | ||
description: A package containing helpwave's utility classes | ||
version: 0.0.1 | ||
homepage: https://github.com/helpwave/mobile-app | ||
|
||
publish_to: none | ||
|
||
environment: | ||
sdk: '>=3.1.0' | ||
flutter: ">=3.13.0" | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
flutter_lints: ^2.0.0 | ||
|
||
flutter: |
Oops, something went wrong.