Hi ~ This is liuyuxin, and this is my second weekly report. This week, I mainly focused on updating MeRead, and I spent a lot of time over the weekend helping my girlfriend organize materials for her graduate school recommendation.
My weekly report will be updated every Monday morning through WeChat Official Account and my personal blog. Please search for "刘玉新" on WeChat Official Account, and the blog address is: https://liuyu.xin. The blog supports RSS subscription: https://liuyu.xin/feed.
Here is the main content.
Development: MeRead welcomes a major update
The main development work this week focused on the iteration of MeRead, and version 0.6.0 was released on Thursday afternoon. The main updates are as follows:
Optimization: Migrated the database from Sqflite to Isar
Optimization: Used FlutterToast instead of SnackBar
Feature: Read articles grouped by subscription sources
Feature: Remember the expanded state of the sidebar subscription source list
Feature: Batch delete subscription sources
Feature: Added a "Get Original Article" button on the reading page
Feature: Copy the subscription source address by clicking on it on the subscription source editing page
Fix: Unable to import files with the extension ".opml"
Fix: Error when returning from a network link on the reading page
Fix: Page state not updated in a timely manner when setting global zoom
Other: Updated some UI interfaces
Welcome to download the update on Github (don't forget to star 😊): Releases · gvenusleo/MeRead
Now let me briefly talk about some issues I encountered during the development process.
Why migrate the database
From the first version of MeRead in November last year to version 0.5.0 two weeks ago, it has always used SQLite as the database with the help of Sqflite. As one of the most popular databases on pub, Sqflite does provide a good development experience. However, after I came into contact with Isar database, I decided to migrate the database.
According to the official website, Isar is a "super-fast cross-platform database specifically designed for Flutter". I haven't had a direct intuitive experience of its specific performance yet. In addition to the necessary functions such as CRUD, indexing, association, and full-text search, Isar attracts me mainly for the following three points:
- True cross-platform: Unlike Sqflite, which only supports mobile and MacOS, Isar has achieved full platform support, including mobile (iOS, Android), desktop (Windows, MacOS, Linux), and web. I did consider expanding MeRead to the desktop in the future, so migrating the database earlier would save a lot of trouble in the future.
- Support for more data types: Sqflite only supports four data types:
Uint8List, while Isar also supports
List, as well as nested objects and enumerations.
- Intuitive and user-friendly debugging tool: Isar comes with a debugging tool called "Isar Inspector", which allows visual operations on the database and is very user-friendly.
In short, I highly recommend Flutter developers to use the Isar database. After using it, I can't go back to Sqflite anymore...
Giving up on using SnackBar
I have never liked the SnackBar component. I think it is probably the ugliest component in the Material You design guidelines. In addition, there were user feedback that SnackBar cannot automatically disappear after 2 seconds as set on Android-like native systems (this issue also occurred on my own moto X30), which further strengthened my determination to replace the SnackBar component. Of course, before replacing it, I still wanted to find out the reason for the bug. After flipping through the official documentation, it clearly states:
A SnackBar with an action will not time out when TalkBack or VoiceOver are enabled. This is controlled by AccessibilityFeatures.accessibleNavigation.
Perhaps different Android systems handle SnackBar differently. So I directly switched to FlutterToast, which also reduced the amount of code.
My code is not wrong!
Another interesting bug that was fixed was that MeRead could not import files with the extension ".opml". Since my own OPML file had the extension ".xml", I didn't notice this problem until a user reported it. I looked at my source code, and the relevant code was written like this:
final result = await FilePicker.platform.pickFiles( type: FileType.custom, allowedExtensions: ['opml', 'xml'], );
I was confused. Doesn't it clearly state that files with the extensions ".opml" and ".xml" are supported? Why does ".xml" work but not ".opml"?
So I went to the documentation and issues of flutter_file_picker, and finally based on issues#1148 and the related wiki, I came to the conclusion: This is a problem with the Android file system and has nothing to do with my code 😌
And my final solution was: Since I couldn't specify the allowed file extensions, I simply set it to allow any file and then checked if the file extension was correct.
Working overtime for a release
On Monday, I received feedback from a user that their OPML file could not be imported. Since MeRead imports OPML files silently in the background, and this user's OPML file was relatively large, I didn't pay much attention at the time and told them it might be due to a poor network environment, and they should wait a bit longer. On Saturday, I saw that this user's problem was still not resolved, and they even sent me their OPML file. I tested it and indeed couldn't import it. When I returned to the dormitory in the evening, I started debugging as soon as I turned on my computer, and quickly found the cause: OPML files from different sources have some differences in format, which caused MeRead to occasionally encounter null safety errors when parsing the file. After finding the problem, I fixed it in two minutes. I immediately released a new version that night.
So now the latest version of MeRead is 0.6.1. In addition to fixing the issue with importing OPML files, there are two other updates:
New feature: When deleting subscription sources, you can select all or deselect all
Optimization: Optimized the way links are opened within the app
Reading: "Success" is not "forever"
On Friday, I came across the following post on Jike:
It immediately reminded me of another post I saw on Twitter a long time ago:
I think a lot about how we as a culture have turned "forever" into the only acceptable definition of success.
Like... if you open a coffee shop and run it for a while and it makes you happy but then stuff gets too expensive and stressful and you want to do something else so you close it, it's a "failed" business. If you write a book or two,then decide that you don't actually want to keep doing that, you're a "failed" writer. If you marry someone, and that marriage is good for a while,and then stops working and you get divorced, it's a "failed" marriage.
The only acceptable "win condition" is "you keep doing that thing forever". A friendship that lasts for a few years but then its time is done and you move on is considered less valuable or not a "real" friendship. A hobby that you do for a while and then are done with is a "phase" - or, alternatively, a "pity" that you don't do that thing any more. A fandom is "dying" because people have had a lot of fun with it but are now moving on to other things.
I just think that something can be good, and also end,and that thing was still good. And it's okay to be sad that it ended, too. But the idea that anything that ends is automatically less than this hypothetical eternal state of success... I don't think that's doing us any good at all.
I agree with the viewpoint expressed in it, the idea that "life is a process, not a result". Some things can be good, even if they are abandoned. "Forever" should not be synonymous with success, and life should not be confined to a specific outcome.