setting_page.dart 834 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. class SettingPage extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. List<Widget> children = [];
  7. if (UserManager.instance.isLogin) {
  8. children.add(GestureDetector(
  9. onTap: () {
  10. Navigator.pop(context);
  11. UserManager.instance.logout();
  12. },
  13. child: Container(
  14. height: 50,
  15. color: Colors.white,
  16. child: Center(
  17. child: Text('退出登录',
  18. style: TextStyle(fontSize: 16, color: SQColor.red)),
  19. ),
  20. ),
  21. ));
  22. }
  23. return Scaffold(
  24. appBar: AppBar(title: Text('设置'), elevation: 0.5),
  25. body: Container(
  26. child: ListView(
  27. children: children,
  28. ),
  29. ),
  30. );
  31. }
  32. }