[pigeon] Add support for DateTime

This issue has been created since 2022-11-24.

Use case

DateTime is an extremely common type, likely to be used in many Flutter plugins. However, we need to convert DateTime to integer or string to communicate with the native code, and add the same logic both on Dart, Swift/ObjectiveC and Kotlin/Java, which is not type safe (one of the main goals of pigeon).

Proposal

  • Accept DateTime type on pigeon
  • Generate the code parsing DateTime from/to the StandardMessageCodec using integer or string.
stuartmorgan wrote this answer on 2022-11-29

I'll leave this open for future consideration, but adding new built-in types isn't really within the core scope of Pigeon.

However, we need to convert DateTime to integer or string to communicate with the native code, and add the same logic both on Dart, Swift/ObjectiveC and Kotlin/Java, which is not type safe

This is conflating logic with type safety. Having a string or an integer rather than a dynamic (or the nearest equivalent in the various host languages) is type safety. Converting between two enforced types doesn't lessen type safety.

More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-12-10
Star Count 147243
Watcher Count 3561
Fork Count 23950
Issue Count 11325

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
[Bug] doris master ProcessHashTableProbe core 0 2022-07-21 2022-07-31
[improvement]Remove the website build framework from the docs directory 0 2022-07-21 2022-07-28
[Bug] Array core dump due to invalid offset of subcolumn convertor 0 2022-07-21 2022-11-04
calling `sendInvitations()` always results in a `403` status and a security challenge 1 2022-04-15 2022-04-26
Getting different results in a service worker? 1 2022-04-13 2022-04-26
How to reply in a specific conversation? 2 2022-04-10 2022-04-26
getProfile(), getOwnProfile() return status 400 1 2022-03-01 2022-04-26
OHIF/Viewers with DICOMcloud not work fine 1 2021-09-24 2022-10-28
Emit onCompilationRestart 9 2020-06-04 2022-12-06
Deprecation Notice on Selenium in System Specs 0 2022-02-13 2022-10-10
this project is fucking amazing 1 2021-09-13 2022-10-31
id_token Is Issued for Revoked Credentials 1 2022-07-07 2022-12-01
DM support sync table with foreign key 0 2022-11-14 2022-11-15
Support of platform ARM_64 8 2021-08-31 2022-10-13
ESC9 failing for me - Probably incorrectly configured conditions 3 2022-08-10 2022-09-09
Are groups claim special treated? (ShyLionTjmn questions) 7 2021-07-30 2022-11-12
Too many open files crash after ~36 hours of frequent response handling 9 2021-11-21 2022-12-09
Response StatusText Does Not Return Value 2 2022-02-14 2022-09-21
Notifications for boosts/favorites on my boost 0 2022-05-01 2022-11-24
Building VM on M1: Plugins not build 0 2022-06-27 2022-11-21
T-SQL: Support table hints 0 2022-04-21 2022-10-27
Synced Lyrics no do not work after playing song with no lyrics 44 2021-09-23 2022-12-01
Request: Add a way to automatically support all textobjects defined 3 2021-07-04 2022-09-20
attachment issue 0 2021-01-27 2022-01-03
java.lang.reflect.invocationtargetexception null Glitch 0 2022-07-12 2022-10-29
Cannot check whether the char is emoji or not with emoji.UNICODE_EMOJI 2 2021-01-27 2022-11-22
Can't send PacketPlayOutEntityDestroy to lower clients 3 2021-06-08 2022-10-30
Mimic Firefox tabs - Don't load until clicked on the tab 3 2022-10-06 2022-11-20
Update add-ons flow is bumpy 4 2022-08-15 2022-09-28
Zap Scan Freezes on marking Alert as false Positive 6 2022-08-10 2022-09-28
Add metadata to existing coupon 0 2022-04-12 2022-11-29
Stack won't render content in NextJS [TypeScript] 1 2022-08-24 2022-09-13
Height Range Modifier Settings Closing Automatically 2 2022-05-20 2022-10-26
Bind to unix socket 1 2021-06-16 2022-01-12
write is locale-dependent 7 2022-05-08 2022-12-10
[expo-dev-menu] is broken for landscape orientation 5 2022-06-28 2022-10-05
"Show as a QuickMenu" crash in gestures 83 2022-10-05 2022-11-06
Unknown input format: 'gdigrab' 2 2021-06-24 2022-09-27
Text color in the search bar the same as the background 0 2022-04-19 2022-09-20
Manditory EXACT 2 2020-04-28 2022-01-08
ParallelRunStep output file rows clobber each other 5 2022-04-26 2022-10-10
cmd/compile/internal/test: TestAppendOfMake fails with GOEXPERIMENT=unified 3 2022-08-08 2022-09-16
How to resolve "Nebula-release tasks will not be available"? 1 2020-10-15 2022-11-29
Separated defns get aligned since 3.0.5 3 2021-09-27 2022-10-24
Stay logged in 9 2021-08-24 2022-01-17
[Bug]: Academy: "Data Importer'" not accepting correct answers 1 2021-10-28 2022-10-03
Support IP Specification for AWS NLB via Annotation 4 2020-07-30 2022-12-05
Windows: scimax-hydra requires org-mac-link 1 2022-01-17 2022-11-12
Menu does not seem to be working under Pseudo-elements 0 2022-07-15 2022-09-22
Allow enabling custom-devices feature on all channels by default 6 2022-08-02 2022-12-02