Skip to content

feat: run on desktop - #678

Open
RomanKovtyukh wants to merge 16 commits into
mateusz-bak:masterfrom
RomanKovtyukh:feature/linux-desktop-support
Open

feat: run on desktop#678
RomanKovtyukh wants to merge 16 commits into
mateusz-bak:masterfrom
RomanKovtyukh:feature/linux-desktop-support

Conversation

@RomanKovtyukh

@RomanKovtyukh RomanKovtyukh commented May 26, 2025

Copy link
Copy Markdown

It includes sqlite configuration for windows, but only tested on Linux. Got an example from here so decided not to remove the Platform.isWindows from there.

Before this change openreads was showing the following errors at the startup if you try running it on desktop:

flutter: [🌎 Easy Localization] [DEBUG] Start
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Bad state: databaseFactory not initialized
databaseFactory is only initialized when using sqflite. When using `sqflite_common_ffi`
You must call `databaseFactory = databaseFactoryFfi;` before using global openDatabase API

#0      databaseFactory.<anonymous closure> (package:sqflite_common/src/sqflite_database_factory.dart:29:7)
#1      databaseFactory (package:sqflite_common/src/sqflite_database_factory.dart:33:6)
#2      openDatabase (package:sqflite_common/sqflite.dart:83:10)
#3      DatabaseProvider.createDatabase (package:openreads/database/database_provider.dart:29:18)
<asynchronous suspension>
#4      DatabaseController.getAllBooks (package:openreads/database/database_controler.dart:30:16)
<asynchronous suspension>
#5      BookCubit._migrateCoversFromDatabaseToStorage (package:openreads/logic/cubit/book_cubit.dart:274:27)
<asynchronous suspension>
#6      BookCubit._initLoad (package:openreads/logic/cubit/book_cubit.dart:71:7)
<asynchronous suspension>

flutter: [🌎 Easy Localization] [DEBUG] Init state

#584

@RomanKovtyukh

Copy link
Copy Markdown
Author

Checked the failures:

  • will fix the code style in a separate PR
  • the intl version was failing locally too until I built it with flutter 3.29.0. So we either need to migrate to both flutter 3.23 and newer intl version if we want to fix this or we need to fix the flutter version to 3.29.0 in CI.

@RomanKovtyukh

Copy link
Copy Markdown
Author

Hi @mateusz-bak, could you please help reviewing this and couple more PRs? Or maybe there is someone else with write permissions who could help?

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch 2 times, most recently from a63eec2 to 6645da5 Compare June 15, 2025 21:48
@RomanKovtyukh RomanKovtyukh changed the title feat: set up sqlite on linux and windows feat: run on desktop Jun 16, 2025
@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch from 6645da5 to c68f954 Compare June 16, 2025 19:25

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change already made, please rebase

Comment thread pubspec.yaml Outdated
file_picker: ^8.3.1
smooth_page_indicator: ^1.1.0
intl: ^0.19.0
intl: ^0.20.0

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change already made, please rebase

Comment thread submodules/flutter

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change already made, please rebase

@mateusz-bak mateusz-bak left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the work, looks like a good improvement.

However I don't see linux or windows directories that I suppose were created after running below command:

flutter create --platforms=linux,windows .

Also please rebase to fix conflicts on already done changes.

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch from c68f954 to a233e5f Compare July 26, 2025 11:17
@amoinier

Copy link
Copy Markdown
Contributor

Hi! I would like give some help to merge this PR. Could you give me an update on the current status of the PR and any blockers you’re facing? Thanks in advance :)

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch from a233e5f to 006403c Compare September 7, 2025 11:59
@RomanKovtyukh

Copy link
Copy Markdown
Author

Hi, I've rebased the changes on top of the current HEAD and added the linux platform directory.

Regarding windows platform directory and build, I didn't add it because I haven't tested it there and won't be able to.

One more thing that is missing yet is an automatic build configuration for linux. We won't be able to distribute the linux version without that.

@armand-leguillou

Copy link
Copy Markdown

Hi! Has it evolved since last month?? (I can't wait to get OpenReads on my desktop bc i don't have a smartphone anymore)

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch 9 times, most recently from 8f86985 to 5f40d63 Compare November 16, 2025 03:11
@RomanKovtyukh

