浏览代码

temporary changes

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
ae118ebb
共有 41 个文件被更改,包括 5790 次插入1056 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/.idea/.idea.UIWidgetsSamples_2019_4/.idea/indexLayout.xml
  2. 405
      Samples/UIWidgetsSamples_2019_4/.idea/.idea.UIWidgetsSamples_2019_4/.idea/workspace.xml
  3. 570
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs
  4. 14
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs
  5. 35
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs
  6. 319
      com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs
  7. 46
      com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs
  8. 118
      com.unity.uiwidgets/Runtime/cupertino/app.cs
  9. 71
      com.unity.uiwidgets/Runtime/cupertino/button.cs
  10. 998
      com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
  11. 21
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  12. 5
      com.unity.uiwidgets/Runtime/cupertino/localization.cs
  13. 20
      com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
  14. 16
      com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs
  15. 44
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  16. 5
      com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs
  17. 2
      com.unity.uiwidgets/Runtime/cupertino/tab_view.cs
  18. 261
      com.unity.uiwidgets/Runtime/cupertino/text_theme.cs
  19. 318
      com.unity.uiwidgets/Runtime/cupertino/theme.cs
  20. 2
      com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs.meta
  21. 2
      com.unity.uiwidgets/Runtime/cupertino/colors.cs.meta
  22. 14
      com.unity.uiwidgets/Runtime/ui2/geometry.cs
  23. 30
      com.unity.uiwidgets/Runtime/widgets/app.cs
  24. 3
      com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs
  25. 2
      com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs
  26. 951
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  27. 41
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  28. 233
      com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs
  29. 763
      com.unity.uiwidgets/Runtime/cupertino/colors.cs
  30. 1001
      com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
  31. 11
      com.unity.uiwidgets/Runtime/cupertino/context_menu.cs.meta
  32. 151
      com.unity.uiwidgets/Runtime/cupertino/context_menu_action.cs
  33. 11
      com.unity.uiwidgets/Runtime/cupertino/context_menu_action.cs.meta
  34. 45
      com.unity.uiwidgets/Runtime/cupertino/icon_theme_data.cs
  35. 11
      com.unity.uiwidgets/Runtime/cupertino/icon_theme_data.cs.meta
  36. 65
      com.unity.uiwidgets/Runtime/cupertino/interface_level.cs
  37. 11
      com.unity.uiwidgets/Runtime/cupertino/interface_level.cs.meta
  38. 204
      com.unity.uiwidgets/Runtime/cupertino/bottom_app_bar.cs
  39. 25
      com.unity.uiwidgets/Runtime/cupertino/color.cs
  40. 0
      /com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs.meta
  41. 0
      /com.unity.uiwidgets/Runtime/cupertino/colors.cs.meta

2
Samples/UIWidgetsSamples_2019_4/.idea/.idea.UIWidgetsSamples_2019_4/.idea/indexLayout.xml


<Path>Library/PackageCache/com.unity.ide.rider@1.1.4</Path>
<Path>Library/PackageCache/com.unity.ide.vscode@1.2.1</Path>
<Path>Library/PackageCache/com.unity.test-framework@1.1.14</Path>
<Path>Library/PackageCache/com.unity.test-framework@1.1.16</Path>
<Path>Library/PackageCache/com.unity.textmeshpro@2.0.1</Path>
<Path>Library/PackageCache/com.unity.timeline@1.2.15</Path>
<Path>Packages</Path>

<Path>.idea</Path>
<Path>.vs</Path>
<Path>Library</Path>
<Path>Logs</Path>
<Path>Temp</Path>
<Path>obj</Path>
</explicitExcludes>

405
Samples/UIWidgetsSamples_2019_4/.idea/.idea.UIWidgetsSamples_2019_4/.idea/workspace.xml


<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:pr" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:shiyun" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:siyaoH" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:sywen" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:github-desktop-finnif" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:github-desktop-finnif" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:1.17.4" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:github-desktop-finnif" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:shiyun" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:github-desktop-finnif" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:siyaoH" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:github-desktop-finnif" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:zxw" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:1.17.4" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:shiyun" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:siyaoH" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:sywen" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:zxw" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="4a820c96-d7cc-45d3-aad5-43ed8e63fac6" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/contentModel.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/indexLayout.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/indexLayout.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.UIWidgetsSamples_2019_4/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Plugins/x86_64/libUIWidgets_d.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Plugins/x86_64/libUIWidgets_d.dll" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UIWidgetsExample.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UIWidgetsExample.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UIWidgetsGallery/GalleryMain.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UIWidgetsGallery/GalleryMain.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_picker_demo.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_picker_demo.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Packages/manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/manifest.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/packages-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ProjectSettings/ProjectVersion.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/ProjectVersion.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/app.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/app.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/app.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/app.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/bottom_app_bar.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/bottom_app_bar.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/button.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/button.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/button.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/button.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/color.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/color.cs.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/date_picker.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/date_picker.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/date_picker.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/date_picker.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/dialog.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/dialog.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/dialog.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/dialog.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/icons.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/icons.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/localization.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/localization.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/localization.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/localization.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/picker.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/picker.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/route.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/route.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/route.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/route.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/slider.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/slider.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/switch.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/switch.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_scaffold.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_scaffold.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_view.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_view.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_view.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/tab_view.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_field.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_field.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_selection.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_selection.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_theme.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_theme.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_theme.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_theme.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/theme.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/theme.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/theme.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/theme.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/thumb_painter.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/thumb_painter.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/ui2/geometry.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/ui2/geometry.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/app.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/app.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/navigator.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/navigator.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/routes.cs" beforeDir="false" afterPath="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/routes.cs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$USER_HOME$/unity/Modules/UI/ScriptBindings/UICanvas.bindings.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/FB001E01-371B-4ADC-A200-13E0AC763896/74/b128d6d4/List`1.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/context_menu.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/63DD8BF9-8CFA-4BA9-85AF-735EF1A56BA9/4f/053d4227/Dictionary`2.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/FB001E01-371B-4ADC-A200-13E0AC763896/65/03a6f5b0/Dictionary`2.cs" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/Assets/UIWidgetsGallery/GalleryMain.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs" />
<option value="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_picker_demo.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/date_picker.cs" />
<option value="$PROJECT_DIR$/Assets/UIWidgetsExample.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/ui2/geometry.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs" />
<option value="$PROJECT_DIR$/Assets/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/text_field.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/cupertino/app.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/navigator.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/app.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/focus_manager.cs" />
<option value="$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/widgets/routes.cs" />
</list>
</option>
</component>
<component name="ProjectId" id="1kmB1s8KNEyD9iXKH8ltaQLcb86" />
<component name="ProjectViewState">
<option name="autoscrollFromSource" value="true" />
<option name="autoscrollToSource" value="true" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="DebuggerViewTab_PTCS_FirstProportionKey" value="0.19385515" />
<property name="DebuggerViewTab_PTCS_LastProportionKey" value="0.16532554" />
<property name="Discover.Launch.Via.Unity" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="XThreadsFramesViewSplitterKey" value="0.36055276" />
<property name="dart.analysis.tool.window.visible" value="false" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Attach to Unity Editor &amp; Play" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="UNITY_ATTACH_AND_PLAY" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
<option name="allowRunningInParallel" value="false" />

</option>
<method v="2" />
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4a820c96-d7cc-45d3-aad5-43ed8e63fac6" name="Default Changelist" comment="" />
<created>1606295678220</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1606295678220</updated>
<workItem from="1606295687928" duration="6985000" />
<workItem from="1606360579356" duration="22160000" />
<workItem from="1606444700279" duration="9370000" />
<workItem from="1606464930234" duration="6394000" />
<workItem from="1606706404779" duration="9480000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="true" />
<component name="UnityUnitTestConfiguration" currentTestLauncher="EditMode" />
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state width="1398" height="178" key="GridCell.Tab.0.bottom" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.0.bottom/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.0.center" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.0.center/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.0.left" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.0.left/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.0.right" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.0.right/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.1.bottom" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.1.bottom/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.1.center" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.1.center/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.1.left" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.1.left/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.1.right" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.1.right/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.2.bottom" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.2.bottom/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.2.center" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.2.center/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.2.left" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.2.left/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.2.right" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.2.right/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.3.bottom" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.3.bottom/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.3.center" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.3.center/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.3.left" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.3.left/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state width="1398" height="178" key="GridCell.Tab.3.right" timestamp="1606389410345">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="1398" height="178" key="GridCell.Tab.3.right/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606389410345" />
<state x="46" y="89" key="SettingsEditor" timestamp="1606300548918">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state x="46" y="89" key="SettingsEditor/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606300548918" />
<state width="498" height="446" key="SwitcherDM" timestamp="1606721077591">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state width="498" height="446" key="SwitcherDM/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606721077591" />
<state x="390" y="182" width="672" height="678" key="search.everywhere.popup" timestamp="1606380932000">
<screen x="0" y="0" width="1440" height="860" />
</state>
<state x="390" y="182" width="672" height="678" key="search.everywhere.popup/0.0.1440.860/-3840.-348.1920.1040@0.0.1440.860" timestamp="1606380932000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/async2/schedule_microtask.cs</url>
<line>137</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\async2\schedule_microtask.cs" initialLine="137">
<startOffsets>
<option value="5062" />
</startOffsets>
<endOffsets>
<option value="5085" />
</endOffsets>
</properties>
<option name="timeStamp" value="3" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/rendering/editable.cs</url>
<line>1058</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\rendering\editable.cs" initialLine="1058">
<startOffsets>
<option value="36052" />
</startOffsets>
<endOffsets>
<option value="36094" />
</endOffsets>
</properties>
<option name="timeStamp" value="10" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/rendering/editable.cs</url>
<line>1100</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\rendering\editable.cs" initialLine="1100">
<startOffsets>
<option value="37353" />
</startOffsets>
<endOffsets>
<option value="37387" />
</endOffsets>
</properties>
<option name="timeStamp" value="11" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/rendering/editable.cs</url>
<line>1120</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\rendering\editable.cs" initialLine="1120">
<startOffsets>
<option value="38309" />
</startOffsets>
<endOffsets>
<option value="38361" />
</endOffsets>
</properties>
<option name="timeStamp" value="13" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/rendering/editable.cs</url>
<line>1111</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\rendering\editable.cs" initialLine="1111">
<startOffsets>
<option value="37913" />
</startOffsets>
<endOffsets>
<option value="37976" />
</endOffsets>
</properties>
<option name="timeStamp" value="14" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DotNet Breakpoints">
<url>file://$PROJECT_DIR$/../../com.unity.uiwidgets/Runtime/async2/timer.cs</url>
<line>117</line>
<properties documentPath="C:\com.unity.uiwidgets\com.unity.uiwidgets\Runtime\async2\timer.cs" initialLine="117">
<startOffsets>
<option value="3795" />
</startOffsets>
<endOffsets>
<option value="3844" />
</endOffsets>
</properties>
<option name="timeStamp" value="22" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

570
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs


using Unity.UIWidgets.rendering;
//using UIWidgetsGallery.gallery;
using Unity.UIWidgets.service;
using Brightness = Unity.UIWidgets.ui.Brightness;
using UnityEngine;
using System;
using UIWidgetsGallery.gallery;
using Color = Unity.UIWidgets.ui.Color;
using Random = UnityEngine.Random;
namespace UIWidgetsSample
{

}
class MyApp : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new CupertinoApp(
home: new HomeScreen()
);
/*return new WidgetsApp(
home: new HomeScreen(),
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (BuildContext Buildcontext, Animation<float> animation,
Animation<float> secondaryAnimation) => builder(context)
)
);*/
}
}
{
public override Widget build(BuildContext context)
{
return new CupertinoApp(
home: new HomeScreen()
);
}
}
class HomeScreen : StatelessWidget
{
public override Widget build(BuildContext context)
{
/*return new CupertinoPageScaffold(
child: new Center(
child: new Text("hello world!",
style: CupertinoTheme.of(context).textTheme.navTitleTextStyle)
),
backgroundColor: Colors.brown
);*/
List<BottomNavigationBarItem> items = new List<BottomNavigationBarItem>();
items.Add( new BottomNavigationBarItem(
icon: new Icon(CupertinoIcons.bell),
title: new Text("views")
));
items.Add(new BottomNavigationBarItem(
icon: new Icon(CupertinoIcons.eye_solid),
title: new Text("articles")
));
return new CupertinoTabScaffold(
tabBar: new CupertinoTabBar(
items: items
),
tabBuilder: ((contex, index) =>
{
//return new Center(child: new Text("hello"));
class HomeScreen : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new CupertinoPageScaffold(
child: new Center(
child: new CupertinoButton(
child: new Text(
"THIS IS TAB #"
),
onPressed: () =>
{
Navigator.of(context).push(
new CupertinoPageRoute(builder: (contex3) =>
{
return
new CupertinoTextFieldDemo();
})
);
}
)
//new Text("hello world!", style: CupertinoTheme.of(context).textTheme.navTitleTextStyle)
)
//backgroundColor: Colors.brown
);
List<BottomNavigationBarItem> items = new List<BottomNavigationBarItem>();
items.Add(new BottomNavigationBarItem(
icon: new Icon(CupertinoIcons.bell),
title: new Text("views")
));
items.Add(new BottomNavigationBarItem(
icon: new Icon(CupertinoIcons.eye_solid),
title: new Text("articles")
));
return new CupertinoTabScaffold(
tabBar: new CupertinoTabBar(
items: items
),
tabBuilder: ((contex, index) =>
{
//return new Center(child: new Text("hello"));
builder:(contex1) =>
{
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle:(index==0)? new Text("views") : new Text("articles")
),
child: new Center(
/*child: new Text(
"THIS IS TAB #" + index,
style: CupertinoTheme.of(contex1)
.textTheme
.navTitleTextStyle
//.copyWith(fontSize:32)
)*/
child: new CupertinoButton(
child: new Text(
"THIS IS TAB #",
style: CupertinoTheme.of(contex1)
.textTheme
.navTitleTextStyle
//.copyWith(fontSize:32)
),
onPressed: () =>
{
Navigator.of(contex1).push(
new CupertinoPageRoute(builder: (contex3) =>
{
return
new DetailScreen1(index==0? "views" : "articles" );
})
);
}
)
)
);
}
);
})
);
}
}
public class DetailScreen1 : StatelessWidget
{
public DetailScreen1(string topic)
{
this.topic = topic;
}
builder: (contex1) =>
{
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: (index == 0) ? new Text("views") : new Text("articles")
),
child: new Center(
/*child: new Text(
"THIS IS TAB #" + index,
style: CupertinoTheme.of(contex1)
.textTheme
.navTitleTextStyle
//.copyWith(fontSize:32)
)*/
child: new CupertinoButton(
child: new Text(
"THIS IS TAB #",
style: CupertinoTheme.of(contex1)
.textTheme
.navTitleTextStyle
//.copyWith(fontSize:32)
),
public string topic;
public override Widget build(BuildContext context)
{
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
//middle: new Text("Details")
),
child: new Center(
child: new Text("hello world")
)
);
}
}
public class DetailScreen : StatefulWidget
{
public DetailScreen(string topic)
{
this.topic = topic;
}
public string topic;
onPressed: () =>
{
Navigator.of(contex1).push(
new CupertinoPageRoute(builder: (contex3) =>
{
return
new DetailScreen1(index == 0 ? "views" : "articles");
})
);
}
)
)
);
}
);
})
public override State createState()
{
return new DetailScreenState();
}
}
);
public class DetailScreenState : State<DetailScreen>
{
public bool switchValue = false;
public override Widget build(BuildContext context)
{
var widgets = new List<Widget>();
widgets.Add( new Expanded(child : new Text("a switch")));
widgets.Add(new CupertinoSwitch(
value: switchValue,
onChanged: value =>
{
setState(() => switchValue = value);
}
));
var rowWidgtes = new List<Widget>();
var row = new Row(children:widgets);
//rowWidgtes.Add(row);
var cupBtn = new CupertinoButton(
child: new Text("launch action sheet"),
onPressed: () =>
{
CupertinoRouteUtils.showCupertinoModalPopup(
context: context,
builder: (context1) =>
{
return new CupertinoActionSheet(
title: new Text("some choices"),
actions: new List<Widget>(){
new CupertinoActionSheetAction(
child: new Text("one"),
onPressed: () =>
{
Navigator.pop(context1, 1);
},
isDefaultAction: true
),
new CupertinoActionSheetAction(
child: new Text("two"),
onPressed: () =>
{
Navigator.pop(context1, 2);
}
),
new CupertinoActionSheetAction(
child: new Text("three"),
onPressed: () =>
{
Navigator.pop(context1, 3);
}
)
}
);
}
);
}
);
rowWidgtes.Add(cupBtn);
return new CupertinoPageScaffold(
child: new Center(
child: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children:rowWidgtes
)
)
/*,
navigationBar: new CupertinoNavigationBar(
middle: new Text("hello world")
)*/
);
}
}
class CupertinoTextFieldDemo : StatefulWidget {
public const string routeName = "/cupertino/text_fields";
public override State createState() {
return new _CupertinoTextFieldDemoState();
}
}
class _CupertinoTextFieldDemoState : State<CupertinoTextFieldDemo> {
TextEditingController _chatTextController;
TextEditingController _locationTextController;
public class DetailScreen1 : StatelessWidget
{
public DetailScreen1(string topic)
{
this.topic = topic;
public override void initState() {
base.initState();
this._chatTextController = new TextEditingController();
this._locationTextController = new TextEditingController(text: "Montreal, Canada");
}
}
Widget _buildChatTextField() {
return new CupertinoTextField(
controller: this._chatTextController,
textCapitalization: TextCapitalization.sentences,
placeholder: "Text Message",
decoration: new BoxDecoration(
border: Border.all(
width: 0.0f,
color: CupertinoColors.inactiveGray
public string topic;
public override Widget build(BuildContext context)
{
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
//middle: new Text("Details")
borderRadius: BorderRadius.circular(15.0f)
),
maxLines: null,
keyboardType: TextInputType.multiline,
prefix: new Padding(padding: EdgeInsets.symmetric(horizontal: 4.0f)),
suffix:
new Padding(
padding: EdgeInsets.symmetric(horizontal: 4.0f),
child: new CupertinoButton(
color: CupertinoColors.activeGreen,
minSize: 0.0f,
child: new Icon(
CupertinoIcons.up_arrow,
size: 21.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.all(2.0f),
borderRadius:
BorderRadius.circular(15.0f),
onPressed: () => this.setState(() => this._chatTextController.clear())
child: new Center(
child: new Text("hello world")
),
autofocus: true,
suffixMode: OverlayVisibilityMode.editing,
onSubmitted: (string text) => this.setState(() => this._chatTextController.clear())
);
);
}
Widget _buildNameField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.person_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Name"
);
}
public class DetailScreen : StatefulWidget
{
public DetailScreen(string topic)
{
this.topic = topic;
}
public string topic;
Widget _buildEmailField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.mail_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.emailAddress,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Email"
);
}
Widget _buildLocationField() {
return new CupertinoTextField(
controller: this._locationTextController,
prefix: new Icon(
CupertinoIcons.location_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Location"
);
public override State createState()
{
return new DetailScreenState();
}
Widget _buildPinField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.padlock_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.number,
autocorrect: false,
obscureText: true,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Create a PIN"
);
}
public class DetailScreenState : State<DetailScreen>
{
public bool switchValue = false;
Widget _buildTagsField() {
return new CupertinoTextField(
controller: new TextEditingController(text: "colleague, reading club"),
prefix: new Icon(
CupertinoIcons.tags_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
enabled: false,
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
)
);
}
public override Widget build(BuildContext context)
{
var widgets = new List<Widget>();
widgets.Add(new Expanded(child: new Text("a switch")));
widgets.Add(new CupertinoSwitch(
value: switchValue,
onChanged: value => { setState(() => switchValue = value); }
));
var rowWidgtes = new List<Widget>();
var row = new Row(children: widgets);
//rowWidgtes.Add(row);
public override Widget build(BuildContext context) {
return new DefaultTextStyle(
style: new TextStyle(
fontFamily: ".SF Pro Text", // ".SF UI Text",
inherit: false,
fontSize: 17.0f,
color: CupertinoColors.black
),
child: new CupertinoPageScaffold(
child: new SafeArea(
child: new ListView(
children: new List<Widget>
{
/*new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: new Column(
children: new List<Widget> {
this._buildNameField(),
this._buildEmailField(),
this._buildLocationField(),
this._buildPinField(),
this._buildTagsField(),
}
var cupBtn = new CupertinoButton(
child: new Text("launch action sheet"),
onPressed: () =>
{
CupertinoRouteUtils.showCupertinoModalPopup(
context: context,
builder: (context1) =>
{
return new CupertinoActionSheet(
title: new Text("some choices"),
actions: new List<Widget>()
{
new CupertinoActionSheetAction(
child: new Text("one"),
onPressed: () => { Navigator.pop(context1, 1); },
isDefaultAction: true
),
new CupertinoActionSheetAction(
child: new Text("two"),
onPressed: () => { Navigator.pop(context1, 2); }
),
new CupertinoActionSheetAction(
child: new Text("three"),
onPressed: () => { Navigator.pop(context1, 3); }
),*/
new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f)//,
//child: this._buildChatTextField()
),
}
)
}
);
}
);
}
);
rowWidgtes.Add(cupBtn);
return new CupertinoPageScaffold(
child: new Center(
child: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: rowWidgtes
);
/*,
navigationBar: new CupertinoNavigationBar(
middle: new Text("hello world")
)*/
);
}
}
}

