Git Product home page Git Product logo

flutter_shop_pro's Introduction

flutter_shop_pro

A Flutter project about shop.

例子图片:


Brand-first shopping design Fitness app design

Brand-first shopping design Fitness app design


涉及的第三方库


Response response = await Dio().get("http://www.baidu.com");
child: Swiper(
        itemBuilder: (BuildContext context, int index) {
          return InkWell(
            onTap: (){
              Application.router.navigateTo(
                context, 
                "detail?id=${swiperDataList[index]['goodsId']}");
            },
            child: Image.network(
              "${swiperDataList[index]['image']}",
              fit: BoxFit.fill),
          	);
        },
        itemCount: swiperDataList.length,  //设置数据的长度
        pagination: SwiperPagination(),		
        autoplay: true,
      ),
return Container(
      height: ScreenUtil().setHeight(333),
      width: ScreenUtil().setWidth(750),
  	.....
void _launchUrl() async {
    String url = 'tel:' + leaderPhone; //url中需要添加需要访问服务的类型
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'url不能打开,异常';
    }
  }
return EasyRefresh(
                child: ListView(
                  children: <Widget>[
                    ...      //嵌套在需要刷新的widget外层
                  ]
//1、建立专门的provide类 Counter 并混入ChangeNotifier 类内部编写状态变化逻辑
import 'package:flutter/material.dart';
// import 'package:provide/provide.dart';

class Counter with ChangeNotifier{
  int value = 0;
  increment(){
    value++;
    notifyListeners();//局部刷新widget
  }
}

//2、在main函数中进行声明并实例化对应的provide
void main(){ 
  var counter = Counter();
  var provides = Providers();
 
  provides..provide(Provider<Counter>.value(counter));
  runApp(ProviderNode(child:MyApp(),providers:provides));
  }

//3、在页面中引入该文件和库文件 即可使使用
child: Provide<Counter>(
          builder: (context,child,val){  //此方法内参数固定,不需要修改
            return Text(
            '${counter.value}',
            style: Theme.of(context).textTheme.display1,
          );
          },
        ),
if (goodsList.data == null) {
        Fluttertoast.showToast(
          backgroundColor: Colors.pink,
          msg: '没有更多数据了',
          gravity: ToastGravity.CENTER,
          toastLength: Toast.LENGTH_SHORT,
          textColor: Colors.white,
          fontSize: 16.0
        );

使用方法:商品静态化—>书写Handler—>总体route的设置,建立静态全局router 与handle的联系—>main函数中总体的注入,即将application中的声明的静态的router赋值给初始化的router,并在MaterialApp中设置其generator—>使用,直接使用application.router.navigateTo(参数)

使用方法:

return Html(
  data:goodsDetail
);
var prefs = await SharedPreferences.getInstance();//获取实例对象

//增 setxx   、删 (remove、clear)、改 、查get

get/setInt(key) //- 查询或设置整型键。

get/setBool(key) //- 查询或设置布尔键。

get/setDouble(key) //- 查询或设置浮点键。

get/setString(key) //- 查询或设置字符串键。

get/setStringList(key) //- 查询或设置字符串列表键。

getKeys() //- 获取所有键值名。

remove(key) //- 删除某个键内容。

clear() //- 清除全部内容。

使用Flutter


This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

flutter_shop_pro's People

Contributors

sunchao0427 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.