import 'package:flutter/material.dart'; import 'dart:async'; import 'package:flutter/services.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('智莺-基础库'), ), body: Wrap( direction: Axis.horizontal, spacing: 5, children: [ RaisedButton( onPressed: () { NetUtil.post('/siteapi/v1/ucenter/login/', params: { 'username': 'xiangguohui', 'password': 'fnuo123com' }); }, child: Text('登录请求'), ), RaisedButton( onPressed: () { NetUtil.request('/api/v1/rec/featured?page=1', method: NetMethod.GET, params: {}); }, child: Text('页面请求'), ), RaisedButton( onPressed: () { NetUtil.request('/api/v1/config.json', params: {}); }, child: Text('基础配置'), ) ], )), ); } }