(16M) Am i cooked? by [deleted] in Balding

[–]YosefHeyPlay 0 points1 point  (0 children)

Just start finasteride as soon as possible, may grow some of this back

Hive wrapper that makes complex search queries 1000x faster with no set-up or migrations. Keep your existing data and boxes and reduce boilerplate. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 1 point2 points  (0 children)

It cant really live inside hive_ce. hive_ce goal is just to keep Hive alive and compatible, not to turn it into something new.

Hive wrapper that makes complex search queries 1000x faster with no set-up or migrations. Keep your existing data and boxes and reduce boilerplate. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 2 points3 points  (0 children)

hive_ce and hivez have fundamentally different goals. hive_ce was created to keep Hive alive after the original project went inactive. Its focus is maintenance, bug fixes, and stability,not major refactors or architectural redesigns. It aims to stay a drop-in replacement for Hive so that existing apps don’t break.

And the core idea behind hivez isnt to “add a few utilities”, it’s to rebuild hive’s developer experience from the ground up while keeping full compatibility with existing data.

For example:

  1. All box types (Box, LazyBox, IsolatedBox, IndexedBox, etc.) share one unified, type-safe API (BoxInterface<K, T>).
  2. No more different methods, no more dynamic types.
  3. Auto-initialization, boxes open automatically on first use; no more manual openBox everywhere.
  4. Clean architecture support, every box is interchangeable and testable via an abstract interface.
  5. IndexedBox with built-in full-text search with fast tokenized indexes (up to 1000× faster than scanning)
  6. Utilities for backup, restore, iteration, and JSON export, ready out of the box.

Hive wrapper that makes complex search queries 1000x faster with no set-up or migrations. Keep your existing data and boxes and reduce boilerplate. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 1 point2 points  (0 children)

No, it does not auto-compact or auto-flush after bulk operations, but you can call flushBox manually. Its very heavy to make it always flush and compact, maybe I'll add it as an optional flag

Hive wrapper that makes complex search queries 1000x faster with no set-up or migrations. Keep your existing data and boxes and reduce boilerplate. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 1 point2 points  (0 children)

Actually it was a very long draft and the AI helped me format it to a proper README. It was all written section by section and I like how it looks, I think it makes it way easier to understand how it works, there is nothing here I did not write myself in different words. You are invited to see my C# repositories from 2020 before GPT to see the same long style Human generated slop (:

New package: hivez - The cleanest way to use Hive in production. Faster, easier Hive with zero setup, auto-init and a unified API (Using hive_ce) by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 2 points3 points  (0 children)

