huxiaoqiang před 4 roky
rodič
revize
1da2d92681

+ 11 - 0
images/svg/已收藏.svg

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="15px" viewBox="0 0 16 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
+    <title>已收藏</title>
+    <desc>Created with Sketch.</desc>
+    <g id="已收藏" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组" transform="translate(1.000000, 1.000000)" fill="#FFCD00" stroke="#FFCD00" stroke-width="0.8">
+            <path d="M7.62702924,0.378328261 L9.24819036,3.5612558 C9.35031258,3.76077754 9.54635147,3.89967029 9.77525147,3.93154855 L13.3996181,4.44239203 C13.9729181,4.52374565 14.2018959,5.20701812 13.7867959,5.59803551 L11.1640904,8.07542101 C10.999357,8.23187319 10.9236015,8.45539783 10.9630737,8.67568188 L11.5825348,12.173021 C11.6797181,12.7269717 11.0801292,13.1483978 10.5676904,12.8882471 L7.32564036,11.236079 C7.12127924,11.1323428 6.87752369,11.1323428 6.67487369,11.236079 L3.43111258,12.8882471 C2.91707924,13.1499428 2.31741258,12.7269717 2.41626813,12.173021 L3.03572924,8.67568188 C3.07524036,8.45539783 2.99944591,8.23187319 2.83471258,8.07542101 L0.212045911,5.59803551 C-0.203131867,5.20539783 0.0259236885,4.52220072 0.5991848,4.44239203 L4.22351258,3.93154855 C4.45085702,3.89967029 4.64856813,3.76077754 4.75065147,3.5612558 L6.37177369,0.378328261 C6.62875147,-0.12610942 7.37012924,-0.12610942 7.62702924,0.378328261" id="Fill-1"></path>
+        </g>
+    </g>
+</svg>

+ 11 - 0
images/svg/未收藏.svg

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="15px" viewBox="0 0 16 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
+    <title>未收藏</title>
+    <desc>Created with Sketch.</desc>
+    <g id="未收藏" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组" transform="translate(1.000000, 1.000000)" stroke="#999999" stroke-width="0.8">
+            <path d="M7.627025,0.37868058 L9.24818611,3.56160812 C9.35030833,3.76112986 9.54634722,3.90002261 9.77524722,3.93190087 L13.3996139,4.44274435 C13.9729139,4.52409797 14.2018917,5.20737043 13.7867917,5.59838783 L11.1640861,8.07577333 C10.9993528,8.23222551 10.9235972,8.45575014 10.9630694,8.6760342 L11.5825306,12.1733733 C11.6797139,12.7273241 11.080125,13.1487501 10.5676861,12.8885994 L7.32563611,11.2364313 C7.121275,11.1326951 6.87751944,11.1326951 6.67486944,11.2364313 L3.43110833,12.8885994 C2.917075,13.1502951 2.31740833,12.7273241 2.41626389,12.1733733 L3.035725,8.6760342 C3.07523611,8.45575014 2.99944167,8.23222551 2.83470833,8.07577333 L0.212041667,5.59838783 C-0.203136111,5.20575014 0.0259194444,4.52255304 0.599180556,4.44274435 L4.22350833,3.93190087 C4.45085278,3.90002261 4.64856389,3.76112986 4.75064722,3.56160812 L6.37176944,0.37868058 C6.62874722,-0.125757101 7.370125,-0.125757101 7.627025,0.37868058" id="Fill-1"></path>
+        </g>
+    </g>
+</svg>

+ 44 - 23
lib/paegs/home_page/home_page.dart

@@ -1,10 +1,7 @@
 import 'dart:async';
 import 'dart:convert';
-import 'dart:io';
 
 import 'package:address_picker/address_picker.dart';
-import 'package:amap_location/amap_location.dart';
-import 'package:amap_location/amap_location_option.dart';
 import 'package:bbyyy/beans/ad_bean_entity.dart';
 import 'package:bbyyy/beans/commodity_category_bean_entity.dart';
 import 'package:bbyyy/beans/goods_bean_entity.dart';
@@ -26,7 +23,6 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_svg/flutter_svg.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
-import 'package:permission_handler/permission_handler.dart';
 import 'package:pull_to_refresh/pull_to_refresh.dart';
 
 class HomePage extends StatefulWidget {
@@ -432,6 +428,17 @@ class _HomePageState extends State<HomePage>
                 ),
               ],
             ),