Copy link
Copy Markdown
Author

Hi @mateusz-bak, could you please review? The linux build had been added to the test_build.yaml and the linux directory is also in git now.

I've also made the github workflow store debug build artifacts to allow reviewers run a new version without having to build it locally.

@RomanKovtyukh

Copy link
Copy Markdown
Author

BTW folks. While we're waiting for review you can try it out using the build artifacts: https://github.com/mateusz-bak/openreads/actions/runs/19399497883

To use it:

  1. Download linux-appbundle.zip
  2. unzip it somewhere on your linux machine
  3. execute: /path/to/openreads

I did fix everything platform-specific I could fine, but I might've missed something. So let me know if it's crashing or silently ignoring you.

CC: @armand-leguillou, @amoinier, @ironhak, @GLLM

@mateusz-bak

Copy link
Copy Markdown
Owner

Great work @RomanKovtyukh I'm starting the review, I'll try to finish it by tomorrow.

@mbeko

mbeko commented Feb 10, 2026 via email

Copy link
Copy Markdown

@mateusz-bak

Copy link
Copy Markdown
Owner

Agree! Greyed out buttons would be best! We can implement them after we merge this PR.

@RomanKovtyukh

Copy link
Copy Markdown
Author

Hi folks. Wanted to clarify what we want to do. I'd keep everything as is to keep it a bit less spread in code. I've created a feature request for the currently hidden bar code scanning feature: #878 and ready to add other features.

@RomanKovtyukh

Copy link
Copy Markdown
Author

I've checked the Greying out thing. While looking how to do that I found that some people recommend changing opacity of the elements rather than greying out. And changing opacity doesn't look harder than making elements invisible.

Here how it looks when it's 50% opaque:
20260214_01h05m40s_grim

I can quickly do that to both elements to which we added notifications and ones we hided. As for message on hover, I can check that too and if I don't find an easy way to do that I'd stay with the error messages on click.

@mbeko

mbeko commented Feb 14, 2026 via email

Copy link
Copy Markdown

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch from d0b52a1 to c4265ca Compare February 14, 2026 20:09
@RomanKovtyukh

Copy link
Copy Markdown
Author

Ok, made inactive buttons transparent and with same info bar showing a warning message (translated). It's quite ugly in code, but hopefully will be fixed quickly after merging this PR because most of the things are about working with CSVs which I expect to be fixed all together.

Comment thread assets/translations/en-US.json Outdated
"show_title_over_cover": "Show title over cover"
} No newline at end of file
"show_title_over_cover": "Show title over cover",
"unsupported_platform_blur_hash_error": "Unsupported platform for generating BlurHash",

@mateusz-bak mateusz-bak Feb 14, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please combine all unsuported... strings to one:

This action is not supported on current platform

This will make life easier for the translator especially that we are going to support the features soon.

Comment thread lib/core/helpers/helpers.dart Outdated
Constants.blurHashX,
Constants.blurHashY,
);
} else {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to have the else statement. When we have new platforms we will review the platform specific implementations so no point in keeping the exception placeholders..

@mateusz-bak mateusz-bak left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I added small comments. Please fix and also rebase

@RomanKovtyukh
RomanKovtyukh force-pushed the feature/linux-desktop-support branch from c4265ca to 53daf06 Compare February 14, 2026 23:51
@RomanKovtyukh

Copy link
Copy Markdown
Author

Addressed the last comments, @mateusz-bak.

@RomanKovtyukh

Copy link
Copy Markdown
Author

I'm checking the CSV export and not sure if I understand right what this is doing on iOS:

        await SharePlus.instance.share(ShareParams(
          files: [XFile(path)],
        ));

and how should I work it around on Linux (SharePlus doesn't implement fire share on Linux).

Seem like it's opening sharing menu after saving CSV file, but I can't check it.

Do we need to do that on Android too? Or it's done on iOS because it's not straightforward there where the file was saved and users in most cases would have to choose another path?

Other than that it's working ok on Linux, so I event can add to this PR or open another one right after this.

@RomanKovtyukh

Copy link
Copy Markdown
Author

A commit in fork with basic CSV export. One issue is that it's not asking where to store the result backup.

RomanKovtyukh@b7476e7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants