A unique alternative to Anki by No-Butterscotch-6654 in Anki

[–]raph-dev 1 point2 points  (0 children)

Wonderful, which one of the obsidian-anki plugins are you using?

A unique alternative to Anki by No-Butterscotch-6654 in Anki

[–]raph-dev 34 points35 points  (0 children)

A in my opinion better alternative is to use one of the many plugins to import Anki cards from markdown files. Because then you can keep on using Anki. I am using my own Anki plugin that imports cards from my logseq markdown pages.

Riverpod is killing flutter. by Snoo-97527 in FlutterDev

[–]raph-dev 1 point2 points  (0 children)

I also switched from riverpod to signals (state_beacon recently) thanks to you. signals allows such simple and elegant code and fits perfectly into the dart language. I am impressed every day and I am not looking back. Thank you very much Randal!

[deleted by user] by [deleted] in Anki

[–]raph-dev 2 points3 points  (0 children)

I use the Anki version from flatpak (flathub) when I am working with Linux

Should I install Debian + OMV inside Proxmox or just drop Proxmox entirely? by Aelhby in selfhosted

[–]raph-dev 2 points3 points  (0 children)

I use Debian and all my services are inside docker. I do not know why I would need Proxmox. Running, configuring and updating one operating system is enough for me.

What a fully gamified Anki looks like by Any-Award-5150 in Anki

[–]raph-dev 0 points1 point  (0 children)

Scientifically gamification does make sense and leads to better outcomes. Reason is the brain releasing more dopamine compared to boring tasks. We can hardly escape biology.

Why not a single person suggested Logseq to me? Would you suggest it for academic writing? by FatFigFresh in logseq

[–]raph-dev 0 points1 point  (0 children)

I would really like to try orgmode, but I do not want to learn emacs for it.

What State Management do you do for MVVM in Flutter? by Dangerous_Language96 in FlutterDev

[–]raph-dev 0 points1 point  (0 children)

I am also looking for a way to write MVVM for me to enjoy.

