页面逻辑
This commit is contained in:
57
lib/views/search/index_page.dart
Normal file
57
lib/views/search/index_page.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:chat/configs/app_colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchPage extends StatefulWidget {
|
||||
const SearchPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SearchPage> createState() => _SearchPageState();
|
||||
}
|
||||
|
||||
class _SearchPageState extends State<SearchPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.white,
|
||||
appBar: AppBar(
|
||||
title: Container(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 32,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
child: TextField(
|
||||
onChanged: (e) async {},
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(
|
||||
hintText: '请输入搜索内容',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
fillColor: AppColors.white,
|
||||
filled: true,
|
||||
contentPadding: EdgeInsets.only(
|
||||
bottom: 14,
|
||||
left: 16,
|
||||
),
|
||||
),
|
||||
cursorColor: AppColors.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.search,
|
||||
color: AppColors.black,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'package:chat/routes/user_routes.dart';
|
||||
import 'package:chat/services/auth_service.dart';
|
||||
import 'package:chat/widgets/custom_avatar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class UserPage extends StatefulWidget {
|
||||
const UserPage({Key? key}) : super(key: key);
|
||||
@@ -10,9 +14,55 @@ class UserPage extends StatefulWidget {
|
||||
class _UserPageState extends State<UserPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('我的'),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
GetX<AuthService>(builder: (_) {
|
||||
return Row(
|
||||
children: [
|
||||
CustomAvatar(
|
||||
_.userInfo.value.avatar,
|
||||
size: 72,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(_.userInfo.value.nickname),
|
||||
Text('${_.userInfo.value.address}'),
|
||||
],
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.qrCode);
|
||||
},
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(Icons.qr_code),
|
||||
Icon(Icons.arrow_forward_ios),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.share);
|
||||
},
|
||||
title: const Text('分享邀请'),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.setting);
|
||||
},
|
||||
title: const Text('设置中心'),
|
||||
),
|
||||
const ListTile(
|
||||
title: Text('检查更新'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
30
lib/views/user/setting/index_page.dart
Normal file
30
lib/views/user/setting/index_page.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:chat/services/auth_service.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UserSettingPage extends StatefulWidget {
|
||||
const UserSettingPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_UserSettingPageState createState() => _UserSettingPageState();
|
||||
}
|
||||
|
||||
class _UserSettingPageState extends State<UserSettingPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('设置中心'),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
AuthService.to.logout();
|
||||
},
|
||||
child: const Text('退出登录'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/views/user/share/index_page.dart
Normal file
20
lib/views/user/share/index_page.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UserSharePage extends StatefulWidget {
|
||||
const UserSharePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<UserSharePage> createState() => _UserSharePageState();
|
||||
}
|
||||
|
||||
class _UserSharePageState extends State<UserSharePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('分享邀请'),
|
||||
),
|
||||
body: Container(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user