1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- 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';
-
- class MainPage extends StatelessWidget {
- final Address item;
-
-
-
- MainPage({Key? key, required this.item}) : super(key: key);
-
- GetStorage box = GetStorage();
-
-
- @override
- Widget build(BuildContext context) {
- print('644444444444444+$item');
-
- return Container(
- alignment: Alignment.center,
- child: Column(
- children: [
- Column(
- children: [
- UserInfo(), //头部,头像手机号姓名
- UserAddress(item:item),//用户地址
- OtherColumn(), //功能菜单栏
- Container(
- height: 70.h,
- margin: EdgeInsets.only(top: 0, 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: () {
- showDialog(
- context: context,
- builder: (context) {
- return AlertDialog(
- content: Text("您确定退出登录吗?"),
- actions: <Widget>[
- TextButton(
- child: Text("取消"),
- onPressed: () {
- Navigator.pop(context, 'Cancle');
- },
- ),
- TextButton(
- child: Text("确定"),
- onPressed: () {
- Navigator.pop(context, "Ok");
- box.remove('token');
- Get.offNamed('/login');
- })
- ]);
- });
- },
- 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)))),
- ),
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- );
- }
- }
|