main.dart 904 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import 'package:common_utils/common_utils.dart';
  2. import 'package:flustars/flustars.dart';
  3. import 'package:flutter/material.dart';
  4. void main() => runApp(new MyApp());
  5. class MyApp extends StatefulWidget {
  6. @override
  7. _MyAppState createState() => new _MyAppState();
  8. }
  9. class _MyAppState extends State<MyApp> {
  10. @override
  11. void initState() {
  12. super.initState();
  13. test();
  14. }
  15. void test() async {
  16. SpUtil spUtil = await SpUtil.getInstance();
  17. //SpUtil.remove("username");
  18. SpUtil.putString("username", "sky224");
  19. LogUtil.e("username: " + SpUtil.getString("username").toString());
  20. }
  21. @override
  22. Widget build(BuildContext context) {
  23. return new MaterialApp(
  24. home: new Scaffold(
  25. appBar: new AppBar(
  26. title: const Text('Plugin example app'),
  27. ),
  28. body: new Center(
  29. child: new Text('Running on: '),
  30. ),
  31. ),
  32. );
  33. }
  34. }