| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- import 'dart:math' as math;
- import 'package:bbyyy/https/url.dart';
- import 'package:bbyyy/my_tools/my_colors.dart';
- import 'package:bbyyy/my_tools/my_cookie.dart';
- import 'package:bbyyy/my_tools/my_tools.dart';
- import 'package:bbyyy/my_tools/my_views.dart';
- import 'package:bbyyy/paegs/login_page/login_page.dart';
- import 'package:bbyyy/paegs/root_page/root_page_view.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_svg/svg.dart';
- import 'change_password_page.dart';
- class SetPage extends StatefulWidget {
- @override
- _SetPageState createState() => _SetPageState();
- }
- class _SetPageState extends State<SetPage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.white,
- body: Column(
- children: [
- Container(
- decoration: BoxDecoration(
- gradient: LinearGradient(colors: MyColors.lg),
- ),
- height: 250,
- child: Column(
- children: [
- SafeArea(
- bottom: false,
- child: Container(
- height: 45,
- width: double.infinity,
- color: Colors.transparent,
- child: Stack(
- children: [
- Text(
- '设置',
- style: TextStyle(color: Colors.white, fontSize: 16),
- ),
- Positioned(
- left: 0,
- child: GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- behavior: HitTestBehavior.translucent,
- child: Transform.rotate(
- angle: math.pi,
- child: Padding(
- padding: EdgeInsets.only(
- left: 16, right: 16, top: 8, bottom: 8),
- child: SvgPicture.asset(
- 'images/svg/箭头.svg',
- color: Colors.white,
- height: 14,
- ),
- ),
- ),
- ),
- ),
- ],
- alignment: Alignment.center,
- ),
- ),
- ),
- Column(
- children: [
- Container(
- margin: EdgeInsets.only(top: 34),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.all(Radius.circular(35.5)),
- boxShadow: [
- BoxShadow(
- color: MyColors.c7FE1E1E1,
- blurRadius: 5.0,
- ),
- ]),
- height: 71,
- width: 71,
- child: ClipRRect(
- child: MyViews().netImg(
- imgURL(
- MyCookie().loginInformation.data.extra.picture),
- 60,
- 60),
- borderRadius: BorderRadius.all(Radius.circular(30)),
- ),
- alignment: Alignment.center,
- ),
- Container(
- child: Text(
- MyCookie().loginInformation.data.extra.name,
- style: TextStyle(color: Colors.white, fontSize: 14),
- ),
- margin: EdgeInsets.only(top: 14),
- )
- ],
- )
- ],
- ),
- ),
- GestureDetector(
- onTap: () {
- MyTools().toPage(context, ChangePasswordPage(), (then) {});
- },
- behavior: HitTestBehavior.translucent,
- child: Container(
- padding: EdgeInsets.only(left: 20, right: 20),
- child: Column(
- children: [
- Row(
- children: [
- Container(
- child: SvgPicture.asset(
- 'images/svg/修改密码.svg',
- color: MyColors.c333333,
- ),
- margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
- ),
- Expanded(
- child: Text(
- '修改密码',
- style: TextStyle(color: MyColors.c333333, fontSize: 15),
- )),
- SvgPicture.asset('images/svg/箭头.svg')
- ],
- ),
- Container(
- height: 1,
- color: MyColors.cEFEFEF,
- )
- ],
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.only(left: 20, right: 20),
- child: Column(
- children: [
- Row(
- children: [
- Container(
- child: SvgPicture.asset(
- 'images/svg/收入进账提示音.svg',
- color: MyColors.c333333,
- ),
- margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
- ),
- Expanded(
- child: Text(
- '收入进账提示音',
- style: TextStyle(color: MyColors.c333333, fontSize: 15),
- )),
- CupertinoSwitch(
- activeColor: MyColors.cFF4233,
- value: MyCookie().prefs.getBool('收入进账提示音'),
- onChanged: (v) {
- MyCookie().prefs.setBool(
- '收入进账提示音', !MyCookie().prefs.getBool('收入进账提示音'));
- setState(() {});
- }),
- ],
- ),
- Container(
- height: 1,
- color: MyColors.cEFEFEF,
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.only(left: 20, right: 20),
- child: Column(
- children: [
- Row(
- children: [
- Container(
- child: SvgPicture.asset(
- 'images/svg/聊天新消息提示音.svg',
- color: MyColors.c333333,
- ),
- margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
- ),
- Expanded(
- child: Text(
- '聊天新消息提示音',
- style: TextStyle(color: MyColors.c333333, fontSize: 15),
- )),
- CupertinoSwitch(
- activeColor: MyColors.cFF4233,
- value: MyCookie().prefs.getBool('聊天新消息提示音'),
- onChanged: (v) {
- MyCookie().prefs.setBool('聊天新消息提示音',
- !MyCookie().prefs.getBool('聊天新消息提示音'));
- setState(() {});
- }),
- ],
- ),
- Container(
- height: 1,
- color: MyColors.cEFEFEF,
- )
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.symmetric(vertical: 101, horizontal: 62),
- child: GestureDetector(
- onTap: () {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return WillPopScope(
- onWillPop: () {
- return Future.value(false);
- },
- child: StreamBuilder<Object>(builder: (context, snapshot) {
- return Material(
- color: Colors.black12,
- child: Center(
- child: Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(16),
- color: Colors.white,
- ),
- height: 165,
- margin: EdgeInsets.symmetric(horizontal: 18),
- padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
- child: StatefulBuilder(
- builder: (BuildContext context,
- void Function(void Function()) setState) {
- return Column(
- children: [
- Container(
- height: 88,
- child: MyViews().myText('确认退出登录重新登录吗?',
- MyColors.c333333,
- 14),
- margin: EdgeInsets.symmetric(horizontal: 20),
- alignment: Alignment.center,
- ),
- Container(
- height: 0.5,
- color: MyColors.cE7E7E7,
- margin: EdgeInsets.only(bottom: 12),
- ),
- Row(
- children: [
- Expanded(
- child: GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- behavior: HitTestBehavior.translucent,
- child: Container(
- margin: EdgeInsets.only(left: 10),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(20),
- bottomLeft: Radius.circular(20),
- ),
- border: Border.all(
- color: MyColors.cFF4233,
- width: 1.1),
- color: Colors.white),
- child: MyViews().myText(
- '取消', MyColors.cFF4233, 14),
- height: 40,
- alignment: Alignment.center,
- ),
- ),
- ),
- Expanded(
- child: GestureDetector(
- behavior: HitTestBehavior.translucent,
- onTap: () {
- MyCookie().prefs.remove('LoginInformationBeanEntity');
- // MyCookie().prefs.clear();
- RootPageView().bNIndex = 0;
- MyTools().toPage(context, LoginPage(), (then) {}, noBack: true);
- },
- child: Container(
- margin: EdgeInsets.only(right: 10),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.only(
- topRight: Radius.circular(20),
- bottomRight:
- Radius.circular(20),
- ),
- color: MyColors.cFF4233),
- height: 40,
- child: MyViews()
- .myText('确认', Colors.white, 14),
- alignment: Alignment.center,
- ),
- ),
- )
- ],
- )
- ],
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- );
- },
- ),
- ),
- ),
- );
- }),
- );
- },
- );
- },
- behavior: HitTestBehavior.translucent,
- child: Container(
- decoration: BoxDecoration(
- color: MyColors.cFF4233,
- borderRadius: BorderRadius.all(Radius.circular(22.5))),
- height: 45,
- child: Text(
- '退出登录',
- style: TextStyle(color: Colors.white, fontSize: 15),
- ),
- alignment: Alignment.center,
- ),
- ),
- )
- ],
- ),
- );
- }
- }
|