当前位置: 首页 > news >正文

flutter compass结构代码分析

1.config文件夹:

  1.1assets.dart

  返回一个Assets类,包含activities和destinations两个静态属性。两个静态属性分别代表虚拟数据存放的路径。在assets文件夹下

  1.2 dependencies.dart
  使用provider绑定远程访问和本地访问所需要的数据
2.data文件夹
 2.1 repositories
  activity文件夹
  activity_resposity.dart
    返回一个ActivityReposity抽象类,包含一个getByDestination的方法Future<Result<List<Activty>>;
  activity_resposity_local.dart
    ActivityResposityLocal继承ActivityReposity抽象类,构造函数中包含LocalDataService,LocalDataService位于services中的local文件夹当中,包含很多假的api.
    LocalDataService有虚拟的getActivities方法返回一组activities.通过where找到对应的activities.
  activity_resposity_remote.dart
    ActivityRepositoryRemote继承ActivityReposity抽象类,构造函数中包含ApiClient,ApiClient位于services中的api文件夹中。
    ApiClient通过访问api来获取数据。
 
  auth文件夹
    auth_reposity.dart
      返回一个AuthReposity抽象类,包含isAuthenticated属性,login和logout方法
    auth_reposity_dev.dart
      AuthRepositoryDev实现了AuthReposity抽象类,isAuthenticated全部返回Future.value(ture);login和logout全部返回Result.ok(true);
    auth_reposity_remote.dart
      AuthRepositoryRemote实现了AuthReposity抽象类,isAuthenticated全部返回Future.value(ture);login和logout全部返回Result.ok(true);
      AuthRepositoryRemote构造函数中添加apiClient、authApiClient和sharedPreferencesService。_sharedPreferencesService适用于存放token。authApiClient用于远程login或logout方法调用。输入分别为loginRequest,输出位loginResponse。
   
  booking文件夹
    booking_repostity.dart
      BookingReposity抽象类有方法:getBookingsList返回值Future<Result<List<BookingSummary>>>,getBooking,createBooking,delete
    booking_reposity_local.dart
      BookingReposityLocal实现BookingReposity,构造方法含有localDataService,
    booking_reposity_remote.dart
      BookingReposityRemote实现BookingReposity,构造方法含有apiClient,getBooking通过_apiClient的getBooking方法,getBookingsList调用_apiClient.getBookings,delete调用_apiClient.deleteBooking.
 
  continent文件夹
    continent_resposity.dart
      ContinentResposity抽象类getContinents。
 
  destination文件夹
  itinerary_config文件夹
  user文件夹
  
 2.2 services
  api文件夹
    model文件夹
      booking文件夹
        booking_api_model.dart
          引用的destination,采用destinationRef,和domain中的booking.dart中的model不一致。domain中的Booking,destination采用的Destination class.
      login_request文件夹
          
      login_resonse文件夹
 
      user文件夹
      
    api_client.dart
      ApiClient构造函数包括host,port,clientFactory.使用authHeaderProvider方法添加header,使用dart.io.httpclient作为请求client.有
  getContinents,getDestinations,getActivityByDestination,getBookings,getBooking,postBooking,getUser,deleteBooking等方法。
    auth_api_client.dart
      AuthAPiClient构造函数包括host,port,clientFactory.有login方法。
    auth_api_client.dart
    
  
  local文件夹
  shared_preferences_service.dart
  
2.3domain
  models文件夹
    activity文件夹
   booking文件夹
  continent文件夹
  destination文件夹
  itineary_config文件夹
  user文件夹
 use_cases文件夹
  booking文件夹
    booking_create_use_case.dart
      将多个请求汇总成一个booking
    booking_share_use_case.dart
 
2.4routing文件夹
  router.dart
     所有的go_router信息 
  routes.dart
    所有的地址信息
 
2.5 ui
  activities文件夹
    view_models文件夹
    widgts文件夹
  auth文件夹
    view_models文件夹
    widgts文件夹
  booking文件夹
    view_models文件夹
    widgts文件夹
  core文件夹
    view_models文件夹
    widgts文件夹
  home文件夹
    view_models文件夹
    widgts文件夹
  results文件夹
    view_models文件夹
    widgts文件夹
  search_form文件夹
    view_models文件夹
    widgts文件夹
 
 
  
  
    
 
 
 
 
 
 
 
 
 
 
  
 

 

  

 

http://www.zskr.cn/news/5575.html

相关文章:

  • 详细介绍:【ARMv7】系统复位上电后的程序执行过程
  • 网络同步预测-Prediction
  • 集训总结(六)
  • PromptPilot 产品发布:火山引擎助力AI提示词优化的新利器
  • 安装window版本docker
  • python_Day21_mysql(2)
  • .zip用法
  • vue2使用pnpm编译打包时的错误处理
  • 二十四、深入理解CPU控制信号的最终使命
  • 9.15日总结
  • 二十三、流水线的起点为何无需指挥?深入理解IF与ID这两个“公共流水段”
  • nc工具使用 - 谷粒
  • Azure App Service连接Azure SQL MI
  • 将目标数据复制到服务器-ServerSetReplicatedTargetData()
  • 不是说 PHP 不行了吗?为什么 Swoole 还在更新?
  • qoj1831 Bruteforce
  • C++数据结构和算法:链表
  • 详细介绍:Maven入门_简介、安装与配置
  • train-labels.idx1-ubyte里是什么
  • 创建预测窗口-ScopedPredictionWindow();
  • Ability-GetCurrentActorInfo()-IsLocallyControlled()和APawn::IsLocallyControlled()
  • 应该遵守的代码规范与读《数学之美》有感
  • AT_arc171_c [ARC171C] Swap on Tree
  • 新媒体运营用AI排版工具|10分钟搞定公众号图文的全流程指南
  • ctf工具整理
  • 250915 jave se简单过完一遍
  • AT_arc183_b [ARC183B] Near Assignment
  • kubectl 常用命令的分类汇总(一)
  • 完整教程:C3P0连接池适配HGDB
  • kubectl 常用命令的分类汇总(二)