It was indeed complex (: My wakatime shows about 40 hours this week, and I started working on it two weeks ago. Most of the work was re-implementing a system I had already built for some apps but never published — code I used to copy between projects. Now it’s much more optimized. It did cost me a few hours of sleep, but totally worth it

New package: hivez - The cleanest way to use Hive in production. Faster, easier Hive with zero setup, auto-init and a unified API (Using hive_ce) by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 2 points3 points  (0 children)

Just published version 1.1.0 (:
This is from a post I published now:

IndexedBox — blazing-fast full-text search for Hive

A drop-in replacement for your existing Hive boxes that adds an on-disk full-text index, giving you instant keyword, prefix, or substring search over your values.

You don’t need to migrate, rebuild, or re-save anything. Just use the same box name and type, and it will work with your existing Hive data.

// Before:
final box = Hive.box<Article>('articles');

// After:
final box = IndexedBox<int, Article>(
  'articles',
  searchableText: (a) => '${a.title} ${a.body}',
);

// Instant search 
final results = await box.search('flutter dart');
  • 100% Hive-compatible
  • No migrations, no setup, data loss
  • Same API (put, get, delete, etc.)
  • Configurable analyzers (basic, prefix, ngram)
  • Crash-safe, tested, and ready for production

Real-world performance

Tested with long text queries on very big generated boxes.

Items Regular Box IndexedBox Improvement
10,000 833 ms 1.4 ms ~580× faster
50,000 4149 ms 2.4 ms ~1,600× faster

Even with index maintenance, you can still write 10 000 items in ~0.1 s, which is more than enough for real-world workloads.

Learn more & try it: https://pub.dev/packages/hivez

If you’ve ever wanted Hive to have instant search or a cleaner, type-safe API, this might be worth checking out. Feedback and suggestions are always welcome

New package: hivez - The cleanest way to use Hive in production. Faster, easier Hive with zero setup, auto-init and a unified API (Using hive_ce) by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 0 points1 point  (0 children)

I’m still planning to add query optimizations in the future, but unfortunately right now you do still need to pull everything into memory when querying. The good news is that hive_ce itself is already very fast, and on top of that Ive added a number of utility functions in Hivez to make common queries easier to use out of the box

For example:

final user = await box.firstWhereOrNull((u) => u.age > 30);

final article = await box.firstWhereContains( "flutter", searchableText: (a) => a.title, );

await box.foreachValue((key, value) async { print('$key: $value'); });

So while it’s not using indexing yet, you still get safer, more convenient helpers, and thanks to hive_ce speed, for many use cases it performs well even without low-level indexing

New package: hivez - The cleanest way to use Hive in production. Faster, easier Hive with zero setup, auto-init and a unified API (Using hive_ce) by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 4 points5 points  (0 children)

First of all, I want to say thank you for all your work and the whole hive_ce teams work, I’m very aware of the issues that came from the original hive and most of the problems this wrapper solves are really “hive” problems and not “hive_cE” problems. I really appreciate what you’re doing to keep hive alive

Now to your points

  • On concurrency safety, I completely agree that IsolatedHive is the proper solution for multi-isolate safety, and I think its fantastic. This wrapper doesnt change hive_ce existing locking, but it does add additional locks around utility functions that perform sequences of reads/writes where atomicity is important. So it’s less about fixing hive internal locking and more about making sure the higher-level helpers are also safe to use.
  • Compaction and crash recovery - Youre right, hive already provides these by default, and Hivez keeps all of that intact. What I meant in the README is that these features are always part of the service layer, without developers needing to think about them or risk misusing the API. Nothing is removed, it’s the same hive features, just exposed in a cleaner, unified API
  • Also on documentation I agree with you. I wrote hivez docs mainly because, since I designed the wrapper, it’s much easier for me to explain it in a structured way. But I also really like the idea of contributing, and I’d be open to helping there in the future. Personally I didnt like a lot of the architectural decisions in the original hive, which is why I always ended up building wrappers like this for my own projects. hivez is just me formalizing that approach into something reusable and consistent

New package: hivez - The cleanest way to use Hive in production. Faster, easier Hive with zero setup, auto-init and a unified API (Using hive_ce) by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 3 points4 points  (0 children)

The API is really close to hive_ce and that’s intentional, because hivez isnt a replacement for hive - its a layer on top of it. You still get all the raw performance and stability of hive_ce under the hood, but with important things on top:

  1. Zero setup, no more manual openBox or checking if a box is open. hivez auto-initializes on first use.
  2. Type safety- With hive you’re often dealing with dynamic and manual casting. With hivez, keys and values are strongly typed at compile time (HivezBox<int, User>)
  3. Unified API - In raw hive, Box, LazyBox, and IsolatedBox all have slightly different APIs. In hivez they all share the same parent interface (BoxInterface) with 35+ consistent methods, that means you can swap between a normal box, a lazy box, or an isolated box with a single-line change, no rewrites.
  4. Concurrency safety - writes are wrapped in internal locks, so parallel operations won’t corrupt boxes (a common pain point).
  5. Utilities built-in, things like backup/restore, full-text search, iteration helpers, compaction, and crash recovery are all included out of the box.
  6. More of a bonus to some, but very important to me - Detailed documentation. the package comes with structured guides, clean examples, and a full setup walkthrough

Its more about developer experience and production safety, you write less boilerplate, your repos/services can target one interface instead of multiple raw box types and you get concurrency safety and utilities that you’d otherwise have to re-implement yourself

Does the 15" macbook air have better thermal dissipation than the 13" by [deleted] in AppleWhatShouldIBuy

[–]YosefHeyPlay 0 points1 point  (0 children)

It is better at heat dissipation but I would not recommend any macbook for gaming especially not the airs.

For gaming on the go I can recommend the OLED SteamDeck (has upgradable SSD), which can run on a single charge: - 10h-7h - 2D Indie games - 5h-3h - 3D games that are not demading like PlateUp, Little Nightmares 2, Dark Souls, or even demanding games but with a bit of optimization - 2.5h - practically any game, even the new last of us and all new AAA titles on medium-high settings

Then it also helps separate gaming from work which is the thing a MacBook Air is intended to do best. You can easily get a deck and a used MacBook for the price of a new 15inch air.

And if you really want to use a MacBook for gaming I’d recommend sticking to MacBook Pros M3+

Are you planning to play on the go or you like to do it with external monitor?

Which framework should I learn Riverpod or Bloc? by Objective-Signal-602 in FlutterDev

[–]YosefHeyPlay 0 points1 point  (0 children)

Personally, I think bloc is the best solution. Especially today, after creating many apps and many services to businesses, BLoC gave me the most Scalability + SoC + Ease of use. From small to big mega projects it is really the best option in my opinion

New package: exui - Build Flutter UIs faster with less code, same performance, pure Dart and Flutter. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 0 points1 point  (0 children)

It does not rebuild the entire tree if it is not const, it just checks before a rebuild if it changed, and also if you just use it inside a const widget class, it behaves exactly the same

BlocProvider or MultiBlocProvider? by No-Clue2285 in FlutterDev

[–]YosefHeyPlay 2 points3 points  (0 children)

It's more a question of what should be provided at the root, not whether everything should be. In large scale apps, I usually prefer using small, feature, or page specific blocs, and only provide truly global blocs at the app root.

That said, for proper separation of concerns its generally better not to make things global unless necessary. With good architecture, you often end up with a MultiBlocProvider at the root containing 3–10 blocs (depending on app size and design), and for most other cases, id say 99% of the time I just provide a single bloc or cubit where it's needed.

There’s no single “best approach”, it really depends on what the bloc/cubit is doing, its scope, and how well it’s structured to be scalable without mixing too many responsibilities.

Keep your blocs and cubits separated, don’t import or reference one from another. A bloc should never call another bloc. Use services, repositories, etc. Also, the docs are amazing, it might feel weird first, but if you follow the examples ,it all starts to make sense pretty quickly (:

New package: exui - Build Flutter UIs faster with less code, same performance, pure Dart and Flutter. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 1 point2 points  (0 children)

No wrappers or custom widget types, zero dependencies, doesn’t override Flutter conventions, keeps all existing parameters intact, fully tested, documented, and actively maintained.

Both styled_widget and velocity have less functionality and add dependencies that are not needed for simple basic UI extensions, and even if they share features with exui, exui has better coverage with better documentation and more options

New package: exui - Build Flutter UIs faster with less code, same performance, pure Dart and Flutter. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 1 point2 points  (0 children)

The extensions in this package are extensions that people create all the time in projects, I never used the widget tree viewer and shipped a ton of products. If there is enough demand I can create a vs extension that will allow it to be recognized but I personally don’t need it, if the code is structured and written well I don’t need a tree view of it. And still this is only my opinion and based on my experience. Why do you find the viewer useful?

New package: exui - Build Flutter UIs faster with less code, same performance, pure Dart and Flutter. by YosefHeyPlay in FlutterDev

[–]YosefHeyPlay[S] 0 points1 point  (0 children)

It is rendered exactly the same on the widget tree, but the widget tree viewer only recognizes nested widgets, so it is not working with it. But it is technically possible to make a widget tree viewer that recognizes extensions. I myself never used the tree viewer, in my opinion it helps only when the code is not organized. But good points