12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:ysairplane2/base/YSBase.dart';
- import 'package:ysairplane2/tools/YSNetWorking.dart';
- import 'package:ysairplane2/tools/YSTools.dart';
- class YSChoosePoint extends StatefulWidget {
- @override
- _YSChoosePointState createState() => _YSChoosePointState();
- }
- class _YSChoosePointState extends State<YSChoosePoint> {
- List _dataArray = [];
- @override
- void initState() {
- Future.delayed(Duration(seconds: 0)).then((value){
- _getPointData();
- });
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return YSBase(
- ystitle: '出发点选择',
- yschild: Container(
- height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44,
- child: ListView.separated(
- itemBuilder: (context,index){
- return GestureDetector(
- onTap: (){
- Navigator.of(context).pop(_dataArray[index]);
- },
- behavior: HitTestBehavior.opaque,
- child: Container(
- width: MediaQuery.of(context).size.width,
- padding: EdgeInsets.all(hsp(30)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${_dataArray[index]['dtPartner']['companyName']}',style: TextStyle(fontSize: zsp(30),
- color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- Text('${_dataArray[index]['setoutInfo']['introduce']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- ],
- ),
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFF5F5F5),);
- },
- itemCount: _dataArray.length,
- padding: EdgeInsets.all(0),
- ),
- ),
- );
- }
- _getPointData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/AirTour/getFreedomFly',parameter: {},isLoading: false,isToken: true);
- if(dict!=null){
- setState(() {
- _dataArray = dict['data'];
- });
- }
- }
- }
|