import 'dart:io';
|
import 'dart:ui';
|
|
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/material.dart';
|
import 'package:makemoney/api/team_api.dart';
|
import 'package:makemoney/model/user/user_info.dart';
|
import 'package:makemoney/ui/widget/button.dart';
|
import 'package:makemoney/ui/widget/images_widget.dart';
|
import 'package:makemoney/ui/widget/verification_box.dart';
|
import 'package:makemoney/utils/ui_utils.dart';
|
import '../../utils/ui_constant.dart';
|
import '../../ui/widget/nav.dart';
|
import '../../utils/pageutils.dart';
|
|
import 'advice_submit.dart';
|
import 'package:launch_review/launch_review.dart';
|
|
class MyBossPage extends StatefulWidget {
|
MyBossPage({Key? key, required this.title}) : super(key: key);
|
|
// This widget is the home page of your application. It is stateful, meaning
|
// that it has a State object (defined below) that contains fields that affect
|
// how it looks.
|
|
// This class is the configuration for the state. It holds the values (in this
|
// case the title) provided by the parent (in this case the App widget) and
|
// used by the build method of the State. Fields in a Widget subclass are
|
// always marked "final".
|
|
final String title;
|
|
@override
|
_MyBossPageState createState() => _MyBossPageState();
|
}
|
|
class _MyBossPageState extends State<MyBossPage>
|
with SingleTickerProviderStateMixin {
|
UserInfo? _user;
|
|
@override
|
void initState() {
|
super.initState();
|
_getMyBoss();
|
}
|
|
@override
|
Widget build(BuildContext context) {
|
return Scaffold(
|
resizeToAvoidBottomInset: false,
|
backgroundColor: const Color(0xFFFFFFFF),
|
body: Flex(
|
direction: Axis.vertical,
|
children: [
|
TopNavBar(title: "邀请人"),
|
_user == null
|
? Container()
|
: Expanded(
|
child: Container(
|
color: ColorConstant.theme,
|
child: Stack(
|
children: [
|
AspectRatio(
|
aspectRatio: 1.875,
|
child: Image.asset(
|
"assets/imgs/mine/ic_my_boss_top_bg.png",
|
fit: BoxFit.fill,
|
),
|
),
|
Container(
|
margin: const EdgeInsets.fromLTRB(10, 118, 10, 0),
|
decoration: const BoxDecoration(
|
borderRadius: BorderRadius.only(
|
topRight: Radius.circular(13),
|
topLeft: Radius.circular(13)),
|
color: Colors.white),
|
),
|
Positioned(
|
top: 90,
|
left: 60,
|
right: 60,
|
child: Column(
|
children: [
|
//-------头像--------
|
portraitWidget(),
|
//昵称
|
Text(
|
_user == null ? "" : _user!.nickName!,
|
style: const TextStyle(
|
color: Color(0xFF333333),
|
fontSize: 13,
|
fontWeight: FontWeight.bold),
|
),
|
//内容
|
const SizedBox(
|
height: 15,
|
),
|
const Text(
|
"恭喜你,你已成功加入好友团队!",
|
style: TextStyle(
|
color: ColorConstant.theme,
|
fontSize: 18,
|
fontWeight: FontWeight.bold),
|
),
|
const SizedBox(
|
height: 35,
|
),
|
MyFillButton(
|
"返 回",
|
13,
|
height: 42,
|
fontSize: 15,
|
onClick: () {
|
popPage(context);
|
},
|
),
|
],
|
))
|
],
|
)))
|
],
|
));
|
}
|
|
void _getMyBoss() async {
|
Map<String, dynamic>? result = await TeamApiUtil.getMyBossInfo(context);
|
if (result == null) {
|
popPage(context);
|
return;
|
}
|
if (result["code"] != 0) {
|
ToastUtil.toast(result["msg"], context);
|
popPage(context);
|
return;
|
}
|
UserInfo temp = UserInfo.fromJson(result["data"]);
|
setState(() {
|
_user = temp;
|
});
|
}
|
|
Widget portraitWidget() {
|
return InkWell(
|
onTap: () {},
|
child: Container(
|
width: 90,
|
height: 90,
|
padding: const EdgeInsets.all(4),
|
alignment: Alignment.center,
|
decoration: BoxDecoration(
|
color: Colors.white, borderRadius: BorderRadius.circular(50)),
|
child: ClipRRect(
|
borderRadius: BorderRadius.circular(50),
|
child: CommonImage(
|
_user != null
|
? _user!.portrait!
|
: "assets/imgs/ic_portrait_default.png",
|
defaultWidget:
|
Image.asset("assets/imgs/ic_portrait_default.png")))));
|
}
|
}
|