基础库
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

58 rindas
1.5 KiB

  1. import 'package:flutter/material.dart';
  2. import 'dart:async';
  3. import 'package:flutter/services.dart';
  4. import 'package:zhiying_comm/zhiying_comm.dart';
  5. void main() => runApp(MyApp());
  6. class MyApp extends StatefulWidget {
  7. @override
  8. _MyAppState createState() => _MyAppState();
  9. }
  10. class _MyAppState extends State<MyApp> {
  11. @override
  12. void initState() {
  13. super.initState();
  14. }
  15. @override
  16. Widget build(BuildContext context) {
  17. return MaterialApp(
  18. home: Scaffold(
  19. appBar: AppBar(
  20. title: const Text('智莺-基础库'),
  21. ),
  22. body: Wrap(
  23. direction: Axis.horizontal,
  24. spacing: 5,
  25. children: <Widget>[
  26. RaisedButton(
  27. onPressed: () {
  28. NetUtil.post('/siteapi/v1/ucenter/login/', params: {
  29. 'username': 'xiangguohui',
  30. 'password': 'fnuo123com'
  31. });
  32. },
  33. child: Text('登录请求'),
  34. ),
  35. RaisedButton(
  36. onPressed: () {
  37. NetUtil.request('/api/v1/rec/featured?page=1',
  38. method: NetMethod.GET, params: {});
  39. },
  40. child: Text('页面请求'),
  41. ),
  42. RaisedButton(
  43. onPressed: () {
  44. NetUtil.request('/api/v1/config.json', params: {});
  45. },
  46. child: Text('基础配置'),
  47. )
  48. ],
  49. )),
  50. );
  51. }
  52. }