flutter_base_models
一个应用的所有基础模型
PS1: model 的属性暂都不使用 final 修饰,因为后续可能需要修改。即使是id,也可能存在一些旧的代码里使用 id == baseModel.id 的情况。
PS2: 如果基类定义为 abstract 则子类无法使用 UserDetailModel.fromJson(Map<String, dynamic> json) 只能用 static UserDetailModel fromJson(Map<String, dynamic> json) 方法。
复杂一点的泛型使用
abstract class BaseCityModel<T extends BaseCityModel<T>>
使用:
static AreaPickerAddressModel fromSelectedIndex<T extends BaseCityModel<T>>
子类:
class AppCityModel extends BaseCityModel<AppCityModel>
# app
flutter create tsbaseuidemo
# package
flutter create --template=package flutter_baseui_kit
flutter create --template=package tsdemo_baseui
Libraries
- auth/avatar_auth_service_info
- auth/avatar_first_must_auth_utiler
- base_json_convert
- flutter_base_models
- location/area_code_util
- location/area_picker/area_picker_address_model
- location/area_picker/base_area_picker_model
- location/base_address_model
- location/base_location_model
- location/map_poi/nearby_address_model
- location/nearby_or_picker_adderss_model
- pickers/base_choose_item_model
- pickers/base_choose_item_util
- pickers/date/date_choose_rule_model
- pickers/date/date_enum
- publish/base_publish_model
- publish/jurisdiction_bean
- services/user/base_user_singleton
- services/user/user_cache_protocal
- services/user/user_event
- services/user/user_update_protocal
- social/base_comment_model
- social/enum_like_status
- social/request_anchor_comment
- topic/base_topic_model
- tree/base_tree_model
- user/protocal/user_level_protocal
- user/relation/user_relation_model
- user/relation/user_relation_tag_model
- user/user_base_model
- user/user_enum_avatar
- user/user_enum_realname