# project-2 **Repository Path**: cse-oop/project-2 ## Basic Information - **Project Name**: project-2 - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 17 - **Created**: 2022-04-14 - **Last Updated**: 2023-04-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Flutter UI for Python #### 代码已更新,请互相通知 2022-04-27 13:29:00 - (2022-04-27)有同学报告后发现某些MDC控件必须先添加到DOM后才能调用javascript初始化函数,因此对框架进行了修改。如果你已经正确完成代码,可以忽略这个修改. > 具体修改是把render(self)函数改为render(self,parent). > > 在这个函数中可以立即把元素添加到DOM,然后再初始化. >```python >e = javascript.createElement('div') >... >parent.appendChild(e) #添加到DOM >... >e.appendChild(...) #在e中构造整个控件 >... >javascript.mdc.topAppBar.MDCTopAppBar.new(e) #初始化 >``` - 我发现大部分的 Material Design Component (MDC) 需要配上代码才可以正确显示。 - 我对 web/py_lib/flutter.py 作了相应的更改 (见454和503行)。 - 另外我添加了 web/lib/mdc_test.html, 里面展示了大部分的 MDC 控件的使用 (编辑器打开看源代码,双击浏览器打开看效果)。