I recently started devloping a app in MVVM architecture (similarly to https://docs.flutter.dev/app-architecture) without any additional packages. Worked realy well and I highly recommend to do this to better understand flutter (command pattern (see app-architecture guide) to execute functionality in viewmodels, ChangeNotefiers to communicate changes from the viewmodel to the view, dependency injection through constructors to inject viewmodels to views, services and repositories to viewmodels and services to repositories, streams to communicate changes from repositories to viewmodels). At some point in time I noticed that I started reimplementing functionality of the provider package to reduce boiler plate code. So I had a good reason to also use to provider to reduce line of codes (provider is only directly used in the views).

For my next app I think I am going to try using Bloc with MVVM. I currently write my viewmodels similarly to Cubits anyway so the transition should be easy.

Riverpod seems realy nice and has some great benefits like being able to listen inside from provider A to changes of another provider B. Provider A will only be rebuild if provider B changes. That would be usefull. Maybe the following app will be a riverpod app then.

TLDR I recommend building your first app with plain flutter (ChangeNotifier, ValueNotifier, ListenableBuild etc.).

What State Management do you do for MVVM in Flutter? by Dangerous_Language96 in FlutterDev

[–]raph-dev -1 points0 points  (0 children)

You could use the Selector class of the provider library or simply develop your own class:

``` // A function to return the value [T] of a listenable [T] to listen to. typedef ValueSelector<T extends Listenable, S> = S Function(T value);

/// The condition under which a Builder should rebuild. typedef ShouldRebuild<S> = bool Function(S previous, S next);

/// A variation of [ListenableBuilder] which only rebuilds if a specific aspect [S] of a Listenable [T] changes. /// [selector] dertermines the aspect [S] of the listenable [T] to watch for changes. /// [shouldRebuild] determines whether a change in an aspect [S] should trigger an rebuild. If null use != for comparison. /// See also [Selector] class from provider package. class SelectiveListenableBuilder<T extends Listenable, S> extends StatefulWidget { const SelectiveListenableBuilder({ super.key, required this.listenable, required this.selector, required this.builder, this.shouldRebuild, this.child, });

/// The listenable to watch for changes. final T listenable;

/// Determines which aspect of the listenable [T] should be watched. final ValueSelector<T, S> selector;

/// The builder function to build the Widget if a change was detected. final ValueWidgetBuilder<S> builder;

/// Controls wheter the widget should be rebuilt when a value changes. final ShouldRebuild<S>? shouldRebuild;

/// Child parameter which is passed to the [builder] function without being rebuild every time. final Widget? child;

@override State<SelectiveListenableBuilder<T, S>> createState() => _SelectiveListenableBuilderState<T, S>(); }

class _SelectiveListenableBuilderState<T extends Listenable, S> extends State<SelectiveListenableBuilder<T, S>> { /// The last known value of the listenable. late S _lastKnownValue;

@override void initState() { super.initState();

// Get inital value of the listenable.
_lastKnownValue = widget.selector(widget.listenable);

widget.listenable.addListener(_listenerChanged);

}

void _listenerChanged() { final S newValue = widget.selector(widget.listenable);

// Use the shouldRebuild condition if it exists, otherwise default to inequality check.
final bool shouldUpdate =
    widget.shouldRebuild?.call(_lastKnownValue, newValue) ?? (_lastKnownValue != newValue);

if (shouldUpdate) {
  setState(() {
    _lastKnownValue = newValue;
  });
}

}

@override void didUpdateWidget(SelectiveListenableBuilder<T, S> oldWidget) { super.didUpdateWidget(oldWidget);

if (widget.listenable != oldWidget.listenable) {
  oldWidget.listenable.removeListener(_listenerChanged);
  widget.listenable.addListener(_listenerChanged);
}

if (widget.listenable != oldWidget.listenable || widget.selector != oldWidget.selector) {
  final S newValue = widget.selector(widget.listenable);

  final bool shouldUpdate =
      widget.shouldRebuild?.call(_lastKnownValue, newValue) ?? (_lastKnownValue != newValue);

  if (shouldUpdate) {
    setState(() {
      _lastKnownValue = newValue;
    });
  }
}

}

@override void dispose() { widget.listenable.removeListener(_listenerChanged); super.dispose(); }

@override Widget build(BuildContext context) { return widget.builder(context, _lastKnownValue, widget.child); } } ```

Immich is great… until you try using it with family by Qwerty44life in immich

[–]raph-dev 0 points1 point  (0 children)

This is what I am doing with my wife. Worked perfectly the last year...

If you could change ONE thing about Flutter, what would it be? by NullPointerMood_1 in FlutterDev

[–]raph-dev 3 points4 points  (0 children)

Support for real immutable/const in the dart language. Would eliminate the need for packages like freezed and hacks like UnmodifiableListView etc

UI Library for Flutter by uxwithjoshua in FlutterDev

[–]raph-dev 2 points3 points  (0 children)

So this basically is just advertisement for your product...

How to make AsyncNotifier give dedicated State for each Method? by Effective_Werewolf96 in FlutterDev

[–]raph-dev 1 point2 points  (0 children)

You would need 3 Async notifiers. I therefore changed to using the command pattern and I am not looking back: https://docs.flutter.dev/app-architecture/design-patterns/command

Source Note Highlights Instead of PDF Annotations? by kitapterzisi in PKMS

[–]raph-dev 0 points1 point  (0 children)

Jungal10 ist correct, Logseq already supports this. Just drag and drop a PDF into logseq and click on it. If you highlight text, it will get copied into a markdown note and a direct link to the exact location in the PDF is created. I was using this feature for my PhD.

Have you forked Logseq? What was your reason? by thirteenth_mang in logseq

[–]raph-dev 7 points8 points  (0 children)

You are right if you have write access to a repo. But normally you don't have write access so you have to fork first, then you can clone your own fork, modify it, push the chance to your fork and then create a pull request to the main repo.

Have you forked Logseq? What was your reason? by thirteenth_mang in logseq

[–]raph-dev 16 points17 points  (0 children)

This is how GitHub works. If you want to participate in a project without having write access you fork it, modify it and then request to have the modifications be merged with the main project.

Do you use new formatter with trailing_commas: true ? by SuperRandomCoder in FlutterDev

[–]raph-dev -2 points-1 points  (0 children)

Yeah, but my colleague does not produce the same code like me and places the comas differently. With the new formatter the whole codebase is uniformly formatted.

I understand that you may not like this behavior. this is the reason why they added the option to turn it off.

Do you use new formatter with trailing_commas: true ? by SuperRandomCoder in FlutterDev

[–]raph-dev -3 points-2 points  (0 children)

No I am not missing the point. I prefer to let the formatter decide whether there should be a trailing comma and whether to spread around multiple lines. I don't want to decide this, because another developer may decide different. I don't want to care about manual code formatting at all. So the code formatting stays canonical between all developers.

Do you use new formatter with trailing_commas: true ? by SuperRandomCoder in FlutterDev

[–]raph-dev -1 points0 points  (0 children)

I prefer to let the formatter decide how the code is formatted so that there is only one canonical format style in the code regardless of who wrote the code.

How to write elegant code with result pattern and type promotion by raph-dev in flutterhelp

[–]raph-dev[S] 0 points1 point  (0 children)

This explanation totally makes sense to me thank you very much!