14
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs


using UIWidgetsGallery.gallery;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.material;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

/*public class GalleryMain : UIWidgetsPanel {
protected override Widget createWidget() {
public class GalleryMain : UIWidgetsPanel {
/*protected override Widget createWidget() {
}
}*/
protected override void OnEnable() {
/*protected override void OnEnable() {
FontManager.instance.addFont(Resources.Load<Font>("fonts/MaterialIcons-Regular"), "Material Icons");
FontManager.instance.addFont(Resources.Load<Font>("fonts/GalleryIcons"), "GalleryIcons");

FontManager.instance.addFont(Resources.Load<Font>(path: "fonts/SF-Pro-Text-Bold"), ".SF Pro Text", FontWeight.w700);
base.OnEnable();
}
}*/
}*/
}
}

35
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs


padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
)
),
placeholder:"test"
);
}

color: CupertinoColors.black
),
child: new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
/*navigationBar: new CupertinoNavigationBar(
),
child: new SafeArea(
child: new ListView(
),*/
child:
/*new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: this._buildTagsField()//_buildChatTextField()
)*/
new SafeArea(
child:
new ListView(
this._buildNameField(),
this._buildEmailField(),
this._buildLocationField(),
this._buildPinField(),
this._buildTagsField(),
//this._buildNameField(),
//this._buildEmailField(),// !点击crash!
this._buildLocationField()//, // !点击crash!
//this._buildPinField(),// !点击crash!
//this._buildTagsField()
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: this._buildChatTextField()
),
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f)//,
//child: this._buildChatTextField()
)
}
)
)

319
com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

namespace Unity.UIWidgets.cupertino {
class CupertinoActionSheetUtils {
public static readonly TextStyle _kActionSheetActionStyle = new TextStyle(
// fontFamily: ".SF UI Text",
fontFamily: ".SF Pro Text",
fontFamily: ".SF UI Text",
color: CupertinoColors.activeBlue,
// fontFamily: ".SF UI Text",
fontFamily: ".SF Pro Text",
fontFamily: ".SF UI Text",
inherit: false,
fontSize: 13.0f,
fontWeight: FontWeight.w400,

public static readonly BoxDecoration _kAlertBlurOverlayDecoration = new BoxDecoration(
color: CupertinoColors.white,
backgroundBlendMode: BlendMode.overlay
public static readonly Color _kBackgroundColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xC7F9F9F9),
darkColor: new Color(0xC7252525)
);
public static readonly Color _kPressedColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xFFE1E1E1),
darkColor: new Color(0xFF2E2E2E)
public static readonly Color _kBackgroundColor = new Color(0xD1F8F8F8);
public static readonly Color _kPressedColor = new Color(0xA6E5E5EA);
public static readonly Color _kButtonDividerColor = new Color(0x403F3F3F);
public static readonly Color _kCancelPressedColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xFFECECEC),
darkColor: new Color(0xFF49494B)
);
public static readonly Color _kCancelButtonPressedColor = new Color(0xFFEAEAEA);
public static readonly Color _kButtonDividerColor = _kContentTextColor;
public const float _kBlurAmount = 20.0f;
public const float _kEdgeHorizontalPadding = 8.0f;

