主要四个页面的基础页面

This commit is contained in:
2022-10-19 17:47:04 +08:00
parent 2ddccb3f9d
commit 49ad269c2b
13 changed files with 156 additions and 74 deletions

View File

@@ -1,6 +1,9 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/routes/app_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/utils/hd_wallet.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class AuthImportPage extends StatefulWidget {
const AuthImportPage({Key? key}) : super(key: key);
@@ -47,7 +50,12 @@ class _AuthImportPageState extends State<AuthImportPage> {
const Text('支持导入所有遵循BIP标准生成的助记词'),
ElevatedButton(
onPressed: () {
HDWallet.mnemonicToAddress(_editingController.text);
String? address =
HDWallet.mnemonicToAddress(_editingController.text);
if (address != null) {
AuthService.to.login(address);
Get.offAllNamed(AppRoutes.app);
}
},
child: const Text('开始导入'),
),

View File

@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class ContactGroupPage extends StatefulWidget {
const ContactGroupPage({Key? key}) : super(key: key);
@override
_ContactGroupPageState createState() => _ContactGroupPageState();
}
class _ContactGroupPageState extends State<ContactGroupPage> {
@override
Widget build(BuildContext context) {
return Container();
}
}

View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class ContactPage extends StatefulWidget {
const ContactPage({Key? key}) : super(key: key);
@override
_ContactPageState createState() => _ContactPageState();
}
class _ContactPageState extends State<ContactPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('通讯录'),
),
);
}
}

View File

@@ -10,6 +10,10 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
appBar: AppBar(
title: const Text('消息'),
),
);
}
}

View File

@@ -10,6 +10,10 @@ class MomentsPage extends StatefulWidget {
class _MomentsPageState extends State<MomentsPage> {
@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
appBar: AppBar(
title: const Text('发现'),
),
);
}
}

View File

@@ -1,5 +1,6 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/services/tabbar_service.dart';
import 'package:chat/views/contact/index/index_page.dart';
import 'package:chat/views/home/index_page.dart';
import 'package:chat/views/moments/index/index_page.dart';
import 'package:chat/views/user/index/user_page.dart';
@@ -12,6 +13,7 @@ class AppPage extends StatelessWidget {
final List<IndexedStackChild> _tabBarPageList = [
IndexedStackChild(child: const HomePage()),
IndexedStackChild(child: const ContactPage()),
IndexedStackChild(child: const MomentsPage()),
IndexedStackChild(child: const UserPage()),
];
@@ -19,15 +21,19 @@ class AppPage extends StatelessWidget {
final List<Map> _tabBarList = [
{
'icon': 'tabBar_03.png',
'label': '首页',
'label': '消息',
},
{
'icon': 'tabBar_03.png',
'label': '首页',
'label': '通讯录',
},
{
'icon': 'tabBar_03.png',
'label': '首页',
'label': '发现',
},
{
'icon': 'tabBar_03.png',
'label': '我的',
},
];

View File

@@ -1,20 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class UnknownPage extends StatelessWidget {
const UnknownPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () {
Get.back();
},
child: const Text('未知的页面'),
),
),
);
}
}

View File

@@ -10,6 +10,10 @@ class UserPage extends StatefulWidget {
class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
appBar: AppBar(
title: const Text('我的'),
),
);
}
}