大学
该软件包允许您搜索巴西的所有大学。
用法
要使用此插件,请在您的pubspec.yaml文件中将universities添加为依赖项。
示例
import 'package:flutter/material.dart';
import 'package:universities/universities.dart';
class SelectPage extends StatelessWidget {
const SelectPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: OutlinedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SelectUniversity(
backButton: true,
infoButton: true,
labelText: "Universidades",
hintText: "Insira o nome de sua universidade",
errorText: "Universidade não encontrada!",
textFormFieldColor: Colors.blue,
iconBackColor: Colors.deepPurpleAccent,
iconCollegeColor: Colors.indigoAccent,
iconInfoColor: Colors.deepPurpleAccent,
borderRadius: 10.0,
onSelect: (Map response){
debugPrint(response.toString());
},
),
),
);
},
child: const Text("Search Universities")),
),
);
}
}
onSelect
onSelect函数的返回是一个Map,其中包含所选大学的所有数据。
{
"id": 1,
"full_name": "UNIVERSIDADE FEDERAL DE MATO GROSSO",
"name": "UFMT",
"ibge": "5103403",
"city": "CUIABA",
"uf": "MT",
"zipcode": "78060900",
"street": "AVENIDA FERNANDO CORREA DA COSTA",
"number": "2367",
"neighborhood": "BOA ESPERANÇA",
"phone": "(65) 3615 8302",
"created_at": "2020-08-30T02:50:17.000Z",
"updated_at": "2020-11-27T18:40:06.000Z"
}
API
代码中使用的API和文档。
首页
https://api-universidades.vercel.app/
文档
https://documentacao-api-universidades.vercel.app/
许可证
版权所有 (c) 2021 Gabriel Patrick Souza
特此授予任何人获取一份副本的权利
本软件及相关文档文件(“软件”),可进行交易
在软件中,不受限制,包括但不限于使用权,
复制、修改、合并、发布、分发、再许可和/或出售
软件的副本,并允许向软件提供的人员
这样做,但需遵守以下条件
上述版权声明和本许可声明应包含在所有
软件的副本或实质性部分中。
软件按“原样”提供,不附带任何形式的保证,明示或
暗示,包括但不限于适销性、
特定用途的适用性和非侵权性。在任何情况下,
作者或版权所有者均不对任何索赔、损害或其他
责任负责,无论是在合同、侵权或其他行为中,源于、
与软件的使用或在软件中的其他交易有关。
软件。