public readonly ScrollController actionScrollController;
public readonly Widget cancelButton;
Widget _buildContent() {
Widget _buildContent( BuildContext context ) {
List<Widget> content = new List<Widget>();
if (title != null || message != null) {
Widget titleSection = new _CupertinoAlertContentSection(

}
return new Container(
color: CupertinoActionSheetUtils._kBackgroundColor,
color: CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kBackgroundColor, context),//CupertinoActionSheetUtils._kBackgroundColor,
child: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,

new Flexible(child: new ClipRRect(
borderRadius: BorderRadius.circular(12.0f),
child: new BackdropFilter(
filter: ImageFilter.blur(sigmaX: CupertinoActionSheetUtils._kBlurAmount,
filter: ImageFilter.blur(
sigmaX: CupertinoActionSheetUtils._kBlurAmount,
child: new Container(
child: new _CupertinoAlertRenderWidget(
contentSection: new Builder(builder: _buildContent),
actionsSection: _buildActions()
)
/*new Container(
)
)*/
)
)
),

actionSheetWidth = MediaQuery.of(context).size.height -
(CupertinoActionSheetUtils._kEdgeHorizontalPadding * 2);
}
/// tbc semantics
/*return new SafeArea(
child: new Semantics(
namesRoute: true,
scopesRoute: true,
explicitChildNodes: true,
label: "Alert",
child: new CupertinoUserInterfaceLevel(
data: CupertinoUserInterfaceLevelData.elevated,
child: new Container(
width: actionSheetWidth,
margin: EdgeInsets.symmetric(
horizontal: CupertinoActionSheetUtils._kEdgeHorizontalPadding,
vertical: CupertinoActionSheetUtils._kEdgeVerticalPadding
),
child: new Column(
children: children,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch
)
)
)
)
);*/
return new SafeArea(
child: new Container(
width: actionSheetWidth,

public class CupertinoActionSheetAction : StatelessWidget {
public CupertinoActionSheetAction(
Widget child,
VoidCallback onPressed,
Key key = null,
VoidCallback onPressed = null,
bool isDestructiveAction = false
) {
bool isDestructiveAction = false,
Widget child = null
):base(key:key)
{
D.assert(child != null);
D.assert(onPressed != null);
this.child = child;

public readonly Widget child;
public override Widget build(BuildContext context) {
TextStyle style = CupertinoActionSheetUtils._kActionSheetActionStyle;
TextStyle style =CupertinoActionSheetUtils. _kActionSheetActionStyle.copyWith(
color: isDestructiveAction
? CupertinoDynamicColor.resolve(CupertinoColors.systemRed, context)
: CupertinoTheme.of(context).primaryColor);
//CupertinoActionSheetUtils._kActionSheetActionStyle;
}
if (isDestructiveAction) {
style = style.copyWith(color: CupertinoColors.destructiveRed);
}
return new GestureDetector(

constraints: new BoxConstraints(
minHeight: CupertinoActionSheetUtils._kButtonHeight
),
////tbc semantics
child: new Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(

}
class _CupertinoActionSheetCancelButtonState : State<_CupertinoActionSheetCancelButton> {
Color _backgroundColor;
public override void initState() {
_backgroundColor = CupertinoColors.white;
base.initState();
}
bool isBeingPressed = false;
setState(() => { _backgroundColor = CupertinoActionSheetUtils._kCancelButtonPressedColor; });
setState(() => { isBeingPressed = true; });
setState(() => { _backgroundColor = CupertinoColors.white; });
setState(() => { isBeingPressed = false; });
setState(() => { _backgroundColor = CupertinoColors.white; });
setState(() => { isBeingPressed = false; });
Color backgroundColor = isBeingPressed
? CupertinoActionSheetUtils._kCancelPressedColor
: CupertinoColors.secondarySystemGroupedBackground;
return new GestureDetector(
onTapDown: _onTapDown,
onTapUp: _onTapUp,

color: _backgroundColor,
color: CupertinoDynamicColor.resolve(backgroundColor, context),
borderRadius: BorderRadius.circular(CupertinoActionSheetUtils._kCornerRadius)
),
child: widget.child

class _CupertinoAlertRenderWidget : RenderObjectWidget {
public _CupertinoAlertRenderWidget(
Widget contentSection,
Widget actionsSection,
Key key = null
Key key = null,
Widget contentSection = null,
Widget actionsSection = null
) : base(key: key) {
this.contentSection = contentSection;
this.actionsSection = actionsSection;

public override RenderObject createRenderObject(BuildContext context) {
return new _RenderCupertinoAlert(
dividerThickness: CupertinoActionSheetUtils._kDividerThickness /
MediaQuery.of(context).devicePixelRatio
MediaQuery.of(context).devicePixelRatio,
dividerColor: CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context)
public override void updateRenderObject(BuildContext context, _RenderCupertinoAlert renderObject) {
base.updateRenderObject(context, renderObject);
renderObject.dividerColor = CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context);
}
}
class _CupertinoAlertRenderElement : RenderObjectElement {

Element _contentElement;
Element _actionsElement;
public new _CupertinoAlertRenderWidget widget {
public override _CupertinoAlertRenderWidget widget {
public new _RenderCupertinoAlert renderObject {
public override _RenderCupertinoAlert renderObject {
get { return base.renderObject as _RenderCupertinoAlert; }
}

_AlertSections.actionsSection);
}
protected override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

}
base.forgetChild(child);
}
protected override void removeChildRenderObject(RenderObject child) {

}
void _placeChildInSlot(RenderObject child, object slot) {
D.assert(slot != null);
switch ((_AlertSections) slot) {
case _AlertSections.contentSection:
renderObject.contentSection = child as RenderBox;

public _RenderCupertinoAlert(
RenderBox contentSection = null,
RenderBox actionsSection = null,
float dividerThickness = 0.0f
float dividerThickness = 0.0f,
Color dividerColor = null
D.assert(dividerColor != null);
_dividerPaint = new Paint();
_dividerPaint.color = CupertinoActionSheetUtils._kButtonDividerColor;
_dividerPaint.style = PaintingStyle.fill;
}
public RenderBox contentSection {

}
RenderBox _contentSection;
public RenderBox actionsSection {
get { return _actionsSection; }
set {

RenderBox _actionsSection;
readonly float _dividerThickness;
public Color dividerColor {
get { return _dividerPaint.color; }
set {
if (value == _dividerPaint.color) {
return;
}
_dividerPaint.color = value;
markNeedsPaint();
}
}
readonly Paint _dividerPaint = new Paint() {
color = CupertinoActionSheetUtils._kButtonDividerColor,
style = PaintingStyle.fill
};
public readonly float _dividerThickness;
public readonly Paint _dividerPaint;
public override void attach(object owner) {
base.attach(owner);

return 0.0f;
}
protected internal override float computeMaxIntrinsicHeight(float width) {
protected override float computeMaxIntrinsicHeight(float width) {
float contentHeight = contentSection.getMaxIntrinsicHeight(width);
float actionsHeight = actionsSection.getMaxIntrinsicHeight(width);
bool hasDivider = contentHeight > 0.0f && actionsHeight > 0.0f;

return 0.0f;
}
protected override void performLayout() {
public override void performLayout() {
bool hasDivider = contentSection.getMaxIntrinsicHeight(constraints.maxWidth) > 0.0f
&& actionsSection.getMaxIntrinsicHeight(constraints.maxWidth) > 0.0f;
float dividerThickness = hasDivider ? _dividerThickness : 0.0f;

);
Size actionsSize = actionsSection.size;
float actionSheetHeight = contentSize.height + dividerThickness + actionsSize.height;

actionsSection.paint(context, offset + actionsParentData.offset);
}
void _paintDividerBetweenContentAndActions(Canvas canvas, Offset offset) {
public void _paintDividerBetweenContentAndActions(Canvas canvas, Offset offset) {
offset.dy + contentSection.size.height, size.width, _dividerThickness
offset.dy + contentSection.size.height,
size.width,
_dividerThickness
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
public override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
MultiChildLayoutParentData contentSectionParentData =
contentSection.parentData as MultiChildLayoutParentData;
MultiChildLayoutParentData actionsSectionParentData =

class _CupertinoAlertActionSection : StatefulWidget {
public _CupertinoAlertActionSection(
List<Widget> children,
List<Widget> children = null,
ScrollController scrollController = null,
bool hasCancelButton = false
) : base(key: key) {

bool _isPressed = false;
public override Widget build(BuildContext context) {
return new _ActionSheetActionButtonParentDataWidget(
return new _ActionButtonParentDataWidget(
isPressed: _isPressed,
child: new GestureDetector(
behavior: HitTestBehavior.opaque,

}
}
class _ActionSheetActionButtonParentDataWidget : ParentDataWidget<_CupertinoAlertActionsRenderWidget> {
public _ActionSheetActionButtonParentDataWidget(
class _ActionButtonParentDataWidget : ParentDataWidget<_ActionButtonParentData> {
public _ActionButtonParentDataWidget(
Widget child,
bool isPressed = false,
Key key = null

public readonly bool isPressed;
public override void applyParentData(RenderObject renderObject) {
D.assert(renderObject.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData parentData =
renderObject.parentData as _ActionSheetActionButtonParentData;
D.assert(renderObject.parentData is _ActionButtonParentData);
_ActionButtonParentData parentData =
renderObject.parentData as _ActionButtonParentData;
// AbstractNode targetParent = renderObject.parent;
// tbc
public new Type debugTypicalAncestorWidgetClass {
get {
return typeof(_CupertinoAlertActionsRenderWidget);
}
}
class _ActionSheetActionButtonParentData : MultiChildLayoutParentData {
public _ActionSheetActionButtonParentData(
public class _ActionButtonParentData : MultiChildLayoutParentData {
public _ActionButtonParentData(
bool isPressed = false
) {
this.isPressed = isPressed;

}
List<Widget> actionButtons,
List<Widget> actionButtons = null,
float dividerThickness = 0.0f,
bool hasCancelButton = false
) : base(key: key, children: actionButtons) {

public override RenderObject createRenderObject(BuildContext context) {
return new _RenderCupertinoAlertActions(
dividerThickness: _dividerThickness,
hasCancelButton: _hasCancelButton
dividerColor: CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context),
hasCancelButton: _hasCancelButton,
backgroundColor: CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kBackgroundColor, context),
pressedColor: CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kPressedColor, context)
((_RenderCupertinoAlertActions) renderObject).dividerColor =
CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context);
((_RenderCupertinoAlertActions) renderObject).backgroundColor =
CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kBackgroundColor, context);
((_RenderCupertinoAlertActions) renderObject).pressedColor = CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kPressedColor, context);
}
}

List<RenderBox> children = null,
float dividerThickness = 0.0f,
bool hasCancelButton = false
Color dividerColor = null,
bool hasCancelButton = false,
Color backgroundColor = null,
Color pressedColor = null
addAll(children ?? new List<RenderBox>());
_buttonBackgroundPaint = new Paint() {
color = CupertinoActionSheetUtils._kBackgroundColor,
style = PaintingStyle.fill
};
_pressedButtonBackgroundPaint = new Paint() {
color = CupertinoActionSheetUtils._kPressedColor,
style = PaintingStyle.fill
};
_dividerPaint = new Paint() {
color = CupertinoActionSheetUtils._kButtonDividerColor,
style = PaintingStyle.fill
};
addAll(children);
float _dividerThickness;
public float dividerThickness {
get { return _dividerThickness; }
set {

}
}
float _dividerThickness;
public Color backgroundColor {
get { return _buttonBackgroundPaint.color; }
set {
if (value == _buttonBackgroundPaint.color) {
return;
}
_buttonBackgroundPaint.color = value;
markNeedsPaint();
}
}
public Color dividerColor {
get { return _dividerPaint.color; }
set {
if (value == _dividerPaint.color) {
return;
}
_dividerPaint.color = value;
markNeedsPaint();
}
}
public Color pressedColor {
get { return _pressedButtonBackgroundPaint.color; }
set {
if (value == _pressedButtonBackgroundPaint.color) {
return;
}
_pressedButtonBackgroundPaint.color = value;
markNeedsPaint();
}
}
public bool hasCancelButton {
get { return _hasCancelButton; }
set {

}
}
readonly Paint _buttonBackgroundPaint = new Paint() {
color = CupertinoActionSheetUtils._kBackgroundColor,
style = PaintingStyle.fill
};
readonly Paint _pressedButtonBackgroundPaint = new Paint() {
color = CupertinoActionSheetUtils._kPressedColor,
style = PaintingStyle.fill
};
readonly Paint _dividerPaint = new Paint() {
color = CupertinoActionSheetUtils._kButtonDividerColor,
style = PaintingStyle.fill
};
public readonly Paint _buttonBackgroundPaint;
public readonly Paint _pressedButtonBackgroundPaint;
public readonly Paint _dividerPaint;
if (!(child.parentData is _ActionSheetActionButtonParentData)) {
child.parentData = new _ActionSheetActionButtonParentData();
if (!(child.parentData is _ActionButtonParentData)) {
child.parentData = new _ActionButtonParentData();
}
}

+ (0.5f * childAfter(firstChild).getMinIntrinsicHeight(width));
}
protected internal override float computeMaxIntrinsicHeight(float width) {
protected override float computeMaxIntrinsicHeight(float width) {
if (childCount == 0) {
return 0.0f;
}

void _drawButtonBackgroundsAndDividersStacked(Canvas canvas, Offset offset) {
Offset dividerOffset = new Offset(0.0f, dividerThickness);
Path backgroundFillPath = new Path();
// fillType = PathFillType.evenOdd
backgroundFillPath.fillType = PathFillType.evenOdd;
backgroundFillPath.addRect(Rect.fromLTWH(0.0f, 0.0f, size.width, size.height));
Path pressedBackgroundFillPath = new Path();

RenderBox prevChild = null;
D.assert(child.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData currentButtonParentData =
child.parentData as _ActionSheetActionButtonParentData;
D.assert(child.parentData is _ActionButtonParentData);
_ActionButtonParentData currentButtonParentData =
child.parentData as _ActionButtonParentData;
D.assert(prevChild.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData previousButtonParentData =
prevChild.parentData as _ActionSheetActionButtonParentData;
D.assert(prevChild.parentData is _ActionButtonParentData);
_ActionButtonParentData previousButtonParentData =
prevChild.parentData as _ActionButtonParentData;
isPrevButtonPressed = previousButtonParentData.isPressed;
}

accumulatingOffset.dx,
accumulatingOffset.dy, size.width, _dividerThickness
accumulatingOffset.dy,
size.width,
_dividerThickness
accumulatingOffset.dy + (isDividerPresent ? dividerThickness : 0.0f), size.width,
child.size.height
accumulatingOffset.dy + (isDividerPresent ? dividerThickness : 0.0f),
size.width,
child.size.height
);
if (isButtonPressed) {
backgroundFillPath.addRect(buttonBackgroundRect);

46
com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

namespace Unity.UIWidgets.cupertino {
static class CupertinoActivityIndicatorUtils {
public const float _kDefaultIndicatorRadius = 10.0f;
public const Color _kActiveTickColor = CupertinoDynamicColor.withBrightness(
color: Color(0xFF3C3C44),
darkColor: Color(0xFFEBEBF5)
);
// list
public static int[] _alphaValues = {
147, 131, 114, 97, 81, 64, 47, 47, 47, 47, 47, 47
};
public static readonly Color _kActiveTickColor = new Color(0xFF9D9D9D);
}
public class CupertinoActivityIndicator : StatefulWidget {

float radius = CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius
) : base(key: key) {
D.assert(animating != null);
D.assert(radius != null);
D.assert(radius > 0);
this.animating = animating;
this.radius = radius;

child: new CustomPaint(
painter: new _CupertinoActivityIndicatorPainter(
position: _controller,
activeColor: CupertinoDynamicColor.resolve(CupertinoActivityIndicatorUtils._kActiveTickColor, context),
radius: widget.radius
)
)

class _CupertinoActivityIndicatorPainter : AbstractCustomPainter {
class _CupertinoActivityIndicatorPainter : CustomPainter {
//AbstractCustomPainter {
Animation<float> position,
float radius
Animation<float> position = null,
Color activeColor = null,
float radius =0f
radiusX: 1.0f,
radiusY: 1.0f
radiusX: 1.0f * radius / CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius,
radiusY: 1.0f * radius / CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius
this.activeColor = activeColor;
readonly Animation<float> position;
readonly RRect tickFundamentalRRect;
public readonly Animation<float> position;
public readonly RRect tickFundamentalRRect;
public readonly Color activeColor;
public override void paint(Canvas canvas, Size size) {
Paint paint = new Paint();

int activeTick = (CupertinoActivityIndicatorUtils._kTickCount * position.value).floor();
for (int i = 0; i < CupertinoActivityIndicatorUtils._kTickCount; ++i) {
float t = (((i + activeTick) % CupertinoActivityIndicatorUtils._kTickCount) /
CupertinoActivityIndicatorUtils._kHalfTickCount).clamp(0, 1);
paint.color = Color.lerp(a: CupertinoActivityIndicatorUtils._kActiveTickColor,
b: CupertinoActivityIndicatorUtils._kTickColor, t: t);
int t = ((i + activeTick) % CupertinoActivityIndicatorUtils._kTickCount);
paint.color = activeColor.withAlpha(CupertinoActivityIndicatorUtils._alphaValues[t]);
canvas.drawRRect(tickFundamentalRRect,paint);
canvas.rotate(-CupertinoActivityIndicatorUtils._kTwoPI / CupertinoActivityIndicatorUtils._kTickCount);
}

public override bool shouldRepaint(CustomPainter oldPainter) {
return (oldPainter as _CupertinoActivityIndicatorPainter).position != position;
return ((oldPainter as _CupertinoActivityIndicatorPainter).position != position) ||
((oldPainter as _CupertinoActivityIndicatorPainter).activeColor != activeColor);
}
}
}

118
com.unity.uiwidgets/Runtime/cupertino/app.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

LocaleListResolutionCallback localeListResolutionCallback = null,
LocaleResolutionCallback localeResolutionCallback = null,
List<Locale> supportedLocales = null,
bool showPerformanceOverlay = false
bool showPerformanceOverlay = false,
bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false,
bool showSemanticsDebugger = false,
bool debugShowCheckedModeBanner = true
// tbc????
//Dictionary<LogicalKeySet, Intent> shortcuts = null,
//Dictionary<LocalKey, ActionFactory> actions = null
D.assert(routes != null);
D.assert(navigatorObservers != null);
D.assert(showPerformanceOverlay != null);
D.assert(checkerboardRasterCacheImages != null);
D.assert(checkerboardOffscreenLayers != null);
D.assert(showSemanticsDebugger != null);
D.assert(debugShowCheckedModeBanner != null);
supportedLocales = supportedLocales ?? new List<Locale> {new Locale("en", "US")};
this.navigatorKey = navigatorKey;

public readonly Dictionary<string, WidgetBuilder> routes;
public readonly string initialRoute;
public readonly RouteFactory onGenerateRoute;
public readonly InitialRouteListFactory onGenerateInitialRoutes;
public readonly RouteFactory onUnknownRoute;
public readonly List<NavigatorObserver> navigatorObservers;
public readonly TransitionBuilder builder;

public readonly LocaleResolutionCallback localeResolutionCallback;
public readonly List<Locale> supportedLocales;
public readonly bool showPerformanceOverlay;
public readonly bool checkerboardRasterCacheImages;
public readonly bool checkerboardOffscreenLayers;
public readonly bool showSemanticsDebugger;
public readonly bool debugShowWidgetInspector;
public readonly bool debugShowCheckedModeBanner;
//TBC ????
//public readonly Dictionary<LogicalKeySet, Intent> shortcuts;
//public readonly Dictionary<LocalKey, ActionFactory> actions;
public override State createState() {
return new _CupertinoAppState();

List<NavigatorObserver> _navigatorObservers;
void _updateNavigator() {
if (widget.home != null || widget.routes.isNotEmpty() || widget.onGenerateRoute != null ||
if (widget.home != null ||
widget.routes.isNotEmpty() ||
widget.onGenerateRoute != null ||
widget.onUnknownRoute != null) {
_navigatorObservers = new List<NavigatorObserver>();
foreach (var item in widget.navigatorObservers) {

}
_delegates.Add(DefaultCupertinoLocalizations.del);
//_delegates.Add(DefaultMaterialLocalizations.del);
child: new CupertinoTheme(
data: effectiveThemeData,
child: new WidgetsApp(
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new CupertinoPageRoute(settings: settings, builder: builder),
home: widget.home,
routes: widget.routes,
initialRoute: widget.initialRoute,
onGenerateRoute: widget.onGenerateRoute,
onUnknownRoute: widget.onUnknownRoute,
builder: widget.builder,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
textStyle: effectiveThemeData.textTheme.textStyle,
color: widget.color ?? CupertinoColors.activeBlue,
locale: widget.locale,
localizationsDelegates: _localizationsDelegates,
localeResolutionCallback: widget.localeResolutionCallback,
localeListResolutionCallback: widget.localeListResolutionCallback,
supportedLocales: widget.supportedLocales,
showPerformanceOverlay: widget.showPerformanceOverlay,
inspectorSelectButtonBuilder: (BuildContext _context, VoidCallback onPressed) => {
return CupertinoButton.filled(
child: new Icon(
CupertinoIcons.search,
size: 28.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.zero,
onPressed: onPressed
);
}
child: new CupertinoUserInterfaceLevel(
data: CupertinoUserInterfaceLevelData.baselayer,
child: new CupertinoTheme(
data: effectiveThemeData,
child: new Builder(
builder: (BuildContext context1)=> {
return new WidgetsApp(
key: new GlobalObjectKey<State<StatefulWidget>>(value: this),
navigatorKey: widget.navigatorKey,
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
navigatorObservers: _navigatorObservers,
initialRoute: widget.initialRoute,
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new CupertinoPageRoute(settings: settings, builder: builder),
home: widget.home,
routes: widget.routes,
builder: widget.builder,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
textStyle: CupertinoTheme.of(context).textTheme.textStyle,
color: CupertinoDynamicColor.resolve(widget.color ?? effectiveThemeData.primaryColor, context),
locale: widget.locale,
localizationsDelegates: _localizationsDelegates,
localeResolutionCallback: widget.localeResolutionCallback,
localeListResolutionCallback: widget.localeListResolutionCallback,
supportedLocales: widget.supportedLocales,
showPerformanceOverlay: widget.showPerformanceOverlay,
checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers,
showSemanticsDebugger: widget.showSemanticsDebugger,
debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner,
inspectorSelectButtonBuilder: (BuildContext context2, VoidCallback onPressed)=>{
return CupertinoButton.filled(
child: new Icon(
CupertinoIcons.search,
size: 28.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.zero,
onPressed: onPressed
);
}
///TBC????
//shortcuts: widget.shortcuts,
//actions: widget.actions
);
}
)
}
}
}
}

71
com.unity.uiwidgets/Runtime/cupertino/button.cs


using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;

public class CupertinoButtonUtils {
public static readonly Color _kDisabledBackground = new Color(0xFFA9A9A9);
public static readonly Color _kDisabledForeground = new Color(0xFFD1D1D1);
public static readonly EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric(vertical: 14.0f, horizontal: 64.0f);
public static readonly EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric(
vertical: 14.0f,
horizontal: 64.0f);
public static readonly float kMinInteractiveDimensionCupertino = 44.0f;
Widget child,
VoidCallback onPressed,
Widget child = null,
float minSize = 44.0f,
float pressedOpacity = 0.1f,
float minSize = CupertinoButtonUtils.kMinInteractiveDimensionCupertino,
float pressedOpacity = 0.4f,
bool filled = false
VoidCallback onPressed = null
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
_filled = filled;
D.assert((pressedOpacity >= 0.0 && pressedOpacity <= 1.0) || pressedOpacity == null );
D.assert(disabledColor != null);
_filled = false;
this.disabledColor = disabledColor;
this.disabledColor = disabledColor ?? CupertinoColors.quaternarySystemFill;
this.minSize = minSize;
this.pressedOpacity = pressedOpacity;
this.borderRadius = borderRadius ?? BorderRadius.all(Radius.circular(8.0f));

Widget child,
VoidCallback onPressed,
Widget child = null,
float minSize = 44.0f,
float pressedOpacity = 0.1f,
BorderRadius borderRadius = null
float minSize = CupertinoButtonUtils.kMinInteractiveDimensionCupertino,
float pressedOpacity = 0.4f,
BorderRadius borderRadius = null,
VoidCallback onPressed = null
return new CupertinoButton(
D.assert(disabledColor != null);
var btn = new CupertinoButton(
onPressed: onPressed,
filled: true
onPressed: onPressed
btn._filled = true;
return btn;
}
public readonly Widget child;

public readonly float minSize;
public readonly float? pressedOpacity;
public readonly float pressedOpacity;
public readonly bool _filled;
public bool _filled;
public bool enabled {
get { return onPressed != null; }

class _CupertinoButtonState : SingleTickerProviderStateMixin<CupertinoButton> {
static readonly TimeSpan kFadeOutDuration = new TimeSpan(0, 0, 0, 0, 10);
static readonly TimeSpan kFadeInDuration = new TimeSpan(0, 0, 0, 0, 100);
public readonly FloatTween _opacityTween = new FloatTween(begin: 1.0f, end: 0.0f);
public readonly Tween<float> _opacityTween = new Tween<float>(begin: 1.0f, end: 0.0f);
AnimationController _animationController;
Animation<float> _opacityAnimation;

duration: new TimeSpan(0, 0, 0, 0, 200),
value: 0.0f,
vsync: this);
_opacityAnimation = _animationController
.drive(new CurveTween(curve: Curves.decelerate))
.drive(_opacityTween);

public override Widget build(BuildContext context) {
bool enabled = widget.enabled;
Color primaryColor = CupertinoTheme.of(context).primaryColor;
Color backgroundColor = widget.color ?? (widget._filled ? primaryColor : null);
CupertinoThemeData themeData = CupertinoTheme.of(context);
Color primaryColor = themeData.primaryColor;
Color backgroundColor = (widget.color == null)
? (widget._filled ? primaryColor : null)
: CupertinoDynamicColor.resolve(widget.color, context);
? CupertinoTheme.of(context).primaryContrastingColor
? themeData.primaryContrastingColor
: CupertinoButtonUtils._kDisabledForeground;
: CupertinoDynamicColor.resolve(CupertinoColors.placeholderText, context);
CupertinoTheme.of(context).textTheme.textStyle.copyWith(color: foregroundColor);
themeData.textTheme.textStyle.copyWith(color: foregroundColor);
return new GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: enabled ? _handleTapDown : (GestureTapDownCallback) null,

widget.onPressed();
}
},
////tbc semantics
constraints: new BoxConstraints(
constraints: widget.minSize == null
? new BoxConstraints() :
new BoxConstraints(
minWidth: widget.minSize,
minHeight: widget.minSize
),

decoration: new BoxDecoration(
borderRadius: widget.borderRadius,
color: backgroundColor != null && !enabled
? widget.disabledColor ?? CupertinoButtonUtils._kDisabledBackground
? CupertinoDynamicColor.resolve(widget.disabledColor, context)
: backgroundColor
),
child: new Padding(

998
com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
文件差异内容过多而无法显示
查看文件

21
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


namespace Unity.UIWidgets.cupertino {
class CupertinoDialogUtils {
public static readonly TextStyle _kCupertinoDialogTitleStyle = new TextStyle(
inherit:false,
color: CupertinoColors.black,
letterSpacing: 0.48f,
textBaseline: TextBaseline.alphabetic
);

inherit:false,
color: CupertinoColors.black,
//color: CupertinoColors.black,
height: 1.036f,
letterSpacing: -0.25f,
textBaseline: TextBaseline.alphabetic

fontFamily: ".SF UI Text",
inherit:false,
fontSize: 16.8f,
fontWeight: FontWeight.w400,
color: CupertinoColors.activeBlue,

public const float _kDividerThickness = 1.0f;
public const float _kMaxRegularTextScaleFactor = 1.4f;
public static readonly Color _kDialogColor = new Color(0xC0FFFFFF);
public static readonly Color _kDialogPressedColor = new Color(0x90FFFFFF);
//public static readonly Color _kDialogColor = new Color(0xC0FFFFFF);
//public static readonly Color _kDialogPressedColor = new Color(0x90FFFFFF);
public static readonly Color _kDialogColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xCCF2F2F2),
darkColor: new Color(0xBF1E1E1E)
);
public static readonly Color _kDialogPressedColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xFFE1E1E1),
darkColor: new Color(0xFF2E2E2E)
);
public static bool _isInAccessibilityMode(BuildContext context) {
MediaQueryData data = MediaQuery.of(context, nullOk: true);

_AlertDialogSections.actionsSection);
}
protected override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

5
com.unity.uiwidgets/Runtime/cupertino/localization.cs


return locale.languageCode == "en";
}
/* public override Future<CupertinoLocalizations> loadT(Locale locale) {
return DefaultCupertinoLocalizations.load(locale);
}*/
//public override Future<> load(Locale locale) {
public override Future<WidgetsLocalizations> load(Locale locale) {
return DefaultCupertinoLocalizations.load(locale).to<WidgetsLocalizations>();
}

20
com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs


}
}
public class CupertinoNavigationBar : StatefulWidget {
public class CupertinoNavigationBar : ObstructingPreferredSizeWidget {
public CupertinoNavigationBar(
Key key = null,
Widget leading = null,

bool transitionBetweenRoutes = true,
object heroTag = null
) : base(key: key) {
//D.assert(automaticallyImplyLeading != null);
//D.assert(automaticallyImplyMiddle != null);
//D.assert(transitionBetweenRoutes != null);
this.leading = leading;
this.automaticallyImplyLeading = automaticallyImplyLeading;
this.automaticallyImplyMiddle = automaticallyImplyMiddle;

this.actionsForegroundColor = actionsForegroundColor;
this.transitionBetweenRoutes = transitionBetweenRoutes;
this.heroTag = heroTag ?? NavBarUtils._defaultHeroTag;
}
public readonly Widget leading;

public readonly object heroTag;
//public override bool? fullObstruction {
public bool? fullObstruction {
public override bool? fullObstruction {
//public override Size preferredSize {
public Size preferredSize {
public override Size preferredSize {
get { return Size.fromHeight(NavBarUtils._kNavBarPersistentHeight); }
}

}
RenderAnimatedOpacity topBackLabelOpacity =
(RenderAnimatedOpacity) topComponents.backLabelKey.currentContext?.ancestorRenderObjectOfType(
(RenderAnimatedOpacity) topComponents.backLabelKey.currentContext?.findAncestorRenderObjectOfType<RenderAnimatedOpacity>();
/*ancestorRenderObjectOfType(
);
);*/
Animation<float> midClickOpacity = null;
if (topBackLabelOpacity != null && topBackLabelOpacity.opacity.value < 1.0f) {

16
com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs


public CupertinoPageScaffold(
Widget child,
Key key = null,
//ObstructingPreferredSizeWidget navigationBar = null,
CupertinoNavigationBar navigationBar = null,
ObstructingPreferredSizeWidget navigationBar = null,
this.child = child;
this.navigationBar = navigationBar;
this.backgroundColor = backgroundColor;

//public readonly ObstructingPreferredSizeWidget navigationBar;
public readonly CupertinoNavigationBar navigationBar;
public readonly ObstructingPreferredSizeWidget navigationBar;
public readonly Widget child;
public readonly Color backgroundColor;
public readonly bool resizeToAvoidBottomInset;

right: 0.0f,
height: existingMediaQuery.padding.top,
child: new GestureDetector(
//excludeFromSemantics: true,
onTap: _handleStatusBarTap
)
)

public abstract class ObstructingPreferredSizeWidget : PreferredSizeWidget {
protected ObstructingPreferredSizeWidget(Key key = null) : base(key: key) {}
//public virtual Size preferredSize { get; }
public virtual bool? fullObstruction { get; }
///protected ObstructingPreferredSizeWidget(Key key = null) : base(key: key) {}
// public virtual bool? fullObstruction { get; }
public abstract bool shouldFullyObstruct(BuildContext context);
}

44
com.unity.uiwidgets/Runtime/cupertino/route.cs


)
);
}
public static readonly Animatable<float> _dialogScaleTween = new FloatTween(begin: 1.3f, end: 1.0f)
.chain(new CurveTween(curve: Curves.linearToEaseOut));

);
}
public static Future<object> showCupertinoDialog(
public static Future showCupertinoDialog(
return DialogUtils.showGeneralDialog(
return _DialogRoute.showGeneralDialog(
context: context,
barrierDismissible: false,
barrierColor: _kModalBarrierColor,

}
}
protected internal override void didChangePrevious(Route previousRoute) {
protected internal override void didChangePrevious(Route previousRoute) {
string previousTitleString = previousRoute is CupertinoPageRoute
? ((CupertinoPageRoute) previousRoute).title
: null;

}
public override bool canTransitionFrom(TransitionRoute previousRoute) {
return previousRoute is CupertinoPageRoute;
}
/*public override bool canTransitionFrom(TransitionRoute<object> previousRoute) {
return previousRoute is CupertinoPageRoute<object>;
}*/
public override bool canTransitionTo(TransitionRoute nextRoute) {
return nextRoute is CupertinoPageRoute && !((CupertinoPageRoute) nextRoute).fullscreenDialog;
}
/*public override bool canTransitionTo(TransitionRoute<object> nextRoute) {
return nextRoute is CupertinoPageRoute<object> && !((CupertinoPageRoute<object>) nextRoute).fullscreenDialog;
}*/
static bool isPopGestureInProgress(PageRoute route) {
return route.navigator.userGestureInProgress;

public bool popGestureInProgress {
get { return isPopGestureInProgress(this); }
get { return isPopGestureInProgress(this as PageRoute); }
get { return _isPopGestureEnabled(this); }
get { return _isPopGestureEnabled(this as PageRoute); }
}
static bool _isPopGestureEnabled(PageRoute route) {

return false;
}
if (isPopGestureInProgress(route)) {
if (isPopGestureInProgress(route )) {
return false;
}

Animation<float> secondaryAnimation,
Widget child
) {
bool linearTransition = isPopGestureInProgress(route);
if (route.fullscreenDialog) {
return new CupertinoFullscreenDialogTransition(
animation: animation,

return new CupertinoPageTransition(
primaryRouteAnimation: animation,
secondaryRouteAnimation: secondaryAnimation,
linearTransition: isPopGestureInProgress(route),
linearTransition: linearTransition,
child: new _CupertinoBackGestureDetector(
enabledCallback: () => _isPopGestureEnabled(route),
onStartPopGesture: () => _startPopGesture(route),

class CupertinoPageTransition : StatelessWidget {
public CupertinoPageTransition(
Animation<float> primaryRouteAnimation = null,
Animation<float> secondaryRouteAnimation = null,
Widget child = null,
bool linearTransition = default,
Animation<float> primaryRouteAnimation,
Animation<float> secondaryRouteAnimation,
Widget child,
bool linearTransition,
Key key = null
) : base(key: key) {
_primaryPositionAnimation =

}
}
class _CupertinoModalPopupRoute : PopupRoute {
class _CupertinoModalPopupRoute : PopupRoute{
public _CupertinoModalPopupRoute(
WidgetBuilder builder = null,
string barrierLabel = null,

);
}
}
}
}

5
com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs


AnimationController _fadeoutAnimationController;
Animation<float> _fadeoutOpacityAnimation;
double _dragScrollbarPositionY;
float _dragScrollbarPositionY;
public override void initState() {

_painter.update(notification.metrics, notification.metrics.axisDirection);
}
else if (notification is ScrollEndNotification) {
if (_dragScrollbarPositionY == null) {
if (_dragScrollbarPositionY.Equals(0f)) {
_startFadeoutTimer();
}

2
com.unity.uiwidgets/Runtime/cupertino/tab_view.cs


return true;
});
return result;
return result ;
}
}
}

261
com.unity.uiwidgets/Runtime/cupertino/text_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
public static readonly TextStyle _kDefaultLightTextStyle = new TextStyle(
/*public static readonly TextStyle _kDefaultLightTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,

fontWeight: FontWeight.w700,
letterSpacing: 0.41f,
color: CupertinoColors.white
);*/
public static readonly TextStyle _kDefaultTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
letterSpacing: -0.41f,
color: CupertinoColors.label,
decoration: TextDecoration.none
public static readonly TextStyle _kDefaultActionTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
letterSpacing: -0.41f,
color: CupertinoColors.activeBlue,
decoration: TextDecoration.none
);
public static readonly TextStyle _kDefaultTabLabelTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 10.0f,
letterSpacing: -0.24f,
color: CupertinoColors.inactiveGray
);
public static readonly TextStyle _kDefaultMiddleTitleTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
fontWeight: FontWeight.w600,
letterSpacing: -0.41f,
color: CupertinoColors.label
);
public static readonly TextStyle _kDefaultLargeTitleTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Display",
fontSize: 34.0f,
fontWeight: FontWeight.w700,
letterSpacing: 0.41f,
color: CupertinoColors.label
);
public static readonly TextStyle _kDefaultPickerTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Display",
fontSize: 21.0f,
fontWeight: FontWeight.w400,
letterSpacing: -0.41f,
color: CupertinoColors.label
);
public static readonly TextStyle _kDefaultDateTimePickerTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Display",
fontSize: 21.0f,
fontWeight: FontWeight.normal,
color: CupertinoColors.label
);
public static TextStyle _resolveTextStyle(TextStyle style, BuildContext context, bool nullOk) {
return style?.copyWith(
color: CupertinoDynamicColor.resolve(style?.color, context, nullOk: nullOk),
backgroundColor: CupertinoDynamicColor.resolve(style?.backgroundColor, context, nullOk: nullOk),
decorationColor: CupertinoDynamicColor.resolve(style?.decorationColor, context, nullOk: nullOk)
);
}
}

TextStyle tabLabelTextStyle = null,
TextStyle navTitleTextStyle = null,
TextStyle navLargeTitleTextStyle = null,
TextStyle navActionTextStyle = null
TextStyle navActionTextStyle = null,
TextStyle pickerTextStyle = null,
TextStyle dateTimePickerTextStyle = null
) {
_primaryColor = primaryColor ?? CupertinoColors.activeBlue;
_brightness = brightness;

_navTitleTextStyle = navTitleTextStyle;
_navLargeTitleTextStyle = navLargeTitleTextStyle;
_navActionTextStyle = navActionTextStyle;
_defaults = new _TextThemeDefaultsBuilder(CupertinoColors.label, CupertinoColors.inactiveGray);
readonly Color _primaryColor;
readonly Brightness? _brightness;
public static CupertinoTextThemeData _raw(
_TextThemeDefaultsBuilder _defaults,
Color primaryColor ,
TextStyle textStyle = null,
TextStyle actionTextStyle = null,
TextStyle tabLabelTextStyle = null,
TextStyle navTitleTextStyle = null,
TextStyle navLargeTitleTextStyle = null,
TextStyle navActionTextStyle = null,
TextStyle pickerTextStyle = null,
TextStyle dateTimePickerTextStyle = null
) {
var textThemeData = new CupertinoTextThemeData(
primaryColor,
null,
textStyle,
actionTextStyle,
tabLabelTextStyle,
navTitleTextStyle,
navLargeTitleTextStyle,
navActionTextStyle,
pickerTextStyle,
dateTimePickerTextStyle
);
textThemeData._defaults = _defaults;
return textThemeData;
bool _isLight {
get { return _brightness != Brightness.dark; }
readonly TextStyle _textStyle;
_TextThemeDefaultsBuilder _defaults;
readonly Color _primaryColor;
readonly Brightness? _brightness;
readonly TextStyle _textStyle;
return _textStyle ?? (_isLight
? CupertinoTextThemeDataUtils._kDefaultLightTextStyle
: CupertinoTextThemeDataUtils._kDefaultDarkTextStyle);
return _textStyle ?? _defaults.textStyle;
}
}

get {
return _actionTextStyle ?? CupertinoTextThemeDataUtils._kDefaultActionTextStyle.copyWith(
color: _primaryColor
);
return _actionTextStyle ?? _defaults.actionTextStyle(primaryColor: _primaryColor);
}
}

get { return _tabLabelTextStyle ?? CupertinoTextThemeDataUtils._kDefaultTabLabelTextStyle; }
get { return _tabLabelTextStyle ?? _defaults.tabLabelTextStyle;}
}
readonly TextStyle _navTitleTextStyle;

return _navTitleTextStyle ??
(_isLight
? CupertinoTextThemeDataUtils._kDefaultMiddleTitleLightTextStyle
: CupertinoTextThemeDataUtils._kDefaultMiddleTitleDarkTextStyle);
return _navTitleTextStyle ?? _defaults.navTitleTextStyle;
}
}

public TextStyle navLargeTitleTextStyle {
get {
return _navLargeTitleTextStyle ??
(_isLight
? CupertinoTextThemeDataUtils._kDefaultLargeTitleLightTextStyle
: CupertinoTextThemeDataUtils._kDefaultLargeTitleDarkTextStyle);
return _navLargeTitleTextStyle ?? _defaults.navLargeTitleTextStyle;
}
}

get {
return _navActionTextStyle ?? CupertinoTextThemeDataUtils._kDefaultActionTextStyle.copyWith(
color: _primaryColor
);
return _navActionTextStyle ?? _defaults.navActionTextStyle(primaryColor: _primaryColor);
}
}
readonly TextStyle _pickerTextStyle;
public TextStyle pickerTextStyle {
get {
return _pickerTextStyle ?? _defaults.pickerTextStyle;
public CupertinoTextThemeData copyWith(
readonly TextStyle _dateTimePickerTextStyle;
public TextStyle dateTimePickerTextStyle {
get {
return _dateTimePickerTextStyle ?? _defaults.dateTimePickerTextStyle;
}
}
public CupertinoTextThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
return CupertinoTextThemeData._raw(
_defaults?.resolveFrom(context, nullOk),
CupertinoDynamicColor.resolve(_primaryColor, context, nullOk: nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_textStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_actionTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_tabLabelTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_navTitleTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_navLargeTitleTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_navActionTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_pickerTextStyle, context, nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_dateTimePickerTextStyle, context, nullOk)
);
}
public new CupertinoTextThemeData copyWith(
Color primaryColor,
Brightness? brightness,
TextStyle textStyle,

TextStyle navLargeTitleTextStyle,
TextStyle navActionTextStyle
TextStyle navActionTextStyle,
TextStyle pickerTextStyle,
TextStyle dateTimePickerTextStyle
) {
return new CupertinoTextThemeData(
primaryColor: primaryColor ?? _primaryColor,

tabLabelTextStyle: tabLabelTextStyle ?? _tabLabelTextStyle,
navTitleTextStyle: navTitleTextStyle ?? _navTitleTextStyle,
navLargeTitleTextStyle: navLargeTitleTextStyle ?? _navLargeTitleTextStyle,
navActionTextStyle: navActionTextStyle ?? _navActionTextStyle
navActionTextStyle: navActionTextStyle ?? _navActionTextStyle,
pickerTextStyle ?? _pickerTextStyle,
dateTimePickerTextStyle ?? _dateTimePickerTextStyle
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
CupertinoTextThemeData defaultData = new CupertinoTextThemeData();
properties.add(new DiagnosticsProperty<TextStyle>("textStyle", textStyle, defaultValue: defaultData.textStyle));
properties.add(new DiagnosticsProperty<TextStyle>("actionTextStyle", actionTextStyle, defaultValue: defaultData.actionTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("tabLabelTextStyle", tabLabelTextStyle, defaultValue: defaultData.tabLabelTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("navTitleTextStyle", navTitleTextStyle, defaultValue: defaultData.navTitleTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("navLargeTitleTextStyle", navLargeTitleTextStyle, defaultValue: defaultData.navLargeTitleTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("navActionTextStyle", navActionTextStyle, defaultValue: defaultData.navActionTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("pickerTextStyle", pickerTextStyle, defaultValue: defaultData.pickerTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("dateTimePickerTextStyle", dateTimePickerTextStyle, defaultValue: defaultData.dateTimePickerTextStyle));
}
public class _TextThemeDefaultsBuilder {
public _TextThemeDefaultsBuilder(
Color labelColor = null,
Color inactiveGrayColor = null
) {
this.labelColor = labelColor;
this.inactiveGrayColor = inactiveGrayColor;
D.assert(labelColor != null);
D.assert(inactiveGrayColor != null);
}
public readonly Color labelColor;
public readonly Color inactiveGrayColor;
public static TextStyle _applyLabelColor(TextStyle original, Color color) {
return original?.color == color
? original
: original?.copyWith(color: color);
}
public TextStyle textStyle {
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultTextStyle, labelColor);
}
}
public TextStyle tabLabelTextStyle
{
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultTabLabelTextStyle, inactiveGrayColor);
}
}
public TextStyle navTitleTextStyle {
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultMiddleTitleTextStyle, labelColor);
}
}
public TextStyle navLargeTitleTextStyle {
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultLargeTitleTextStyle, labelColor);
}
}
public TextStyle pickerTextStyle {
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultPickerTextStyle, labelColor);
}
}
public TextStyle dateTimePickerTextStyle {
get {
return _applyLabelColor(CupertinoTextThemeDataUtils._kDefaultDateTimePickerTextStyle, labelColor);
}
}
public TextStyle actionTextStyle( Color primaryColor = null) => CupertinoTextThemeDataUtils._kDefaultActionTextStyle.copyWith(color: primaryColor);
public TextStyle navActionTextStyle( Color primaryColor = null) => actionTextStyle(primaryColor: primaryColor);
public _TextThemeDefaultsBuilder resolveFrom(BuildContext context, bool nullOk) {
Color resolvedLabelColor = CupertinoDynamicColor.resolve(labelColor, context, nullOk: nullOk);
Color resolvedInactiveGray = CupertinoDynamicColor.resolve(inactiveGrayColor, context, nullOk: nullOk);
return resolvedLabelColor == labelColor && resolvedInactiveGray == CupertinoColors.inactiveGray
? this
: new _TextThemeDefaultsBuilder(resolvedLabelColor, resolvedInactiveGray);
}
}
}

318
com.unity.uiwidgets/Runtime/cupertino/theme.cs


using System.Runtime.CompilerServices;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
public static readonly _CupertinoThemeDefaults _kDefaultTheme = new _CupertinoThemeDefaults(
null,
CupertinoColors.systemBlue,
CupertinoColors.systemBackground,
CupertinoDynamicColor.withBrightness(
debugLabel : "",
color: new Color(0xF0F9F9F9),
darkColor: new Color(0xF01D1D1D)
),
CupertinoColors.systemBackground,
new _CupertinoTextThemeDefaults(CupertinoColors.label, CupertinoColors.inactiveGray)
);
CupertinoThemeData data,
Widget child,
CupertinoThemeData data = null,
Widget child = null,
Key key = null
) : base(key: key) {
D.assert(child != null);

public static CupertinoThemeData of(BuildContext context) {
_InheritedCupertinoTheme inheritedTheme =
(_InheritedCupertinoTheme) context.inheritFromWidgetOfExactType(typeof(_InheritedCupertinoTheme));
(_InheritedCupertinoTheme) context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>(null);
//context.inheritFromWidgetOfExactType(typeof(_InheritedCupertinoTheme));
public static Brightness? brightnessOf(BuildContext context, bool nullOk = false) {
_InheritedCupertinoTheme inheritedTheme =
context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>(null);
var brightness = inheritedTheme?.theme?.data?.brightness;
var platformBrightness = MediaQuery.of(context, nullOk: nullOk)?.platformBrightness;
return brightness ?? platformBrightness;
}
data: new IconThemeData(color: data.primaryColor),
data: new CupertinoIconThemeData(color: data.primaryColor),
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
data.debugFillProperties(properties);
}
CupertinoTheme theme,
Widget child,
Key key = null
)
: base(key: key, child: child) {
Key key = null,
CupertinoTheme theme = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(theme != null);
this.theme = theme;
}

Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null
) {
_brightness = brightness;
this.brightness = brightness;// ?? Brightness.light;
_defaults = CupertinoThemeDataUtils._kDefaultTheme;
public static CupertinoThemeData raw(
Brightness? brightness = null,
Color primaryColor = null,
Color primaryContrastingColor = null,
CupertinoTextThemeData textTheme = null,
Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null
/*public static CupertinoThemeData raw(
Brightness brightness ,
Color primaryColor ,
Color primaryContrastingColor ,
CupertinoTextThemeData textTheme,
Color barBackgroundColor ,
Color scaffoldBackgroundColor
D.assert(brightness != null);
/* D.assert(brightness != null);
D.assert(primaryColor != null);
D.assert(primaryContrastingColor != null);
D.assert(textTheme != null);

textTheme: textTheme,
barBackgroundColor: barBackgroundColor,
scaffoldBackgroundColor: scaffoldBackgroundColor
);
}
);*/
/*return _rawWithDefaults(
brightness,
primaryColor,
primaryContrastingColor,
textTheme,
barBackgroundColor,
scaffoldBackgroundColor,
_kDefaultTheme
);
}*/
bool _isLight {
get { return brightness == Brightness.light; }
public static CupertinoThemeData _rawWithDefaults(
Brightness? brightness,
Color primaryColor,
Color primaryContrastingColor ,
CupertinoTextThemeData textTheme ,
Color barBackgroundColor ,
Color scaffoldBackgroundColor ,
_CupertinoThemeDefaults defaults
) {
var themeData = new CupertinoThemeData(
brightness: brightness,
primaryColor: primaryColor,
primaryContrastingColor: primaryContrastingColor,
textTheme: textTheme,
barBackgroundColor: barBackgroundColor,
scaffoldBackgroundColor: scaffoldBackgroundColor);
themeData._defaults = defaults;
return themeData;
public Brightness brightness {
get { return _brightness ?? Brightness.light; }
}
public _CupertinoThemeDefaults _defaults;
readonly Brightness? _brightness;
public readonly Brightness? brightness;
return _primaryColor ??
(_isLight ? CupertinoColors.activeBlue : CupertinoColors.activeOrange);
return _primaryColor ?? _defaults.primaryColor;
//(_isLight ? CupertinoColors.activeBlue : CupertinoColors.activeOrange);
}
}

get {
return _primaryContrastingColor ??
(_isLight ? CupertinoColors.white : CupertinoColors.black);
return _primaryContrastingColor ?? _defaults.primaryContrastingColor;
//(_isLight ? CupertinoColors.white : CupertinoColors.black);
}
}

get {
return _textTheme ?? new CupertinoTextThemeData(
return _textTheme ?? _defaults.textThemeDefaults.createDefaults(primaryColor: primaryColor);
/*new CupertinoTextThemeData(
);
);*/
}
}

get {
return _barBackgroundColor ??
(_isLight
return _barBackgroundColor ?? _defaults.barBackgroundColor;
/*(_isLight
: CupertinoThemeDataUtils._kDefaultBarDarkBackgroundColor);
: CupertinoThemeDataUtils._kDefaultBarDarkBackgroundColor);*/
}
}

get {
return _scaffoldBackgroundColor ??
(_isLight ? CupertinoColors.white : CupertinoColors.black);
return _scaffoldBackgroundColor ?? _defaults.scaffoldBackgroundColor;
// (_isLight ? CupertinoColors.white : CupertinoColors.black);
}
}

return new _NoDefaultCupertinoThemeData(
_brightness,
brightness,
_primaryColor,
_primaryContrastingColor,
_textTheme,

}
protected CupertinoThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
Color convertColor(Color color) => CupertinoDynamicColor.resolve(color, context, nullOk: nullOk);
return CupertinoThemeData._rawWithDefaults(
brightness,
convertColor(_primaryColor),
convertColor(_primaryContrastingColor),
_textTheme?.resolveFrom(context, nullOk: nullOk),
convertColor(_barBackgroundColor),
convertColor(_scaffoldBackgroundColor),
_defaults.resolveFrom(context, _textTheme == null, nullOk: nullOk)
);
}
public CupertinoThemeData copyWith(
Brightness? brightness = null,
Color primaryColor = null,

Color scaffoldBackgroundColor = null
) {
return new CupertinoThemeData(
brightness: brightness ?? _brightness,
//return new CupertinoThemeData(
return CupertinoThemeData._rawWithDefaults(
brightness: brightness ?? this.brightness,
scaffoldBackgroundColor: scaffoldBackgroundColor ?? _scaffoldBackgroundColor
scaffoldBackgroundColor: scaffoldBackgroundColor ?? _scaffoldBackgroundColor,
_defaults
);
}

properties.add(
new EnumProperty<Brightness>("brightness", brightness, defaultValue: defaultData.brightness));
new EnumProperty<Brightness?>("brightness", brightness, defaultValue: defaultData.brightness));
properties.add(new DiagnosticsProperty<Color>("primaryColor", primaryColor,
defaultValue: defaultData.primaryColor));
properties.add(new DiagnosticsProperty<Color>("primaryContrastingColor", primaryContrastingColor,

defaultValue: defaultData.barBackgroundColor));
properties.add(new DiagnosticsProperty<Color>("scaffoldBackgroundColor", scaffoldBackgroundColor,
defaultValue: defaultData.scaffoldBackgroundColor));
textTheme.debugFillProperties(properties);
}
}

this.textTheme = textTheme;
this.barBackgroundColor = barBackgroundColor;
this.scaffoldBackgroundColor = scaffoldBackgroundColor;
_defaults = null;
}
public new readonly Brightness? brightness;

public new readonly Color barBackgroundColor;
public new readonly Color scaffoldBackgroundColor;
public new _NoDefaultCupertinoThemeData resolveFrom(BuildContext context,bool nullOk = false ) {
Color convertColor(Color color) => CupertinoDynamicColor.resolve(color, context, nullOk: nullOk);
return new _NoDefaultCupertinoThemeData(
brightness,
convertColor(primaryColor),
convertColor(primaryContrastingColor),
textTheme?.resolveFrom(context, nullOk: nullOk),
convertColor(barBackgroundColor),
convertColor(scaffoldBackgroundColor)
);
}
public new CupertinoThemeData copyWith(
Brightness? brightness = null,
Color primaryColor = null,
Color primaryContrastingColor = null,
CupertinoTextThemeData textTheme = null,
Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null
) {
return new _NoDefaultCupertinoThemeData(
brightness ?? this.brightness,
primaryColor ?? this.primaryColor,
primaryContrastingColor ?? this.primaryContrastingColor,
textTheme ?? this.textTheme,
barBackgroundColor ?? this.barBackgroundColor,
scaffoldBackgroundColor ?? this.scaffoldBackgroundColor
);
}
public class _CupertinoThemeDefaults {
public _CupertinoThemeDefaults(
Brightness? brightness = null,
Color primaryColor = null,
Color primaryContrastingColor = null,
Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null,
_CupertinoTextThemeDefaults textThemeDefaults = null
)
{
this.brightness = brightness;
this.primaryColor = primaryColor;
this.primaryContrastingColor = primaryContrastingColor;
this.barBackgroundColor = barBackgroundColor;
this.scaffoldBackgroundColor = scaffoldBackgroundColor;
this.textThemeDefaults = textThemeDefaults;
}
public Brightness? brightness;
public Color primaryColor;
public Color primaryContrastingColor;
public Color barBackgroundColor;
public Color scaffoldBackgroundColor;
public _CupertinoTextThemeDefaults textThemeDefaults;
public _CupertinoThemeDefaults resolveFrom(BuildContext context, bool resolveTextTheme, bool nullOk = false) {
D.assert(nullOk != null);
Color convertColor(Color color) => CupertinoDynamicColor.resolve(color, context, nullOk: nullOk);
return new _CupertinoThemeDefaults(
brightness,
convertColor(primaryColor),
convertColor(primaryContrastingColor),
convertColor(barBackgroundColor),
convertColor(scaffoldBackgroundColor),
resolveTextTheme ? textThemeDefaults?.resolveFrom(context, nullOk: nullOk) : textThemeDefaults
);
}
}
public class _CupertinoTextThemeDefaults {
public _CupertinoTextThemeDefaults(
Color labelColor = null,
Color inactiveGray = null
) {
this.labelColor = labelColor;
this.inactiveGray = inactiveGray;
}
public readonly Color labelColor;
public readonly Color inactiveGray;
public _CupertinoTextThemeDefaults resolveFrom(BuildContext context, bool nullOk = false) {
return new _CupertinoTextThemeDefaults(
CupertinoDynamicColor.resolve(labelColor, context, nullOk: nullOk),
CupertinoDynamicColor.resolve(inactiveGray, context, nullOk: nullOk)
);
}
public CupertinoTextThemeData createDefaults(Color primaryColor = null) {
D.assert(primaryColor != null);
return new _DefaultCupertinoTextThemeData(
primaryColor: primaryColor,
labelColor: labelColor,
inactiveGray: inactiveGray
);
}
}
class _DefaultCupertinoTextThemeData : CupertinoTextThemeData {
public _DefaultCupertinoTextThemeData(
Color labelColor = null,
Color inactiveGray = null,
Color primaryColor = null
) : base(primaryColor: primaryColor) {
D.assert(labelColor != null);
D.assert(inactiveGray != null);
D.assert(primaryColor != null);
this.labelColor = labelColor;
this.inactiveGray = inactiveGray;
}
public readonly Color labelColor;
public readonly Color inactiveGray;
public new TextStyle textStyle {
get {
return base.textStyle.copyWith(color: labelColor);
}
}
public new TextStyle tabLabelTextStyle {
get {
return base.tabLabelTextStyle.copyWith(color: inactiveGray);
}
}
public new TextStyle navTitleTextStyle {
get {
return base.navTitleTextStyle.copyWith(color: labelColor);
}
}
public new TextStyle navLargeTitleTextStyle {
get {
return base.navLargeTitleTextStyle.copyWith(color: labelColor);
}
}
public new TextStyle pickerTextStyle {
get {
return base.pickerTextStyle.copyWith(color: labelColor);
}
}
public new TextStyle dateTimePickerTextStyle {
get {
return base.dateTimePickerTextStyle.copyWith(color: labelColor);
}
}
}
}

2
com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs.meta


fileFormatVersion: 2
guid: aae818985ea0fb942b943da7205b523c
guid: 85a418ac598e2534d8eaa6b8deff74af
MonoImporter:
externalObjects: {}
serializedVersion: 2

2
com.unity.uiwidgets/Runtime/cupertino/colors.cs.meta


fileFormatVersion: 2
guid: cf635163f4e847c4d8189105ba042987
guid: 78e6aef01ceaee54bbcae56c25aa6147
MonoImporter:
externalObjects: {}
serializedVersion: 2

14
com.unity.uiwidgets/Runtime/ui2/geometry.cs


}
public static Offset operator -(Offset a, Offset b) {
if (a == null) {
return new Offset(-b.dx, -b.dy);
}
else if (b == null) {
return new Offset(-a.dx, -a.dy);
}
if (a == null) {
return b;
}
else if (b == null) {
return a;
}
return new Offset(a.dx + b.dx, a.dy + b.dy);
}

30
com.unity.uiwidgets/Runtime/widgets/app.cs


public delegate string GenerateAppTitle(BuildContext context);
public delegate PageRoute PageRouteFactory(RouteSettings settings, WidgetBuilder builder);
public delegate List<Route> InitialRouteListFactory(string initialRoute);
public class WidgetsApp : StatefulWidget {
public readonly TransitionBuilder builder;

public readonly GlobalKey<NavigatorState> navigatorKey;
public readonly List<NavigatorObserver> navigatorObservers;
public readonly RouteFactory onGenerateRoute;
public readonly InitialRouteListFactory onGenerateInitialRoutes;
public readonly RouteFactory onUnknownRoute;
public readonly PageRouteFactory pageRouteBuilder;
public readonly Dictionary<string, WidgetBuilder> routes;

Key key = null,
GlobalKey<NavigatorState> navigatorKey = null,
RouteFactory onGenerateRoute = null,
InitialRouteListFactory onGenerateInitialRoutes = null,
RouteFactory onUnknownRoute = null,
PageRouteFactory pageRouteBuilder = null,
List<NavigatorObserver> navigatorObservers = null,

this.home = home;
this.navigatorKey = navigatorKey;
this.onGenerateRoute = onGenerateRoute;
this.onGenerateInitialRoutes = onGenerateInitialRoutes;
this.onUnknownRoute = onUnknownRoute;
this.pageRouteBuilder = pageRouteBuilder;
this.routes = routes;

this.title = title;
this.color = color;
this.inspectorSelectButtonBuilder = inspectorSelectButtonBuilder;
D.assert(
home == null ||
onGenerateInitialRoutes == null,
() => "If onGenerateInitialRoutes is specifiied, the home argument will be redundant."
);
D.assert(
home == null ||
!this.routes.ContainsKey(Navigator.defaultRouteName),

GlobalKey<NavigatorState> _navigator;
public Future<bool> didPopRoute() {
///async
return navigator.maybePop();
return navigator.maybePop<bool>();
}
public Future<bool> didPushRoute(string route) {

return Future<bool>.value(false).to<bool>();
}
navigator.pushNamed(route);
navigator.pushNamed<bool>(route);
return Future<bool>.value(true).to<bool>();
}

if (_navigator != null) {
navigator = new Navigator(
key: _navigator,
initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,
//initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,
//onGenerateRoute: _onGenerateRoute,
initialRoute: WidgetsBinding.instance.window.defaultRouteName != Navigator.defaultRouteName
? WidgetsBinding.instance.window.defaultRouteName
: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,
onGenerateInitialRoutes:
widget.onGenerateInitialRoutes == null
? Navigator.defaultGenerateInitialRoutes
: (NavigatorState navigator1, string initialRouteName) => {
return widget.onGenerateInitialRoutes(initialRouteName);
},
onUnknownRoute: _onUnknownRoute,
observers: widget.navigatorObservers
);

3
com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs


}
void _updateParentDataOfChild(ParentDataElement childElement) {
childElement.applyWidgetOutOfTurn((ParentDataWidget<SliverWithKeepAliveWidget>) build(context));
//childElement.applyWidgetOutOfTurn((ParentDataWidget<SliverWithKeepAliveWidget>) build(context));
childElement.applyWidgetOutOfTurn((ParentDataWidget)build(context));
}
VoidCallback _createCallback(Listenable handle) {

2
com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs


int itemIndex,
TimeSpan duration,
Curve curve
) {
) {///////
if (!hasClients) {
return null;
}

951
com.unity.uiwidgets/Runtime/widgets/navigator.cs
文件差异内容过多而无法显示
查看文件

41
com.unity.uiwidgets/Runtime/widgets/routes.cs


RouteSettings settings = null
) : base(settings) {
}
public override List<OverlayEntry> overlayEntries {
get { return _overlayEntries; }
}

}
}
public class _ModalScope : StatefulWidget {
public _ModalScope(Key key = null, ModalRoute route = null) : base(key) {
public class _ModalScope<T> : StatefulWidget {
public _ModalScope(Key key = null, ModalRoute<T> route = null) : base(key) {
public readonly ModalRoute route;
public readonly ModalRoute<T> route;
return new _ModalScopeState();
return new _ModalScopeState<T>();
public class _ModalScopeState : State<_ModalScope> {
public class _ModalScopeState<T> : State<_ModalScope<T>> {
//public readonly FocusScopeNode focusScopeNode = new FocusScopeNode(debugLabel: "$_ModalScopeState Focus Scope");
public override void initState() {
base.initState();
var animations = new List<Listenable> { };

public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
D.assert(widget.route == ((_ModalScope) oldWidget).route);
D.assert(widget.route == ((_ModalScope<T>) oldWidget).route);
/*if (widget.route.isCurrent) {
widget.route.navigator.focusScopeNode.setFirstFocus(focusScopeNode);
}*/
}
public override void didChangeDependencies() {

}
}
public abstract class ModalRoute : LocalHistoryRouteTransitionRoute {
public abstract class ModalRoute<T> : LocalHistoryRouteTransitionRoute {
protected ModalRoute() {
}

public static Color _kTransparent = new Color(0x00000000);
public static ModalRoute of(BuildContext context) {
public static ModalRoute<T> of(BuildContext context) {
return (ModalRoute) widget?.route;
return (ModalRoute<T>) widget?.route;
}
protected virtual void setState(VoidCallback fn) {

readonly List<WillPopCallback> _willPopCallbacks = new List<WillPopCallback>();
public override Future<RoutePopDisposition> willPop() {
_ModalScopeState scope = _scopeKey.currentState;
_ModalScopeState<T> scope = _scopeKey.currentState as _ModalScopeState<T> ;
D.assert(scope != null);
bool result = false;

}
readonly GlobalKey<_ModalScopeState> _scopeKey = new LabeledGlobalKey<_ModalScopeState>();
internal readonly GlobalKey _subtreeKey = new LabeledGlobalKey<_ModalScopeState>();
readonly GlobalKey<_ModalScopeState<T>> _scopeKey = new LabeledGlobalKey<_ModalScopeState<T>>();
internal readonly GlobalKey _subtreeKey = new LabeledGlobalKey<T>();
internal readonly PageStorageBucket _storageBucket = new PageStorageBucket();
static readonly Animatable<float> _easeCurveTween = new CurveTween(curve: Curves.ease);

Widget _modalScopeCache;
Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope(
return _modalScopeCache = _modalScopeCache ?? new _ModalScope<T>(
key: _scopeKey,
route: this
// _ModalScope calls buildTransitions() and buildChild(), defined above

}
}
public abstract class PopupRoute : ModalRoute {
public abstract class PopupRoute<T> : ModalRoute<T> {
protected PopupRoute(
RouteSettings settings = null
) : base(settings: settings) {

void didPushNext();
}
class _DialogRoute : PopupRoute {
class _DialogRoute<T> : PopupRoute<T> {
internal _DialogRoute(RoutePageBuilder pageBuilder = null, bool barrierDismissible = true,
Color barrierColor = null,
TimeSpan? transitionDuration = null,

}
public static class DialogUtils {
public static Future<object> showGeneralDialog(
public static Future<T> showGeneralDialog<T>(
BuildContext context = null,
RoutePageBuilder pageBuilder = null,
bool barrierDismissible = false,

) {
D.assert(pageBuilder != null);
return Navigator.of(context, rootNavigator: true).push(new _DialogRoute(
return Navigator.of(context, rootNavigator: true).push<T>(new _DialogRoute(
)).to<object>();
)); //.to<object>();
}
}

233
com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.cupertino {
class BottomAppBarUtils {
public const float _kTabBarHeight = 50.0f;
public static readonly Color _kDefaultTabBarBorderColor =
CupertinoDynamicColor.withBrightness(
color: new Color(0x4C000000),
darkColor: new Color(0x29000000)
);
public static readonly Color _kDefaultTabBarInactiveColor = CupertinoColors.inactiveGray;
}
public class CupertinoTabBar : StatelessWidget{
public CupertinoTabBar(
Key key = null,
List<BottomNavigationBarItem> items = null,
ValueChanged<int> onTap = null,
int currentIndex = 0,
Color backgroundColor = null,
Color activeColor = null,
Color inactiveColor = null,
float iconSize = 30.0f,
Border border = null
) : base(key: key) {
D.assert(items != null);
D.assert(items.Count >= 2,
() => "Tabs need at least 2 items to conform to Apple's HIG"
);
D.assert(0 <= currentIndex && currentIndex < items.Count);
this.items = items;
this.onTap = onTap;
this.currentIndex = currentIndex;
this.backgroundColor = backgroundColor;
this.activeColor = activeColor;
this.inactiveColor = inactiveColor ?? BottomAppBarUtils._kDefaultTabBarInactiveColor;
this.iconSize = iconSize;
this.border = border ?? new Border(
top: new BorderSide(
color: BottomAppBarUtils._kDefaultTabBarBorderColor,
width: 0.0f, // One physical pixel.
style: BorderStyle.solid
)
);
}
public readonly List<BottomNavigationBarItem> items;
public readonly ValueChanged<int> onTap;
public readonly int currentIndex;
public readonly Color backgroundColor;
public readonly Color activeColor;
public readonly Color inactiveColor;
public readonly float iconSize;
public readonly Border border;
public Size preferredSize {
get { return Size.fromHeight(BottomAppBarUtils._kTabBarHeight); }
}
public bool opaque(BuildContext context) {
Color backgroundColor =
this.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor;
return CupertinoDynamicColor.resolve(backgroundColor, context).alpha == 0xFF;
}
public override Widget build(BuildContext context) {
float bottomPadding = MediaQuery.of(context).padding.bottom;
Color backgroundColor = CupertinoDynamicColor.resolve(
this.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor,
context
);
BorderSide resolveBorderSide(BorderSide side) {
return side == BorderSide.none
? side
: side.copyWith(color: CupertinoDynamicColor.resolve(side.color, context));
}
Border resolvedBorder = border == null || border.GetType() != typeof(Border)
? border
: new Border(
top: resolveBorderSide(border.top),
left: resolveBorderSide(border.left),
bottom: resolveBorderSide(border.bottom),
right: resolveBorderSide(border.right)
);
Color inactive = CupertinoDynamicColor.resolve(inactiveColor, context);
Widget result = new DecoratedBox(
decoration: new BoxDecoration(
border: resolvedBorder,//border,
color: backgroundColor //?? CupertinoTheme.of(context).barBackgroundColor
),
child: new SizedBox(
height: BottomAppBarUtils._kTabBarHeight + bottomPadding,
child: IconTheme.merge( // Default with the inactive state.
data: new IconThemeData(
color: inactiveColor,
size: iconSize
),
child: new DefaultTextStyle( // Default with the inactive state.
style: CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith(color: inactive),
//CupertinoTheme.of(context).textTheme.tabLabelTextStyle
child: new Padding(
padding: EdgeInsets.only(bottom: bottomPadding),
child: new Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: _buildTabItems(context)
)
)
)
)
)
);
if (!opaque(context)) {
result = new ClipRect(
child: new BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0f, sigmaY: 10.0f),
child: result
)
);
}
return result;
}
List<Widget> _buildTabItems(BuildContext context) {
List<Widget> result = new List<Widget> { };
for (int index = 0; index < items.Count; index += 1) {
bool active = index == currentIndex;
var tabIndex = index;
result.Add(
_wrapActiveItem(
context,
new Expanded(
//// ??? semantics tbc ???
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onTap == null ? null : (GestureTapCallback) (() => { onTap(tabIndex); }),
child: new Padding(
padding: EdgeInsets.only(bottom: 4.0f),
child: new Column(
mainAxisAlignment: MainAxisAlignment.end,
children: _buildSingleTabItem(items[index], active)
)
)
)
),
active: active
)
);
}
return result;
}
List<Widget> _buildSingleTabItem(BottomNavigationBarItem item, bool active) {
List<Widget> components = new List<Widget> {
new Expanded(
child: new Center(child: active ? item.activeIcon : item.icon)
)
};
if (item.title != null) {
components.Add(item.title);
}
return components;
}
Widget _wrapActiveItem(BuildContext context, Widget item, bool active) {
if (!active) {
return item;
}
//Color activeColor = this.activeColor ?? CupertinoTheme.of(context).primaryColor;
Color activeColor = CupertinoDynamicColor.resolve(
this.activeColor ?? CupertinoTheme.of(context).primaryColor,
context
);
return IconTheme.merge(
data: new IconThemeData(color: activeColor),
child: DefaultTextStyle.merge(
style: new TextStyle(color: activeColor),
child: item
)
);
}
public CupertinoTabBar copyWith(
Key key = null,
List<BottomNavigationBarItem> items = null,
Color backgroundColor = null,
Color activeColor = null,
Color inactiveColor = null,
float? iconSize = null,
Border border = null,
int? currentIndex = null,
ValueChanged<int> onTap = null
) {
return new CupertinoTabBar(
key: key ?? this.key,
items: items ?? this.items,
backgroundColor: backgroundColor ?? this.backgroundColor,
activeColor: activeColor ?? this.activeColor,
inactiveColor: inactiveColor ?? this.inactiveColor,
iconSize: iconSize ?? this.iconSize,
border: border ?? this.border,
currentIndex: currentIndex ?? this.currentIndex,
onTap: onTap ?? this.onTap
);
}
}
}

763
com.unity.uiwidgets/Runtime/cupertino/colors.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
using Unity.UIWidgets.painting;
namespace Unity.UIWidgets.cupertino {
public class CupertinoColors {
public static CupertinoDynamicColor activeBlue = systemBlue;
public static CupertinoDynamicColor activeGreen = systemGreen;
public static CupertinoDynamicColor activeOrange = systemOrange;
public static Color white = new Color(0xFFFFFFFF);
public static Color black = new Color(0xFF000000);
public static Color lightBackgroundGray = new Color(0xFFE5E5EA);
public static Color extraLightBackgroundGray = new Color(0xFFEFEFF4);
public static Color darkBackgroundGray = new Color(0xFF171717);
public static CupertinoDynamicColor inactiveGray = CupertinoDynamicColor.withBrightness(
debugLabel: "inactiveGray",
color: new Color(0xFF999999),
darkColor: new Color(0xFF757575)
);
public static CupertinoDynamicColor destructiveRed = systemRed;
public static CupertinoDynamicColor systemBlue = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemBlue",
color: Color.fromARGB(255, 0, 122, 255),
darkColor: Color.fromARGB(255, 10, 132, 255),
highContrastColor: Color.fromARGB(255, 0, 64, 221),
darkHighContrastColor: Color.fromARGB(255, 64, 156, 255)
);
public static CupertinoDynamicColor systemGreen = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGreen",
color: Color.fromARGB(255, 52, 199, 89),
darkColor: Color.fromARGB(255, 48, 209, 88),
highContrastColor: Color.fromARGB(255, 36, 138, 61),
darkHighContrastColor: Color.fromARGB(255, 48, 219, 91)
);
public static CupertinoDynamicColor systemIndigo = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemIndigo",
color: Color.fromARGB(255, 88, 86, 214),
darkColor: Color.fromARGB(255, 94, 92, 230),
highContrastColor: Color.fromARGB(255, 54, 52, 163),
darkHighContrastColor: Color.fromARGB(255, 125, 122, 255)
);
public static CupertinoDynamicColor systemOrange = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemOrange",
color: Color.fromARGB(255, 255, 149, 0),
darkColor: Color.fromARGB(255, 255, 159, 10),
highContrastColor: Color.fromARGB(255, 201, 52, 0),
darkHighContrastColor: Color.fromARGB(255, 255, 179, 64)
);
public static CupertinoDynamicColor systemPink = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemPink",
color: Color.fromARGB(255, 255, 45, 85),
darkColor: Color.fromARGB(255, 255, 55, 95),
highContrastColor: Color.fromARGB(255, 211, 15, 69),
darkHighContrastColor: Color.fromARGB(255, 255, 100, 130)
);
public static CupertinoDynamicColor systemPurple = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemPurple",
color: Color.fromARGB(255, 175, 82, 222),
darkColor: Color.fromARGB(255, 191, 90, 242),
highContrastColor: Color.fromARGB(255, 137, 68, 171),
darkHighContrastColor: Color.fromARGB(255, 218, 143, 255)
);
public static CupertinoDynamicColor systemRed = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemRed",
color: Color.fromARGB(255, 255, 59, 48),
darkColor: Color.fromARGB(255, 255, 69, 58),
highContrastColor: Color.fromARGB(255, 215, 0, 21),
darkHighContrastColor: Color.fromARGB(255, 255, 105, 97)
);
public static CupertinoDynamicColor systemTeal = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemTeal",
color: Color.fromARGB(255, 90, 200, 250),
darkColor: Color.fromARGB(255, 100, 210, 255),
highContrastColor: Color.fromARGB(255, 0, 113, 164),
darkHighContrastColor: Color.fromARGB(255, 112, 215, 255)
);
public static CupertinoDynamicColor systemYellow = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemYellow",
color: Color.fromARGB(255, 255, 204, 0),
darkColor: Color.fromARGB(255, 255, 214, 10),
highContrastColor: Color.fromARGB(255, 160, 90, 0),
darkHighContrastColor: Color.fromARGB(255, 255, 212, 38)
);
public static CupertinoDynamicColor systemGrey = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey",
color: Color.fromARGB(255, 142, 142, 147),
darkColor: Color.fromARGB(255, 142, 142, 147),
highContrastColor: Color.fromARGB(255, 108, 108, 112),
darkHighContrastColor: Color.fromARGB(255, 174, 174, 178)
);
public static CupertinoDynamicColor systemGrey2 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey2",
color: Color.fromARGB(255, 174, 174, 178),
darkColor: Color.fromARGB(255, 99, 99, 102),
highContrastColor: Color.fromARGB(255, 142, 142, 147),
darkHighContrastColor: Color.fromARGB(255, 124, 124, 128)
);
public static CupertinoDynamicColor systemGrey3 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey3",
color: Color.fromARGB(255, 199, 199, 204),
darkColor: Color.fromARGB(255, 72, 72, 74),
highContrastColor: Color.fromARGB(255, 174, 174, 178),
darkHighContrastColor: Color.fromARGB(255, 84, 84, 86)
);
public static CupertinoDynamicColor systemGrey4 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey4",
color: Color.fromARGB(255, 209, 209, 214),
darkColor: Color.fromARGB(255, 58, 58, 60),
highContrastColor: Color.fromARGB(255, 188, 188, 192),
darkHighContrastColor: Color.fromARGB(255, 68, 68, 70)
);
public static CupertinoDynamicColor systemGrey5 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey5",
color: Color.fromARGB(255, 229, 229, 234),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 216, 216, 220),
darkHighContrastColor: Color.fromARGB(255, 54, 54, 56)
);
public static CupertinoDynamicColor systemGrey6 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey6",
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastColor: Color.fromARGB(255, 36, 36, 38)
);
public static CupertinoDynamicColor label = new CupertinoDynamicColor(
debugLabel: "label",
color: Color.fromARGB(255, 0, 0, 0),
darkColor: Color.fromARGB(255, 255, 255, 255),
highContrastColor: Color.fromARGB(255, 0, 0, 0),
darkHighContrastColor: Color.fromARGB(255, 255, 255, 255),
elevatedColor: Color.fromARGB(255, 0, 0, 0),
darkElevatedColor: Color.fromARGB(255, 255, 255, 255),
highContrastElevatedColor: Color.fromARGB(255, 0, 0, 0),
darkHighContrastElevatedColor: Color.fromARGB(255, 255, 255, 255)
);
public static CupertinoDynamicColor secondaryLabel = new CupertinoDynamicColor(
debugLabel: "secondaryLabel",
color: Color.fromARGB(153, 60, 60, 67),
darkColor: Color.fromARGB(153, 235, 235, 245),
highContrastColor: Color.fromARGB(173, 60, 60, 67),
darkHighContrastColor: Color.fromARGB(173, 235, 235, 245),
elevatedColor: Color.fromARGB(153, 60, 60, 67),
darkElevatedColor: Color.fromARGB(153, 235, 235, 245),
highContrastElevatedColor: Color.fromARGB(173, 60, 60, 67),
darkHighContrastElevatedColor: Color.fromARGB(173, 235, 235, 245)
);
/// The color for text labels containing tertiary content, equivalent to
/// [UIColor.tertiaryLabel](https://developer.apple.com/documentation/uikit/uicolor/3173153-tertiarylabel).
public static CupertinoDynamicColor tertiaryLabel = new CupertinoDynamicColor(
debugLabel: "tertiaryLabel",
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),
darkHighContrastColor: Color.fromARGB(96, 235, 235, 245),
elevatedColor: Color.fromARGB(76, 60, 60, 67),
darkElevatedColor: Color.fromARGB(76, 235, 235, 245),
highContrastElevatedColor: Color.fromARGB(96, 60, 60, 67),
darkHighContrastElevatedColor: Color.fromARGB(96, 235, 235, 245)
);
public static CupertinoDynamicColor quaternaryLabel = new CupertinoDynamicColor(
debugLabel: "quaternaryLabel",
color: Color.fromARGB(45, 60, 60, 67),
darkColor: Color.fromARGB(40, 235, 235, 245),
highContrastColor: Color.fromARGB(66, 60, 60, 67),
darkHighContrastColor: Color.fromARGB(61, 235, 235, 245),
elevatedColor: Color.fromARGB(45, 60, 60, 67),
darkElevatedColor: Color.fromARGB(40, 235, 235, 245),
highContrastElevatedColor: Color.fromARGB(66, 60, 60, 67),
darkHighContrastElevatedColor: Color.fromARGB(61, 235, 235, 245)
);
public static CupertinoDynamicColor systemFill = new CupertinoDynamicColor(
debugLabel: "systemFill",
color: Color.fromARGB(51, 120, 120, 128),
darkColor: Color.fromARGB(91, 120, 120, 128),
highContrastColor: Color.fromARGB(71, 120, 120, 128),
darkHighContrastColor: Color.fromARGB(112, 120, 120, 128),
elevatedColor: Color.fromARGB(51, 120, 120, 128),
darkElevatedColor: Color.fromARGB(91, 120, 120, 128),
highContrastElevatedColor: Color.fromARGB(71, 120, 120, 128),
darkHighContrastElevatedColor: Color.fromARGB(112, 120, 120, 128)
);
public static CupertinoDynamicColor secondarySystemFill = new CupertinoDynamicColor(
debugLabel: "secondarySystemFill",
color: Color.fromARGB(40, 120, 120, 128),
darkColor: Color.fromARGB(81, 120, 120, 128),
highContrastColor: Color.fromARGB(61, 120, 120, 128),
darkHighContrastColor: Color.fromARGB(102, 120, 120, 128),
elevatedColor: Color.fromARGB(40, 120, 120, 128),
darkElevatedColor: Color.fromARGB(81, 120, 120, 128),
highContrastElevatedColor: Color.fromARGB(61, 120, 120, 128),
darkHighContrastElevatedColor: Color.fromARGB(102, 120, 120, 128)
);
public static CupertinoDynamicColor tertiarySystemFill = new CupertinoDynamicColor(
debugLabel: "tertiarySystemFill",
color: Color.fromARGB(30, 118, 118, 128),
darkColor: Color.fromARGB(61, 118, 118, 128),
highContrastColor: Color.fromARGB(51, 118, 118, 128),
darkHighContrastColor: Color.fromARGB(81, 118, 118, 128),
elevatedColor: Color.fromARGB(30, 118, 118, 128),
darkElevatedColor: Color.fromARGB(61, 118, 118, 128),
highContrastElevatedColor: Color.fromARGB(51, 118, 118, 128),
darkHighContrastElevatedColor: Color.fromARGB(81, 118, 118, 128)
);
public static CupertinoDynamicColor quaternarySystemFill = new CupertinoDynamicColor(
debugLabel: "quaternarySystemFill",
color: Color.fromARGB(20, 116, 116, 128),
darkColor: Color.fromARGB(45, 118, 118, 128),
highContrastColor: Color.fromARGB(40, 116, 116, 128),
darkHighContrastColor: Color.fromARGB(66, 118, 118, 128),
elevatedColor: Color.fromARGB(20, 116, 116, 128),
darkElevatedColor: Color.fromARGB(45, 118, 118, 128),
highContrastElevatedColor: Color.fromARGB(40, 116, 116, 128),
darkHighContrastElevatedColor: Color.fromARGB(66, 118, 118, 128)
);
/// The color for placeholder text in controls or text views, equivalent to
/// [UIColor.placeholderText](https://developer.apple.com/documentation/uikit/uicolor/3173134-placeholdertext).
public static CupertinoDynamicColor placeholderText = new CupertinoDynamicColor(
debugLabel: "placeholderText",
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),
darkHighContrastColor: Color.fromARGB(96, 235, 235, 245),
elevatedColor: Color.fromARGB(76, 60, 60, 67),
darkElevatedColor: Color.fromARGB(76, 235, 235, 245),
highContrastElevatedColor: Color.fromARGB(96, 60, 60, 67),
darkHighContrastElevatedColor: Color.fromARGB(96, 235, 235, 245)
);
public static CupertinoDynamicColor systemBackground = new CupertinoDynamicColor(
debugLabel: "systemBackground",
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastColor: Color.fromARGB(255, 0, 0, 0),
elevatedColor: Color.fromARGB(255, 255, 255, 255),
darkElevatedColor: Color.fromARGB(255, 28, 28, 30),
highContrastElevatedColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastElevatedColor: Color.fromARGB(255, 36, 36, 38)
);
public static CupertinoDynamicColor secondarySystemBackground = new CupertinoDynamicColor(
debugLabel: "secondarySystemBackground",
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastColor: Color.fromARGB(255, 36, 36, 38),
elevatedColor: Color.fromARGB(255, 242, 242, 247),
darkElevatedColor: Color.fromARGB(255, 44, 44, 46),
highContrastElevatedColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastElevatedColor: Color.fromARGB(255, 54, 54, 56)
);
public static CupertinoDynamicColor tertiarySystemBackground = new CupertinoDynamicColor(
debugLabel: "tertiarySystemBackground",
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastColor: Color.fromARGB(255, 54, 54, 56),
elevatedColor: Color.fromARGB(255, 255, 255, 255),
darkElevatedColor: Color.fromARGB(255, 58, 58, 60),
highContrastElevatedColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastElevatedColor: Color.fromARGB(255, 68, 68, 70)
);
public static CupertinoDynamicColor systemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "systemGroupedBackground",
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastColor: Color.fromARGB(255, 0, 0, 0),
elevatedColor: Color.fromARGB(255, 242, 242, 247),
darkElevatedColor: Color.fromARGB(255, 28, 28, 30),
highContrastElevatedColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastElevatedColor: Color.fromARGB(255, 36, 36, 38)
);
public static CupertinoDynamicColor secondarySystemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "secondarySystemGroupedBackground",
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastColor: Color.fromARGB(255, 36, 36, 38),
elevatedColor: Color.fromARGB(255, 255, 255, 255),
darkElevatedColor: Color.fromARGB(255, 44, 44, 46),
highContrastElevatedColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastElevatedColor: Color.fromARGB(255, 54, 54, 56)
);
public static CupertinoDynamicColor tertiarySystemGroupedBackground = new CupertinoDynamicColor(
debugLabel: "tertiarySystemGroupedBackground",
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastColor: Color.fromARGB(255, 54, 54, 56),
elevatedColor: Color.fromARGB(255, 242, 242, 247),
darkElevatedColor: Color.fromARGB(255, 58, 58, 60),
highContrastElevatedColor: Color.fromARGB(255, 235, 235, 240),
darkHighContrastElevatedColor: Color.fromARGB(255, 68, 68, 70)
);
public static CupertinoDynamicColor separator = new CupertinoDynamicColor(
debugLabel: "separator",
color: Color.fromARGB(73, 60, 60, 67),
darkColor: Color.fromARGB(153, 84, 84, 88),
highContrastColor: Color.fromARGB(94, 60, 60, 67),
darkHighContrastColor: Color.fromARGB(173, 84, 84, 88),
elevatedColor: Color.fromARGB(73, 60, 60, 67),
darkElevatedColor: Color.fromARGB(153, 84, 84, 88),
highContrastElevatedColor: Color.fromARGB(94, 60, 60, 67),
darkHighContrastElevatedColor: Color.fromARGB(173, 84, 84, 88)
);
/// The color for borders or divider lines that hide any underlying content,
/// equivalent to [UIColor.opaqueSeparator](https://developer.apple.com/documentation/uikit/uicolor/3173133-opaqueseparator).
public static CupertinoDynamicColor opaqueSeparator = new CupertinoDynamicColor(
debugLabel: "opaqueSeparator",
color: Color.fromARGB(255, 198, 198, 200),
darkColor: Color.fromARGB(255, 56, 56, 58),
highContrastColor: Color.fromARGB(255, 198, 198, 200),
darkHighContrastColor: Color.fromARGB(255, 56, 56, 58),
elevatedColor: Color.fromARGB(255, 198, 198, 200),
darkElevatedColor: Color.fromARGB(255, 56, 56, 58),
highContrastElevatedColor: Color.fromARGB(255, 198, 198, 200),
darkHighContrastElevatedColor: Color.fromARGB(255, 56, 56, 58)
);
public static CupertinoDynamicColor link =
new CupertinoDynamicColor(
debugLabel: "link",
color: Color.fromARGB(255, 0, 122, 255),
darkColor: Color.fromARGB(255, 9, 132, 255),
highContrastColor: Color.fromARGB(255, 0, 122, 255),
darkHighContrastColor: Color.fromARGB(255, 9, 132, 255),
elevatedColor: Color.fromARGB(255, 0, 122, 255),
darkElevatedColor: Color.fromARGB(255, 9, 132, 255),
highContrastElevatedColor: Color.fromARGB(255, 0, 122, 255),
darkHighContrastElevatedColor: Color.fromARGB(255, 9, 132, 255)
);
}
public class CupertinoDynamicColor : Color, Diagnosticable {
public CupertinoDynamicColor(
string debugLabel = null,
Color color = null,
Color darkColor = null,
Color highContrastColor = null,
Color darkHighContrastColor = null,
Color elevatedColor = null,
Color darkElevatedColor = null,
Color highContrastElevatedColor = null,
Color darkHighContrastElevatedColor = null
) : base(0) {
/// ._
D.assert(color != null);
D.assert(darkColor != null);
D.assert(highContrastColor != null);
D.assert(darkHighContrastColor != null);
D.assert(elevatedColor != null);
D.assert(darkElevatedColor != null);
D.assert(highContrastElevatedColor != null);
D.assert(darkHighContrastElevatedColor != null);
D.assert(_effectiveColor != null);
_effectiveColor = color;
this.color = color;
this.darkColor = darkColor;
this.highContrastColor = highContrastColor;
this.darkHighContrastColor = darkHighContrastColor;
this.elevatedColor = elevatedColor;
this.darkElevatedColor = darkElevatedColor;
this.highContrastElevatedColor = highContrastElevatedColor;
this.darkHighContrastElevatedColor = darkHighContrastElevatedColor;
_debugResolveContext = null;
_debugLabel = debugLabel;
}
public static CupertinoDynamicColor create(
Color _effectiveColor,
Color color,
Color darkColor ,
Color highContrastColor ,
Color darkHighContrastColor ,
Color elevatedColor ,
Color darkElevatedColor ,
Color highContrastElevatedColor ,
Color darkHighContrastElevatedColor ,
Element _debugResolveContext ,
string _debugLabel
) {
var dynamicColor = new CupertinoDynamicColor(
debugLabel: _debugLabel,
color: color,
darkColor: darkColor,
highContrastColor: color,
darkHighContrastColor: darkColor,
elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: color,
darkHighContrastElevatedColor: darkColor
);
dynamicColor._effectiveColor = _effectiveColor;
dynamicColor._debugResolveContext = _debugResolveContext;
return dynamicColor;
}
public static CupertinoDynamicColor withBrightnessAndContrast(
string debugLabel = null,
Color color = null,
Color darkColor = null,
Color highContrastColor = null,
Color darkHighContrastColor = null
) {
return new CupertinoDynamicColor(
debugLabel: debugLabel,
color: color,
darkColor: darkColor,
highContrastColor: highContrastColor,
darkHighContrastColor: darkHighContrastColor,
elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: highContrastColor,
darkHighContrastElevatedColor: darkHighContrastColor
);
}
public static CupertinoDynamicColor withBrightness(
string debugLabel = null,
Color color = null,
Color darkColor = null
) {
return new CupertinoDynamicColor(
debugLabel: debugLabel,
color: color,
darkColor: darkColor,
highContrastColor: color,
darkHighContrastColor: darkColor,
elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: color,
darkHighContrastElevatedColor: darkColor);
}
public Color _effectiveColor;
public int value {
get { return (int) _effectiveColor.value; }
}
public readonly string _debugLabel;
public Element _debugResolveContext;
public readonly Color color;
public readonly Color darkColor;
public readonly Color highContrastColor;
public readonly Color darkHighContrastColor;
public readonly Color elevatedColor;
public readonly Color darkElevatedColor;
public readonly Color highContrastElevatedColor;
public readonly Color darkHighContrastElevatedColor;
public static Color resolve(Color resolvable, BuildContext context, bool nullOk = true) {
if (resolvable == null)
return null;
D.assert(context != null);
return (resolvable is CupertinoDynamicColor)
? ((CupertinoDynamicColor) resolvable).resolveFrom(context, nullOk: nullOk)
: resolvable;
}
public bool _isPlatformBrightnessDependent {
get {
return color != darkColor
|| elevatedColor != darkElevatedColor
|| highContrastColor != darkHighContrastColor
|| highContrastElevatedColor != darkHighContrastElevatedColor;
}
}
public bool _isHighContrastDependent {
get {
return color != highContrastColor
|| darkColor != darkHighContrastColor
|| elevatedColor != highContrastElevatedColor
|| darkElevatedColor != darkHighContrastElevatedColor;
}
}
public bool _isInterfaceElevationDependent {
get {
return color != elevatedColor
|| darkColor != darkElevatedColor
|| highContrastColor != highContrastElevatedColor
|| darkHighContrastColor != darkHighContrastElevatedColor;
}
}
public CupertinoDynamicColor resolveFrom(BuildContext context, bool nullOk = true) {
Brightness brightness = _isPlatformBrightnessDependent
? CupertinoTheme.brightnessOf(context, nullOk: nullOk) ?? Brightness.light
: Brightness.light;
bool isHighContrastEnabled = _isHighContrastDependent
&& (MediaQuery.of(context, nullOk: nullOk)?.highContrast ?? false);
CupertinoUserInterfaceLevelData? CupertinoUserInterfacelevel =
CupertinoUserInterfaceLevel.of(context, nullOk: nullOk);
CupertinoUserInterfaceLevelData level = _isInterfaceElevationDependent
? CupertinoUserInterfacelevel ?? CupertinoUserInterfaceLevelData.baselayer
: CupertinoUserInterfaceLevelData.baselayer;
Color resolved = null;
switch (brightness) {
case Brightness.light:
switch (level) {
case CupertinoUserInterfaceLevelData.baselayer:
resolved = isHighContrastEnabled ? highContrastColor : color;
break;
case CupertinoUserInterfaceLevelData.elevatedlayer:
resolved = isHighContrastEnabled ? highContrastElevatedColor : elevatedColor;
break;
}
break;
case Brightness.dark:
switch (level) {
case CupertinoUserInterfaceLevelData.baselayer:
resolved = isHighContrastEnabled ? darkHighContrastColor : darkColor;
break;
case CupertinoUserInterfaceLevelData.elevatedlayer:
resolved = isHighContrastEnabled ? darkHighContrastElevatedColor : darkElevatedColor;
break;
}
break;
}
Element _debugContext = null;
D.assert(() => {
_debugContext = context as Element;
return true;
}
);
return create(
resolved,
color,
darkColor,
highContrastColor,
darkHighContrastColor,
elevatedColor,
darkElevatedColor,
highContrastElevatedColor,
darkHighContrastElevatedColor,
_debugContext,
_debugLabel
);
}
public bool Equals(CupertinoDynamicColor other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return Equals(value, other.value) && Equals(darkColor, other.darkColor) &&
Equals(highContrastColor, other.highContrastColor)
&& Equals(darkHighContrastColor, other.darkHighContrastColor)
&& Equals(elevatedColor, other.elevatedColor)
&& Equals(darkElevatedColor, other.darkElevatedColor)
&& Equals(highContrastElevatedColor, other.highContrastElevatedColor)
&& Equals(darkHighContrastElevatedColor, other.darkHighContrastElevatedColor);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != GetType()) {
return false;
}
return Equals((CupertinoDynamicColor) obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = (value != null ? value.GetHashCode() : 0);
hashCode = (color != null ? color.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (darkColor != null ? darkColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (highContrastColor != null ? highContrastColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (elevatedColor != null ? elevatedColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (darkElevatedColor != null ? darkElevatedColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (darkHighContrastColor != null ? darkHighContrastColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (darkHighContrastElevatedColor != null
? darkHighContrastElevatedColor.GetHashCode()
: 0);
hashCode = (hashCode * 397) ^
(highContrastElevatedColor != null ? highContrastElevatedColor.GetHashCode() : 0);
return hashCode;
}
}
public static bool operator ==(CupertinoDynamicColor left, CupertinoDynamicColor right) {
return Equals(left, right);
}
public static bool operator !=(CupertinoDynamicColor left, CupertinoDynamicColor right) {
return !Equals(left, right);
}
public override string ToString() {
return toString();
}
public string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug) {
List<string> xs = new List<string>();
xs.Add(toStringColor("color",color));
if (_isPlatformBrightnessDependent)
xs.Add(toStringColor("darkColor", darkColor));
if (_isHighContrastDependent)
xs.Add( toStringColor("highContrastColor", highContrastColor));
if (_isPlatformBrightnessDependent && _isHighContrastDependent)
xs.Add(toStringColor("darkHighContrastColor", darkHighContrastColor));
if (_isInterfaceElevationDependent)
xs.Add( toStringColor("elevatedColor", elevatedColor));
if (_isPlatformBrightnessDependent && _isInterfaceElevationDependent)
xs.Add(toStringColor("darkElevatedColor", darkElevatedColor));
if (_isHighContrastDependent && _isInterfaceElevationDependent)
xs.Add(toStringColor("highContrastElevatedColor", highContrastElevatedColor));
if (_isPlatformBrightnessDependent && _isHighContrastDependent && _isInterfaceElevationDependent)
xs.Add(toStringColor("darkHighContrastElevatedColor", darkHighContrastElevatedColor));
string xsStr = "";
foreach (var xss in xs) {
xsStr += xss;
}
var debugContext = _debugResolveContext?.widget;
if (_debugResolveContext?.widget == null) {
return $"[{_debugLabel ?? GetType().ToString()}({xsStr}, resolved by: UNRESOLVED)]";
}
else {
return $"[{_debugLabel ?? GetType().ToString()}({xsStr}, resolved by: {_debugResolveContext?.widget })]";
}
}
public string toStringColor(string name, Color color) {
string marker = color == _effectiveColor ? "*" : "";
return marker + name + " = " + color.ToString() + marker;
}
public new void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
if (_debugLabel != null)
properties.add(new MessageProperty("debugLabel", _debugLabel));
properties.add(createCupertinoColorProperty("color", color));
if (_isPlatformBrightnessDependent)
properties.add(createCupertinoColorProperty("darkColor", darkColor));
if (_isHighContrastDependent)
properties.add(createCupertinoColorProperty("highContrastColor", highContrastColor));
if (_isPlatformBrightnessDependent && _isHighContrastDependent)
properties.add(createCupertinoColorProperty("darkHighContrastColor", darkHighContrastColor));
if (_isInterfaceElevationDependent)
properties.add(createCupertinoColorProperty("elevatedColor", elevatedColor));
if (_isPlatformBrightnessDependent && _isInterfaceElevationDependent)
properties.add(createCupertinoColorProperty("darkElevatedColor", darkElevatedColor));
if (_isHighContrastDependent && _isInterfaceElevationDependent)
properties.add(createCupertinoColorProperty("highContrastElevatedColor", highContrastElevatedColor));
if (_isPlatformBrightnessDependent && _isHighContrastDependent && _isInterfaceElevationDependent)
properties.add(createCupertinoColorProperty("darkHighContrastElevatedColor",
darkHighContrastElevatedColor));
if (_debugResolveContext != null)
properties.add(new DiagnosticsProperty<Element>("last resolved", _debugResolveContext));
}
public static DiagnosticsProperty<Color> createCupertinoColorProperty(
string name = null,
Color value = null,
bool showName = true,
object defaultValue = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level = DiagnosticLevel.info
) {
if (value is CupertinoDynamicColor) {
return new DiagnosticsProperty<Color>(
name: name,
value: value,
// description: value._debugLabel,
showName: showName,
defaultValue: defaultValue,
style: style,
level: level
);
}
else {
return new ColorProperty(
name,
value,
showName: showName,
defaultValue: defaultValue,
style: style,
level: level
);
}
}
}
}

1001
com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
文件差异内容过多而无法显示
查看文件

11
com.unity.uiwidgets/Runtime/cupertino/context_menu.cs.meta


fileFormatVersion: 2
guid: 24797e4675ab3314ea1a636afd32bfee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

151
com.unity.uiwidgets/Runtime/cupertino/context_menu_action.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.cupertino {
public class CupertinoContextMenuAction : StatefulWidget {
public CupertinoContextMenuAction(
Key key = null,
Widget child = null,
bool isDefaultAction = false,
bool isDestructiveAction = false,
VoidCallback onPressed = null,
IconData trailingIcon = null
) : base(key: key) {
D.assert(child != null);
D.assert(isDefaultAction != null);
D.assert(isDestructiveAction != null);
this.child = child;
this.isDefaultAction = isDefaultAction;
this.isDestructiveAction = isDestructiveAction;
this.onPressed = onPressed;
this.trailingIcon = trailingIcon;
}
public readonly Widget child;
public readonly bool isDefaultAction;
public readonly bool isDestructiveAction;
public readonly VoidCallback onPressed;
public readonly IconData trailingIcon;
public override State createState() {
return new _CupertinoContextMenuActionState();
}
}
public class _CupertinoContextMenuActionState : State<CupertinoContextMenuAction> {
public static Color _kBackgroundColor = new Color(0xFFEEEEEE);
public static Color _kBackgroundColorPressed = new Color(0xFFDDDDDD);
public static float _kButtonHeight = 56.0f;
public static readonly TextStyle _kActionSheetActionStyle = new TextStyle(
fontFamily: ".SF UI Text",
inherit: false,
fontSize: 20.0f,
fontWeight: FontWeight.w400,
color: CupertinoColors.black,
textBaseline: TextBaseline.alphabetic
);
public GlobalKey _globalKey = new LabeledGlobalKey<State<StatefulWidget>>();
//GlobalKey();
bool _isPressed = false;
void onTapDown(TapDownDetails details) {
setState(()=>{
_isPressed = true;
});
}
void onTapUp(TapUpDetails details) {
setState(()=>{
_isPressed = false;
});
}
void onTapCancel() {
setState(()=>{
_isPressed = false;
});
}
TextStyle _textStyle {
get {
if (widget.isDefaultAction) {
return _kActionSheetActionStyle.copyWith(
fontWeight: FontWeight.w600
);
}
if (widget.isDestructiveAction) {
return _kActionSheetActionStyle.copyWith(
color: CupertinoColors.destructiveRed
);
}
return _kActionSheetActionStyle;
}
}
public override Widget build(BuildContext context) {
List<Widget> widgets = new List<Widget>();
widgets.Add(new Flexible(child: widget.child));
if (widget.trailingIcon != null) {
widgets.Add(new Icon(
widget.trailingIcon,
color: _textStyle.color));
}
return new GestureDetector(
key: _globalKey,
onTapDown: onTapDown,
onTapUp: onTapUp,
onTapCancel: onTapCancel,
onTap: //widget.onPressed,
widget.onPressed == null
? (GestureTapCallback) null
: () => {
if (widget.onPressed != null) {
widget.onPressed();
}
},
behavior: HitTestBehavior.opaque,
child: /////semantics tbc ???
new ConstrainedBox(
constraints: new BoxConstraints(
minHeight: _kButtonHeight
),
child:
new Container(
padding: EdgeInsets.symmetric(
vertical: 16.0f,
horizontal: 10.0f
),
decoration: new BoxDecoration(
color: _isPressed ? _kBackgroundColorPressed : _kBackgroundColor,
border: new Border(
bottom: new BorderSide(width: 1.0f, color: _kBackgroundColorPressed)
)
),
child: new DefaultTextStyle(
style: _textStyle,
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:widgets
)
)
)
)
);
}
}
}

11
com.unity.uiwidgets/Runtime/cupertino/context_menu_action.cs.meta


fileFormatVersion: 2
guid: d5246034a96caf946b0142d694f1acac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

45
com.unity.uiwidgets/Runtime/cupertino/icon_theme_data.cs


using System.Runtime.CompilerServices;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.cupertino {
class CupertinoIconThemeData : IconThemeData {
public CupertinoIconThemeData(
Color color = null,
float? opacity = null,
float? size = null
) : base(color: color, opacity: opacity, size: size) {
}
public new IconThemeData resolve(BuildContext context) {
Color resolvedColor = CupertinoDynamicColor.resolve(color, context);
return resolvedColor == color ? this : copyWith(color: resolvedColor);
}
public new CupertinoIconThemeData copyWith(Color color = null , float? opacity = null, float? size = null)
{
return new CupertinoIconThemeData(
color: color ?? this.color,
opacity: opacity ?? this.opacity,
size: size ?? this.size
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(CupertinoDynamicColor.createCupertinoColorProperty("color", color, defaultValue: null));
}
}
}

11
com.unity.uiwidgets/Runtime/cupertino/icon_theme_data.cs.meta


fileFormatVersion: 2
guid: 696a8c3b3fd073847bc390f64a2b112f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

65
com.unity.uiwidgets/Runtime/cupertino/interface_level.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
using System;
using System.Collections.Generic;
namespace Unity.UIWidgets.cupertino {
public enum CupertinoUserInterfaceLevelData {
baselayer,
elevatedlayer,
}
public class CupertinoUserInterfaceLevel : InheritedWidget {
public CupertinoUserInterfaceLevel(
Key key = null,
CupertinoUserInterfaceLevelData data = default,
Widget child = null
) : base(key: key, child: child)
{
D.assert(data != null);
_data = data;
}
public CupertinoUserInterfaceLevelData _data;
public static CupertinoUserInterfaceLevelData? of(BuildContext context, bool nullOk = false ) {
D.assert(context != null);
D.assert(nullOk != null);
CupertinoUserInterfaceLevel query = context.dependOnInheritedWidgetOfExactType<CupertinoUserInterfaceLevel>(null);
if (query != null)
return query._data;
//if (nullOk)
// return ;
throw new UIWidgetsError(
"CupertinoUserInterfaceLevel.of() called with a context that does not contain a CupertinoUserInterfaceLevel.\n" +
"No CupertinoUserInterfaceLevel ancestor could be found starting from the context that was passed "+
"to CupertinoUserInterfaceLevel.of(). This can happen because you do not have a WidgetsApp or "+
"MaterialApp widget (those widgets introduce a CupertinoUserInterfaceLevel), or it can happen "+
"if the context you use comes from a widget above those widgets.\n"+
"The context used was:\n"+
context.ToString()
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<CupertinoUserInterfaceLevelData>("user interface level", _data));
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {
//throw new System.NotImplementedException();
//oldWidget._data != _data;
/// ?????
if (oldWidget.GetType() == typeof(CupertinoUserInterfaceLevel)) {
return updateShouldNotify(oldWidget);
}
return false;
}
public bool updateShouldNotify(CupertinoUserInterfaceLevel oldWidget) => oldWidget._data != _data;
}
}

11
com.unity.uiwidgets/Runtime/cupertino/interface_level.cs.meta


fileFormatVersion: 2
guid: 28fded021801d9047ab539e8b57eda6e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

204
com.unity.uiwidgets/Runtime/cupertino/bottom_app_bar.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.cupertino {
class BottomAppBarUtils {
public const float _kTabBarHeight = 50.0f;
public static readonly Color _kDefaultTabBarBorderColor = new Color(0x4C000000);
}
public class CupertinoTabBar : StatelessWidget {
public CupertinoTabBar(
Key key = null,
List<BottomNavigationBarItem> items = null,
ValueChanged<int> onTap = null,
int currentIndex = 0,
Color backgroundColor = null,
Color activeColor = null,
Color inactiveColor = null,
float iconSize = 30.0f,
Border border = null
) : base(key: key) {
D.assert(items != null);
D.assert(items.Count >= 2,
() => "Tabs need at least 2 items to conform to Apple's HIG"
);
D.assert(0 <= currentIndex && currentIndex < items.Count);
this.items = items;
this.onTap = onTap;
this.currentIndex = currentIndex;
this.backgroundColor = backgroundColor;
this.activeColor = activeColor;
this.inactiveColor = inactiveColor ?? CupertinoColors.inactiveGray;
this.iconSize = iconSize;
this.border = border ?? new Border(
top: new BorderSide(
color: BottomAppBarUtils._kDefaultTabBarBorderColor,
width: 0.0f, // One physical pixel.
style: BorderStyle.solid
)
);
}
public readonly List<BottomNavigationBarItem> items;
public readonly ValueChanged<int> onTap;
public readonly int currentIndex;
public readonly Color backgroundColor;
public readonly Color activeColor;
public readonly Color inactiveColor;
public readonly float iconSize;
public readonly Border border;
public Size preferredSize {
get { return Size.fromHeight(BottomAppBarUtils._kTabBarHeight); }
}
public bool opaque(BuildContext context) {
Color backgroundColor =
this.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor;
return backgroundColor.alpha == 0xFF;
}
public override Widget build(BuildContext context) {
float bottomPadding = MediaQuery.of(context).padding.bottom;
Widget result = new DecoratedBox(
decoration: new BoxDecoration(
border: border,
color: backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor
),
child: new SizedBox(
height: BottomAppBarUtils._kTabBarHeight + bottomPadding,
child: IconTheme.merge( // Default with the inactive state.
data: new IconThemeData(
color: inactiveColor,
size: iconSize
),
child: new DefaultTextStyle( // Default with the inactive state.
style: CupertinoTheme.of(context).textTheme.tabLabelTextStyle
.copyWith(color: inactiveColor),
child: new Padding(
padding: EdgeInsets.only(bottom: bottomPadding),
child: new Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: _buildTabItems(context)
)
)
)
)
)
);
if (!opaque(context)) {
result = new ClipRect(
child: new BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10.0f, sigmaY: 10.0f),
child: result
)
);
}
return result;
}
List<Widget> _buildTabItems(BuildContext context) {
List<Widget> result = new List<Widget> { };
for (int index = 0; index < items.Count; index += 1) {
bool active = index == currentIndex;
var tabIndex = index;
result.Add(
_wrapActiveItem(
context,
new Expanded(
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onTap == null ? null : (GestureTapCallback) (() => { onTap(tabIndex); }),
child: new Padding(
padding: EdgeInsets.only(bottom: 4.0f),
child: new Column(
mainAxisAlignment: MainAxisAlignment.end,
children: _buildSingleTabItem(items[index], active)
)
)
)
),
active: active
)
);
}
return result;
}
List<Widget> _buildSingleTabItem(BottomNavigationBarItem item, bool active) {
List<Widget> components = new List<Widget> {
new Expanded(
child: new Center(child: active ? item.activeIcon : item.icon)
)
};
if (item.title != null) {
components.Add(item.title);
}
return components;
}
Widget _wrapActiveItem(BuildContext context, Widget item, bool active) {
if (!active) {
return item;
}
Color activeColor = this.activeColor ?? CupertinoTheme.of(context).primaryColor;
return IconTheme.merge(
data: new IconThemeData(color: activeColor),
child: DefaultTextStyle.merge(
style: new TextStyle(color: activeColor),
child: item
)
);
}
public CupertinoTabBar copyWith(
Key key = null,
List<BottomNavigationBarItem> items = null,
Color backgroundColor = null,
Color activeColor = null,
Color inactiveColor = null,
float? iconSize = null,
Border border = null,
int? currentIndex = null,
ValueChanged<int> onTap = null
) {
return new CupertinoTabBar(
key: key ?? this.key,
items: items ?? this.items,
backgroundColor: backgroundColor ?? this.backgroundColor,
activeColor: activeColor ?? this.activeColor,
inactiveColor: inactiveColor ?? this.inactiveColor,
iconSize: iconSize ?? this.iconSize,
border: border ?? this.border,
currentIndex: currentIndex ?? this.currentIndex,
onTap: onTap ?? this.onTap
);
}
}
}

25
com.unity.uiwidgets/Runtime/cupertino/color.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.cupertino {
public class CupertinoColors {
public static readonly Color activeBlue = new Color(0xFF007AFF);
public static readonly Color activeGreen = new Color(0xFF4CD964);
public static readonly Color activeOrange = new Color(0xFFFF9500);
public static readonly Color white = new Color(0xFFFFFFFF);
public static readonly Color black = new Color(0xFF000000);
public static readonly Color lightBackgroundGray = new Color(0xFFE5E5EA);
public static readonly Color extraLightBackgroundGray = new Color(0xFFEFEFF4);
public static readonly Color darkBackgroundGray = new Color(0xFF171717);
public static readonly Color inactiveGray = new Color(0xFF8E8E93);
public static readonly Color destructiveRed = new Color(0xFFFF3B30);
}
}

/com.unity.uiwidgets/Runtime/cupertino/bottom_app_bar.cs.meta → /com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs.meta

/com.unity.uiwidgets/Runtime/cupertino/color.cs.meta → /com.unity.uiwidgets/Runtime/cupertino/colors.cs.meta

正在加载...
取消
保存