ui: Add the PostRegister page

This commit is contained in:
PapaTutuWawa 2021-12-25 14:10:33 +01:00
parent 38ed4fe2f9
commit f72ff32f77
3 changed files with 124 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import 'ui/pages/login/login.dart';
import 'ui/pages/register.dart';
import 'ui/pages/intro.dart';
import 'ui/pages/addcontact/addcontact.dart';
import 'ui/pages/postregister.dart';
import 'repositories/roster.dart';
import 'package:flutter_redux/flutter_redux.dart';
@ -43,6 +44,7 @@ class MyApp extends StatelessWidget {
"/intro": (context) => IntroPage(),
"/login": (context) => LoginPage(),
"/register": (context) => RegistrationPage(),
"/register/post": (context) => PostRegistrationPage(),
"/conversations": (context) => ConversationsPage(),
"/conversation": (context) => ConversationPage(),
"/conversation/profile": (context) => ProfilePage(),

View File

@ -0,0 +1,117 @@
import 'package:flutter/material.dart';
import "package:moxxyv2/ui/constants.dart";
class PostRegistrationPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: Fix the typography
return SafeArea(
child: Scaffold(
body: Column(
children: [
Padding(
padding: EdgeInsetsDirectional.only(top: 32.0),
child: Text(
"This is you!",
style: TextStyle(
fontSize: 40
)
)
),
Padding(
padding: EdgeInsets.symmetric(horizontal: PADDING_VERY_LARGE),
child: InkWell(
child: Row(
children: [
// TODO
CircleAvatar(
backgroundColor: Colors.grey,
backgroundImage: NetworkImage("https://3.bp.blogspot.com/-tXOVVeovbNA/XI8EEkbKjgI/AAAAAAAAJrs/3lOV4RQx9kIp9jWBmZhSKyng9iNQrDivgCLcBGAs/s2560/hatsune-miku-4k-fx-2048x2048.jpg"),
radius: 35.0
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// TODO: Maybe have a TextField here
Text(
"Testuser",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25
)
),
Text("testuser@someprovider.net")
]
)
)
]
),
// TODO
onTap: () {}
)
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.0).add(EdgeInsets.only(top: 16.0)),
child: Text(
"We have auto-generated a password for you. You should write it down somewhere sage.",
style: TextStyle(
fontSize: 15
)
)
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.0).add(EdgeInsets.only(top: 16.0)),
child: ExpansionTile(
title: Text("Show password"),
children: [
ListTile(title: Text("s3cr3t_p4ssw0rd"))
]
)
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.0),
child: ExpansionTile(
title: Text("Advanced settings"),
children: [
SwitchListTile(
title: Text("Enable link previews"),
value: true,
// TODO
onChanged: (value) {}
),
SwitchListTile(
title: Text("Use Push Services"),
value: true,
// TODO
onChanged: (value) {}
)
]
)
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.0).add(EdgeInsets.only(top: 16.0)),
child: Text("You can now be contacted by your XMPP address. If you want to set a profile picture, just tap your name.")
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.0),
child: Row(
children: [
Expanded(
child: ElevatedButton(
child: Text("Start chatting"),
// TODO
onPressed: () => Navigator.pushNamedAndRemoveUntil(context, "/conversations", (route) => false)
)
)
]
)
)
]
)
)
);
}
}

View File

@ -39,6 +39,10 @@ class RegistrationPage extends StatelessWidget {
viewModel.setProviderIndex(newIndex);
}
void _performRegistration(BuildContext context) {
Future.delayed(Duration(seconds: 3), () => Navigator.pushNamedAndRemoveUntil(context, "/register/post", (route) => false));
}
@override
Widget build(BuildContext context) {
return StoreConnector<MoxxyState, _RegistrationPageViewModel>(
@ -108,7 +112,7 @@ class RegistrationPage extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: PADDING_VERY_LARGE),
child: ElevatedButton(
child: Text("Register"),
onPressed: () {}
onPressed: () => this._performRegistration(context)
)
)
)