+            Container(
+              height: 168,
+              child: ListView.builder(
+                padding: EdgeInsets.only(left: 12, right: 12),
+                itemBuilder: (c, index) {
+                  return Container(margin:EdgeInsets.only(right: 10),height: 138,width: 100,color: Colors.amber,);
+                },
+                itemCount: 10,
+                scrollDirection: Axis.horizontal,
+              ),
+            ),
             Column(
               children: [
                 Container(
@@ -449,7 +456,7 @@ class _HomePageState extends State<HomePage>
                         behavior: HitTestBehavior.translucent,
                         child: Container(
                           padding:
-                              EdgeInsets.only(right: 15, left: 15, bottom: 9),
+                          EdgeInsets.only(right: 15, left: 15, bottom: 9),
                           child: Column(
                             children: [
                               Text(
@@ -819,7 +826,7 @@ class _HomePageState extends State<HomePage>
               StatefulBuilder(
                 builder: (c, s) {
                   ss = s;
-                  return  Container(
+                  return Container(
                     height: 40,
                     color: Colors.white,
                     padding: EdgeInsets.symmetric(horizontal: 15),
@@ -829,10 +836,13 @@ class _HomePageState extends State<HomePage>
                           children: [
                             Text(
                               '定位到: ',
-                              style:
-                              TextStyle(color: MyColors.cFF4233, fontSize: 14),
+                              style: TextStyle(
+                                  color: MyColors.cFF4233, fontSize: 14),
                             ),
-                            Text(_address==null?'北京市 北京市':'${_address.currentProvince.province} ${_address.currentCity.city}',
+                            Text(
+                              _address == null
+                                  ? '北京市 北京市'
+                                  : '${_address.currentProvince.province} ${_address.currentCity.city}',
                               style: TextStyle(
                                   color: MyColors.cFF4233, fontSize: 14),
                             ),
@@ -845,7 +855,8 @@ class _HomePageState extends State<HomePage>
                             alignment: Alignment.center,
                             child: Text(
                               '确定',
-                              style: TextStyle(color: MyColors.cFF4233, fontSize: 16),
+                              style: TextStyle(
+                                  color: MyColors.cFF4233, fontSize: 16),
                             ),
                           ),
                           onTap: () {
@@ -853,13 +864,15 @@ class _HomePageState extends State<HomePage>
                               province = '北京市';
                               city = '北京市';
                               setState(() {});
-                              _reController.requestRefresh(); _address = null;
+                              _reController.requestRefresh();
+                              _address = null;
                               Navigator.pop(context);
                             } else {
                               province = _address.currentProvince.province;
                               city = _address.currentCity.city;
                               setState(() {});
-                              _reController.requestRefresh(); _address = null;
+                              _reController.requestRefresh();
+                              _address = null;
                               Navigator.pop(context);
                             }
                           },
@@ -872,10 +885,10 @@ class _HomePageState extends State<HomePage>
                 },
               ),
               GestureDetector(
-                onTap: (){
-                  if(MyCookie().location != null){
-                    province  = MyCookie().location.province;
-                    city  = MyCookie().location.city;
+                onTap: () {
+                  if (MyCookie().location != null) {
+                    province = MyCookie().location.province;
+                    city = MyCookie().location.city;
                     setState(() {});
                     _reController.requestRefresh();
                     _address = null;
@@ -887,12 +900,20 @@ class _HomePageState extends State<HomePage>
                   height: 60,
                   color: Colors.white,
                   padding: EdgeInsets.symmetric(horizontal: 20),
-                  child: Row(children: [
-                    Text('当前定位:',style: TextStyle(color: MyColors.c333333,fontSize: 16),),
-                    Text(MyCookie().location != null
-                        ? '${MyCookie().location.province} ${MyCookie().location.city}'
-                        : '请开启定位权限',style: TextStyle(color: MyColors.c333333,fontSize: 16),)
-                  ],),
+                  child: Row(
+                    children: [
+                      Text(
+                        '当前定位:',
+                        style: TextStyle(color: MyColors.c333333, fontSize: 16),
+                      ),
+                      Text(
+                        MyCookie().location != null
+                            ? '${MyCookie().location.province} ${MyCookie().location.city}'
+                            : '请开启定位权限',
+                        style: TextStyle(color: MyColors.c333333, fontSize: 16),
+                      )
+                    ],
+                  ),
                 ),
               ),
               Container(
@@ -902,7 +923,7 @@ class _HomePageState extends State<HomePage>
                   mode: AddressPickerMode.provinceAndCity,
                   onSelectedAddressChanged: (address) {
                     _address = address;
-                    ss((){});
+                    ss(() {});
                   },
                 ),
               ),