This commit is contained in:
18631081161 2024-07-27 13:56:33 +08:00
parent 9df37f33b0
commit b2662dbe5b
3 changed files with 58 additions and 15 deletions

View File

@ -1,9 +1,12 @@
import 'dart:async';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:talk/tools/login/login_model.dart';
import '../me/agreement_page.dart';
class LoginPage extends StatefulWidget {
const LoginPage({super.key});
@ -160,9 +163,35 @@ class _LoginPageState extends State<LoginPage> {
child: RichText(
text: TextSpan(children: <TextSpan>[
TextSpan(text: '我已阅读并同意', style: TextStyle(fontSize: 12, color: Color(0xFF5F5F5F))),
TextSpan(text: '用户协议', style: TextStyle(fontSize: 12, color: Color(0xFFFF9000))),
TextSpan(
text: '用户协议',
style: TextStyle(fontSize: 12, color: Color(0xFFFF9000)),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AgreementPage(
title: "用户协议",
url: "https://shhuanmeng.com/yonghuxieyi.html",
)),
);
}),
TextSpan(text: '', style: TextStyle(fontSize: 12, color: Color(0xFF5F5F5F))),
TextSpan(text: '隐私协议', style: TextStyle(fontSize: 12, color: Color(0xFFFF9000))),
TextSpan(
text: '隐私协议',
style: TextStyle(fontSize: 12, color: Color(0xFFFF9000)),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AgreementPage(
title: "隐私协议",
url: "https://shhuanmeng.com/yinsixieyi.html",
)),
);
}),
]),
),
)

View File

@ -1,5 +1,8 @@
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:talk/network/NetworkConfig.dart';
import '../home_page.dart';
import 'agreement_page.dart';
class SettingPage extends StatefulWidget {
@ -127,18 +130,30 @@ class _SettingApgeState extends State<SettingPage> {
),
),
),
Container(
width: 221,
height: 37,
alignment: Alignment.center,
margin: EdgeInsets.only(top: 40),
decoration: BoxDecoration(
color: Color(0xFFFF9000),
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
child: Text(
'退出登录',
style: TextStyle(fontSize: 13, color: Colors.black),
GestureDetector(
onTap: () async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('token', "");
NetworkConfig.userId = "";
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (context) => const HomePage()),
(Route<dynamic> route) => false,
);
},
child: Container(
width: 221,
height: 37,
alignment: Alignment.center,
margin: EdgeInsets.only(top: 40),
decoration: BoxDecoration(
color: Color(0xFFFF9000),
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),
child: Text(
'退出登录',
style: TextStyle(fontSize: 13, color: Colors.black),
),
),
)
],

View File

@ -208,7 +208,6 @@ class _MessagePageState extends State<MessagePage> {
}
doNothing(BuildContext context, id, index) {
print("object");
delIndex = index;
EasyLoading.show(status: 'loading...');
_viewmodel.delChat(id);