123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import 'package:farmer_client/models/entities/Address.dart';
- import 'package:get/get.dart';
- import 'package:get_storage/get_storage.dart';
- import './widgets/OtherColumn.dart';
- import './widgets/UserAddress.dart';
- import './widgets/UserInfo.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:farmer_client/widgets/Modal.dart' as modal;
-
- class MainPage extends StatelessWidget {
- final Address item;
-
- MainPage({Key? key, required this.item}) : super(key: key);
-
- GetStorage box = GetStorage();
-
- void _userOut() {
- modal.showDialog(
- title: '提示',
- content: Container(
- alignment: Alignment.center,
- child: Text('确定要退出登陆吗?'),
- ),
- onCancel: () => true,
- onConfirm: () => {
- box.remove('token'),
- Get.offAllNamed('/login'),
- });
- }
-
- @override
- Widget build(BuildContext context) {
- return Container(
- alignment: Alignment.center,
- child: ListView(
- children: [
- Column(
- children: [
- UserInfo(), //头部,头像手机号姓名
- UserAddress(item: item), //用户地址
- OtherColumn(), //功能菜单栏
- Card(
- //设置圆角
- shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
- // 普通的边
- /* shape: Border.all(
- color: Colors.yellow,
- width: 5.0
- ),*/
- elevation: 1,// 阴影大小
- // height: 70.h,
- margin: EdgeInsets.only(top: 10, bottom: 40.0),
- // alignment: Alignment.bottomCenter,
- // decoration: BoxDecoration(
- // boxShadow: [
- // BoxShadow(
- // blurRadius: 10, //阴影范围
- // spreadRadius: 0.1, //阴影浓度
- // color: Colors.grey.withOpacity(0.2), //阴影颜色
- // ),
- // ],
- // ),
- child: SizedBox(
- width: 315.w,
- height: 49.h,
- child: ElevatedButton(
- onPressed: () {
- _userOut();
- },
- child: const Text(
- "退出登陆",
- style: TextStyle(
- fontSize: 18,
- color: Colors.black,
- fontWeight: FontWeight.bold),
- ),
- style: ButtonStyle(
- elevation: MaterialStateProperty.all(0),
- backgroundColor:
- MaterialStateProperty.all(const Color(0xFFFFFFFF)),
- shape: MaterialStateProperty.all(
- const RoundedRectangleBorder(
- borderRadius:
- BorderRadius.all(Radius.circular(24.4)))),
- ),
- ),
- ),
- ),
- Container(
- margin: EdgeInsets.fromLTRB(0, 5, 0, 15),
- child: Text('南京市云致科技有限公司 提供技术支持',style: TextStyle(fontSize: 15.sp,color: Color(
- 0xff999999)),),
- )
- ],
- ),
- ],
- ),
- );
- }
- }
|