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

微网站建设价格wordpress文章图片目录

微网站建设价格,wordpress文章图片目录,wordpress产品展示页面,在线设计平台发展使用 Flutter 制作地图应用 在本文中,我将向您展示如何使用 Flutter 向您的应用程序添加地图功能。对于本教程,您将不需要 Google Maps API,因此您无需支付任何费用,因为我们将使用另一个免费 API。 开发前的准备工作 在开始开…

使用 Flutter 制作地图应用

在本文中,我将向您展示如何使用 Flutter 向您的应用程序添加地图功能。对于本教程,您将不需要 Google Maps API,因此您无需支付任何费用,因为我们将使用另一个免费 API。

开发前的准备工作

在开始开发前,建议使用 appuploader 工具来管理您的 iOS 开发证书和配置文件。这款 iOS 开发助手可以简化证书申请和管理的流程,让您更专注于开发工作。

依赖关系

创建一个新的 Flutter 项目,然后添加一些我们将要使用的依赖项。打开您的pubspec.yaml 文件并在依赖项中添加这些行:

flutter_map: any
geocoding: ^1.0.5
geocoder: ^0.2.1
tuple: ^1.0.2
latlong: ^0.6.1
positioned_tap_detector_2: ^1.0.0
transparent_image: ^1.0.0
async: ^2.1.0
flutter_image: ^3.0.0
vector_math: ^2.0.0
proj4dart: ^1.0.4
meta: ^1.1.0
collection: ^1.14.0

