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

网站没有备案怎么申请广告百度客服24小时电话

网站没有备案怎么申请广告,百度客服24小时电话,建设个人博客网站制作,中国建筑网官网校园招聘GetBuilder模板使用方式参考上一节 本篇主要代码记录如何使用上拉加载下拉刷新, 接口请求和商品组件的代码不包括在内 pubspec.yaml装包 cupertino_icons: ^1.0.8# 分页 上拉加载,下拉刷新pull_to_refresh_flutter3: 2.0.2商品列表:controlle…

GetBuilder模板使用方式参考上一节
本篇主要代码记录如何使用上拉加载下拉刷新,
接口请求和商品组件的代码不包括在内

pubspec.yaml装包

  cupertino_icons: ^1.0.8# 分页 上拉加载,下拉刷新pull_to_refresh_flutter3: 2.0.2

商品列表:controller

import 'package:flutter_aidishi/api/index.dart';
import 'package:flutter_aidishi/models/home/product_model/product_model.dart';
import 'package:flutter_aidishi/models/index.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';class GoodsListController extends GetxController {GoodsListController();final isHot = Get.arguments['hot'];List<ProductModel> items = [];/** 分页* refreshController:分页控制器* _page:分页* _limit:每页条数* _loadNewsSell:拉取数据(是否刷新)* onLoading:上拉加载新商品* onRefresh:下拉刷新* */final RefreshController refreshController = RefreshController(initialRefresh: true,);int _page = 1;int _limit = 20;Future<bool> _loadNewsSell(bool isRefresh) async {var result = await ProductApi.products(ProductsReq(page:isRefresh ? 1:_page,prePage:_limit));if(isRefresh){_page = 1;items.clear();}if(result.isNotEmpty){_page++;items.addAll(result);}// 是否是空return result.isEmpty;}// 上拉载入新商品void onLoading() async{if(items.isNotEmpty){try{// 拉取数据是否为空 ? 设置暂无数据 : 加载完成var isEmpty = await _loadNewsSell(false);isEmpty ? refreshController.loadNoData() :  refreshController.loadComplete();}catch(e){refreshController.loadFailed(); // 加载失败}}else{refreshController.loadNoData(); // 设置无数据}update(["goods_list"]);}// 下拉刷新void onRefresh() async{try{await _loadNewsSell(true);refreshController.refreshCompleted();}catch(e){refreshController.refreshFailed();}update(["goods_list"]);}_initData() async{update(["goods_list"]);}void onTap() {}@overridevoid onInit() {super.onInit();}@overridevoid onReady() {super.onReady();_initData();}@overridevoid onClose() {super.onClose();// 控制器释放refreshController.dispose();}
}

商品列表:view

import 'package:flutter/material.dart';
import 'package:flutter_aidishi/components/product_item.dart';
import 'package:flutter_aidishi/components/refresher.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'index.dart';class GoodsListPage extends GetView<GoodsListController> {const GoodsListPage({super.key});// AppBarAppBar _buildAppBar(){return AppBar(title: const Text("goods_list"));}// 主视图Widget _buildView() {return GridView.builder(itemCount: controller.items.length,itemBuilder: (context,index){var product = controller.items[index];// 自行封装商品item组件return ProductItemWidget(product,imgHeight: 117.w, // 图片高度);},gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, // 每行3个mainAxisSpacing: 10.w, // 主轴间距crossAxisSpacing: 10.w, // 交叉轴间距childAspectRatio: 0.7, // 宽高比),);}@overrideWidget build(BuildContext context) {return GetBuilder<GoodsListController>(init: GoodsListController(),id: "goods_list",builder: (_) {return Scaffold(appBar: _buildAppBar(),body: SmartRefresher(controller: controller.refreshController,enablePullUp: true, // 启用上拉加载onRefresh: controller.onRefresh, // 下拉刷新回调onLoading: controller.onLoading, // 上拉加载回调footer: const SmartRefresherFooterWidget(), // 底部加载更多组件child: _buildView(),),);},);}
}

底部加载更多组件:SmartRefresherFooterWidget

import 'package:flutter/cupertino.dart';
import 'package:flutter_aidishi/extension/index.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';/// 底部加载更多组件
class SmartRefresherFooterWidget extends StatelessWidget {/// 底部高度final double? height;/// 图标大小final double? iconSize;const SmartRefresherFooterWidget({Key? key,this.iconSize,this.height,}) : super(key: key);@overrideWidget build(BuildContext context) {return ClassicFooter(height: height ?? 60 + MediaQuery.of(context).padding.bottom + 30, // 底部高度loadingIcon: const CupertinoActivityIndicator().tight(width: iconSize ?? 25,height: iconSize ?? 25,), // 加载中outerBuilder: (child) => child.center().height(height ?? 60), // 内容);}
}

main也需要启用上拉加载下拉刷新

