slint icon indicating copy to clipboard operation
slint copied to clipboard

Add a new ToDo MVC example

Open FloVanGH opened this issue 1 year ago • 2 comments

I'm working right now on a new version of the Todo example with a much nicer design (still usable with all styles) and based on the Model View Controller pattern.

First goal of this in first place is to have a small example with two views to show how work with the MVC pattern on Slint for all supported languages (Rust / C++ / Node / Python). I first will start with the Rust version. And want to add additional languages with following PRs. With the Python support I would need @tronical 's help ;-). But after first PR is finished.

Second goal is to has a good looking example for a lightweight real live application, that works also good on mobile.

Tasks

  • [ ] improve accessibility of the ui (see https://github.com/slint-ui/slint/pull/5396#issuecomment-2163952542)
  • [x] Implement Rust example with mock data
  • [ ] Serialize / De-serialize data and android port
  • [ ] C++ version
  • [ ] TS version
  • [ ] Python version
  • [ ] Remove the old todo example after all previous tasks are done

FloVanGH avatar Jun 06 '24 06:06 FloVanGH

I suggest to replace pub due_date: i64 with std::time::SystemTime as data type instead. That way you have a data type that chrono supports (implements From<SystemTime> for chrono::DateTime) and you can make it relative to the epoch if necessary. But for example if you end up backing your model with a database, you wouldn't store an i64 in the database, you'd use the database' date time data type anyway.

tronical avatar Jun 12 '24 13:06 tronical

Another suggestion: replace unwrap() in main with Result.

tronical avatar Jun 13 '24 09:06 tronical