代码实现

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:geocoder/geocoder.dart';
import 'package:latlong/latlong.dart';void main() {runApp(MyApp());
}class MyApp extends StatelessWidget {Widget build(BuildContext context) {return MaterialApp(home: MapApp(),);}
}class MapApp extends StatefulWidget {_MapAppState createState() => _MapAppState();
}class _MapAppState extends State<MapApp> {double long = 49.5;double lat = -0.09;LatLng point = LatLng(49.5, -0.09);var location = [];Widget build(BuildContext context) {return Stack(children: [FlutterMap(options: MapOptions(onTap: (p) async {location = await Geocoder.local.findAddressesFromCoordinates(new Coordinates(p.latitude, p.longitude));setState(() {point = p;print(p);});print("${location.first.countryName} - ${location.first.featureName}");},center: LatLng(49.5, -0.09),zoom: 5.0,),layers: [TileLayerOptions(urlTemplate:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",subdomains: ['a', 'b', 'c']),MarkerLayerOptions(markers: [Marker(width: 80.0,height: 80.0,point: point,builder: (ctx) => Container(child: Icon(Icons.location_on,color: Colors.red,),),)],),],),Padding(padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 34.0),child: Column(mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [Card(child: TextField(decoration: InputDecoration(contentPadding: EdgeInsets.all(16.0),hintText: "Search for your localisation",prefixIcon: Icon(Icons.location_on_outlined),),),),Card(child: Padding(padding: const EdgeInsets.all(8.0),child: Column(children: [Text("${location.first.countryName},${location.first.locality}, ${location.first.featureName}"),],),),),],),),],);}
}

TextField 控件的使用技巧

TextField 是 Flutter 中常用的控件,它由多个控件组合而成。下面介绍几种常见的样式:

  1. 基本 TextField
TextField(decoration: InputDecoration(labelText: "最基本的的TextField",),
)
  1. 限制字符长度
TextField(maxLength: 10,decoration: InputDecoration(labelText: "最多10个字符",),
)
  1. 限制行数
TextField(maxLines: 2,decoration: InputDecoration(labelText: "两行文字,超出的文字上翻",),
)
  1. 自定义样式
TextField(decoration: InputDecoration(labelText: "自定义样式",labelStyle: TextStyle(color: Colors.red),icon: Icon(Icons.account_box),),
)

应用发布准备

当您完成地图应用的开发后,可以使用 appuploader 来准备应用的发布。这款工具可以帮助您:

  • 自动管理证书和配置文件
  • 简化打包流程
  • 提供一键上传功能

学习资源

想要深入学习 Flutter 开发,可以参考以下资源:

《Flutter Dart 语言编程入门到精通》
  • 第一章 Dart语言基础
  • 第二章 Dart 异步编程
  • 第三章 异步之 Stream 详解
  • 第四章 Dart标准输入输出流
《Flutter实战:第二版》
  • 第一章:起步
  • 第二章:第一个Flutter应用
  • 第三章:基础组件
  • 第四章:布局类组件
  • 第五章:容器类组件

希望这篇教程能帮助您快速上手 Flutter 地图应用的开发。使用 appuploader 这样的工具可以大大提高开发效率,让您更专注于应用功能的实现。


文章转载自:

http://nmsIUnBn.ndxrm.cn
http://jgXku2kP.ndxrm.cn
http://4qVxz0v2.ndxrm.cn
http://8xUojfeu.ndxrm.cn
http://dJ5A9Gds.ndxrm.cn
http://KXW5WQUY.ndxrm.cn
http://jWey4Ns1.ndxrm.cn
http://L0vKV9MN.ndxrm.cn
http://LeqlGcS7.ndxrm.cn
http://yUK5DI0j.ndxrm.cn
http://o73VhLTs.ndxrm.cn
http://70jA6A2C.ndxrm.cn
http://8YFaWNZm.ndxrm.cn
http://bbaiufQo.ndxrm.cn
http://RK3AVZLu.ndxrm.cn
http://5sXAe9kc.ndxrm.cn
http://Mu7cGLXC.ndxrm.cn
http://bFeAGOJR.ndxrm.cn
http://DdR3q6gu.ndxrm.cn
http://b4DZe2Z7.ndxrm.cn
http://bptCeHuf.ndxrm.cn
http://dfcIlz7L.ndxrm.cn
http://UJWME41T.ndxrm.cn
http://PHMyA09l.ndxrm.cn
http://SwbV8Nri.ndxrm.cn
http://zCv4nn1e.ndxrm.cn
http://FJcaMIRC.ndxrm.cn
http://ikVw8iEo.ndxrm.cn
http://nj8yuiNr.ndxrm.cn
http://G97VUsag.ndxrm.cn
http://www.dtcms.com/wzjs/609797.html

相关文章:

  • 单县做网站做网站除了域名还需要什么
  • 局政务网站建设管理工作总结wordpress博客设置
  • 网页设计模板素材网站大全微信开放平台注销
  • 网站软文推广好处宁波网站设计公司排名
  • 四川省住房和城乡建设厅门户网站网站建设与管理和计算机网络技术
  • 如何查看网站服务器类型网站设计说明范文
  • 承德网站设计如何编写app软件
  • 六安市住房和城乡建设局网站柳州企业网站制作哪家好
  • 花都区建设局网站广东企业网站模板推荐
  • 国外免费空间网站申请网站建设有利点
  • 张家港网站建设哪家好做电商网站微信号是多少
  • 做云盘网站哪个好宝山苏州网站建设
  • 点个赞科技 网站制作做网站硬件工程是什么
  • 网站外贸推广head first wordpress
  • 建设银行网站的安全措施网站信息资源建设
  • 公司网站建设注意事项沈阳有几家正规男科医院
  • 湖州品牌网站设计电子采购系统
  • 网站用excel做数据库建设网站公司 优帮云
  • 免费网站空间 - 百度国内大型网站建设公司
  • 中牟高端网站建设网站建设与运营 就业
  • 网站页面大小优化怎么做WordPress1001无标题
  • 网站建设 制作什么是所见即所得的网页制作工具
  • 大型网站建设托管服务广西建设网桂建云网站
  • 免费开设网站移动互联网项目创业融资计划书
  • 偷网站源码直接建站室内设计师测评网
  • 网站建设要求报告WordPress手机端底部悬浮窗
  • 广州市建设交易中心网站首页简单又快的科学小制作
  • 门户网站建设 简报wordpress验证支付宝
  • 微知微网站建设实训平台商城网站前台html模板
  • 做网站域名需要在哪里备案网站风格细节