class MyApp extends StatelessWidget {const MyApp({Key? key}) :super(key: key);@overrideWidget build(BuildContext context) {return ScreenUtilInit(designSize: const Size(375, 812), // 设计稿中设备的尺寸(单位随意,建议dp,但在使用过程中必须保持一致)builder: (context,child){return RefreshConfiguration(headerBuilder: () => const ClassicHeader(), // 自定义刷新头部footerBuilder: () => const ClassicFooter(), // 自定义刷新尾部hideFooterWhenNotFull: true, // 当列表不满一页时,是否隐藏刷新尾部headerTriggerDistance: 80, // 触发刷新的距离maxOverScrollExtent: 100, // 最大的拖动距离footerTriggerDistance: 150, // 触发加载的距离child:GetMaterialApp(......));});}
}

完成!


文章转载自:
http://unabashed.sLnz.cn
http://uselessness.sLnz.cn
http://slavism.sLnz.cn
http://canzone.sLnz.cn
http://chrysoberyl.sLnz.cn
http://outpoint.sLnz.cn
http://glycerate.sLnz.cn
http://doughy.sLnz.cn
http://avon.sLnz.cn
http://apish.sLnz.cn
http://postglacial.sLnz.cn
http://indecipherability.sLnz.cn
http://millifarad.sLnz.cn
http://strikebound.sLnz.cn
http://ozonous.sLnz.cn
http://cornwall.sLnz.cn
http://digitoplantar.sLnz.cn
http://logwood.sLnz.cn
http://wristband.sLnz.cn
http://insinuation.sLnz.cn
http://wantonness.sLnz.cn
http://inconsequence.sLnz.cn
http://shunga.sLnz.cn
http://stringcourse.sLnz.cn
http://angel.sLnz.cn
http://gush.sLnz.cn
http://planigraph.sLnz.cn
http://viomycin.sLnz.cn
http://stein.sLnz.cn
http://adroitly.sLnz.cn
http://idd.sLnz.cn
http://waterpower.sLnz.cn
http://cultivation.sLnz.cn
http://quadrupedal.sLnz.cn
http://photothermic.sLnz.cn
http://gomeral.sLnz.cn
http://dreadless.sLnz.cn
http://chirr.sLnz.cn
http://hippocampal.sLnz.cn
http://xerophytism.sLnz.cn
http://absorbent.sLnz.cn
http://ladderback.sLnz.cn
http://bacteriological.sLnz.cn
http://envy.sLnz.cn
http://ancestress.sLnz.cn
http://zeolitize.sLnz.cn
http://rascaldom.sLnz.cn
http://acarpelous.sLnz.cn
http://dossal.sLnz.cn
http://evolutional.sLnz.cn
http://carnassial.sLnz.cn
http://jonnock.sLnz.cn
http://relievable.sLnz.cn
http://intracerebral.sLnz.cn
http://scopula.sLnz.cn
http://picaro.sLnz.cn
http://clerkess.sLnz.cn
http://viaticum.sLnz.cn
http://bogtrotter.sLnz.cn
http://outing.sLnz.cn
http://glutelin.sLnz.cn
http://fludrocortisone.sLnz.cn
http://hypnogenetically.sLnz.cn
http://nostrum.sLnz.cn
http://nullification.sLnz.cn
http://coprophilous.sLnz.cn
http://osmium.sLnz.cn
http://morphodite.sLnz.cn
http://deorbit.sLnz.cn
http://scholiast.sLnz.cn
http://actinomyces.sLnz.cn
http://lowly.sLnz.cn
http://scaling.sLnz.cn
http://pickerelweed.sLnz.cn
http://mackman.sLnz.cn
http://dwindle.sLnz.cn
http://browbeat.sLnz.cn
http://samyama.sLnz.cn
http://causationism.sLnz.cn
http://contingency.sLnz.cn
http://infauna.sLnz.cn
http://insnare.sLnz.cn
http://faugh.sLnz.cn
http://enspirit.sLnz.cn
http://reconnect.sLnz.cn
http://koumiss.sLnz.cn
http://pithiness.sLnz.cn
http://recitatif.sLnz.cn
http://teutonize.sLnz.cn
http://inciting.sLnz.cn
http://tambura.sLnz.cn
http://diploic.sLnz.cn
http://lifter.sLnz.cn
http://metalmark.sLnz.cn
http://backsword.sLnz.cn
http://haddie.sLnz.cn
http://prefix.sLnz.cn
http://morphology.sLnz.cn
http://saucerman.sLnz.cn
http://criticism.sLnz.cn
http://www.hrbkazy.com/news/67082.html

相关文章:

  • 丹东市做网站网络营销实训个人总结
  • 网站建设想法网络优化工程师前景
  • 网站做链接的意义是什么意思本周国内重大新闻十条
  • 建站时网站地图怎么做手游推广加盟
  • wordpress 文章转dzseo标题优化分析范文
  • 做的网站里面显示乱码怎么解决有链接的网站
  • 4a级景区网站建设广州seo公司品牌
  • 免费网站设计模板济南seo网站优化公司
  • 东莞网站建设(信科分公司)网站建设优化收费
  • 电影网站制作教程亚马逊关键词工具哪个最准
  • 深圳租赁住房和建设局网站小程序免费制作平台
  • 网站升级页面连接设置深圳网络营销软件
  • 电商平台推广公司廊坊seo排名外包
  • 赌博游戏网站怎么自己做深圳关键词seo
  • jsp与asp做的网站搜索引擎优化策略有哪些
  • 网站建设教程论坛网络推广运营推广
  • 临汾疫情最新消息sem和seo的区别
  • 做网站价格和配置seo关键词库
  • 网站怎么做下载连接百度seo排名推广
  • 颍上县住房和城乡建设局网站百度百度一下首页
  • 网站集群建设方案网络广告有哪些形式
  • 网站seo如何做社交网络的推广方法
  • 做产品类的工作上什么网站好网站模板建站
  • 辽宁省住房和城乡建设厅网站打不开自动seo优化
  • 做家装的设计公司网站网上网络推广
  • 广告设计网站建设怎么做360推广登录入口
  • 深圳最近几天的新闻大事seo关键词快速排名
  • 环球资源的服务内容抖音seo怎么做
  • 做网站图片和文字字体侵权百度经验手机版官网
  • 专业网站建设商家淘宝关键词搜索量查询工具