|
@@ -1,10 +1,7 @@
|
|
|
import 'dart:async';
|
|
import 'dart:async';
|
|
|
import 'dart:convert';
|
|
import 'dart:convert';
|
|
|
-import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:address_picker/address_picker.dart';
|
|
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/ad_bean_entity.dart';
|
|
|
import 'package:bbyyy/beans/commodity_category_bean_entity.dart';
|
|
import 'package:bbyyy/beans/commodity_category_bean_entity.dart';
|
|
|
import 'package:bbyyy/beans/goods_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/material.dart';
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
|
|
-import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
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(
|
|
Column(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
@@ -449,7 +456,7 @@ class _HomePageState extends State<HomePage>
|
|
|
behavior: HitTestBehavior.translucent,
|
|
behavior: HitTestBehavior.translucent,
|
|
|
child: Container(
|
|
child: Container(
|
|
|
padding:
|
|
padding:
|
|
|
- EdgeInsets.only(right: 15, left: 15, bottom: 9),
|
|
|
|
|
|
|
+ EdgeInsets.only(right: 15, left: 15, bottom: 9),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: [
|
|
children: [
|
|
|
Text(
|
|
Text(
|
|
@@ -819,7 +826,7 @@ class _HomePageState extends State<HomePage>
|
|
|
StatefulBuilder(
|
|
StatefulBuilder(
|
|
|
builder: (c, s) {
|
|
builder: (c, s) {
|
|
|
ss = s;
|
|
ss = s;
|
|
|
- return Container(
|
|
|
|
|
|
|
+ return Container(
|
|
|
height: 40,
|
|
height: 40,
|
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
|
@@ -829,10 +836,13 @@ class _HomePageState extends State<HomePage>
|
|
|
children: [
|
|
children: [
|
|
|
Text(
|
|
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(
|
|
style: TextStyle(
|
|
|
color: MyColors.cFF4233, fontSize: 14),
|
|
color: MyColors.cFF4233, fontSize: 14),
|
|
|
),
|
|
),
|
|
@@ -845,7 +855,8 @@ class _HomePageState extends State<HomePage>
|
|
|
alignment: Alignment.center,
|
|
alignment: Alignment.center,
|
|
|
child: Text(
|
|
child: Text(
|
|
|
'确定',
|
|
'确定',
|
|
|
- style: TextStyle(color: MyColors.cFF4233, fontSize: 16),
|
|
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: MyColors.cFF4233, fontSize: 16),
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
@@ -853,13 +864,15 @@ class _HomePageState extends State<HomePage>
|
|
|
province = '北京市';
|
|
province = '北京市';
|
|
|
city = '北京市';
|
|
city = '北京市';
|
|
|
setState(() {});
|
|
setState(() {});
|
|
|
- _reController.requestRefresh(); _address = null;
|
|
|
|
|
|
|
+ _reController.requestRefresh();
|
|
|
|
|
+ _address = null;
|
|
|
Navigator.pop(context);
|
|
Navigator.pop(context);
|
|
|
} else {
|
|
} else {
|
|
|
province = _address.currentProvince.province;
|
|
province = _address.currentProvince.province;
|
|
|
city = _address.currentCity.city;
|
|
city = _address.currentCity.city;
|
|
|
setState(() {});
|
|
setState(() {});
|
|
|
- _reController.requestRefresh(); _address = null;
|
|
|
|
|
|
|
+ _reController.requestRefresh();
|
|
|
|
|
+ _address = null;
|
|
|
Navigator.pop(context);
|
|
Navigator.pop(context);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -872,10 +885,10 @@ class _HomePageState extends State<HomePage>
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
GestureDetector(
|
|
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(() {});
|
|
setState(() {});
|
|
|
_reController.requestRefresh();
|
|
_reController.requestRefresh();
|
|
|
_address = null;
|
|
_address = null;
|
|
@@ -887,12 +900,20 @@ class _HomePageState extends State<HomePage>
|
|
|
height: 60,
|
|
height: 60,
|
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
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(
|
|
Container(
|
|
@@ -902,7 +923,7 @@ class _HomePageState extends State<HomePage>
|
|
|
mode: AddressPickerMode.provinceAndCity,
|
|
mode: AddressPickerMode.provinceAndCity,
|
|
|
onSelectedAddressChanged: (address) {
|
|
onSelectedAddressChanged: (address) {
|
|
|
_address = address;
|
|
_address = address;
|
|
|
- ss((){});
|
|
|
|
|
|
|
+ ss(() {});
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|