mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-07 05:32:26 -04:00
work
This commit is contained in:
parent
f06657d700
commit
8907ce04ac
72 changed files with 539 additions and 224 deletions
|
@ -1,10 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:circular_profile_avatar/circular_profile_avatar.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
|
||||
import '../entities/local_account.dart';
|
||||
import '../providers/logins.dart';
|
||||
|
@ -30,3 +30,22 @@ class AccountBubble extends ConsumerWidget {
|
|||
]));
|
||||
}
|
||||
}
|
||||
|
||||
class AddAccountBubble extends ConsumerWidget {
|
||||
const AddAccountBubble({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
windowManager.setTitleBarStyle(TitleBarStyle.normal);
|
||||
final logins = ref.watch(loginsProvider);
|
||||
|
||||
return Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
CircularProfileAvatar("",
|
||||
borderWidth: 4,
|
||||
borderColor: Theme.of(context).unselectedWidgetColor,
|
||||
child: Container(
|
||||
color: Colors.blue, child: const Icon(Icons.add, size: 50))),
|
||||
const Text("Add Account").paddingLTRB(0, 4, 0, 0)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
28
lib/components/chat.dart
Normal file
28
lib/components/chat.dart
Normal file
|
@ -0,0 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class Chat extends ConsumerWidget {
|
||||
const Chat({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text("Chat")),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Home Page"),
|
||||
// ElevatedButton(
|
||||
// onPressed: () {
|
||||
// ref.watch(authNotifierProvider.notifier).logout();
|
||||
// },
|
||||
// child: const Text("Logout"),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
31
lib/components/chat_index.dart
Normal file
31
lib/components/chat_index.dart
Normal file
|
@ -0,0 +1,31 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class ChatIndex extends ConsumerWidget {
|
||||
const ChatIndex({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
appBar: null,
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Contacts Page"),
|
||||
// ElevatedButton(
|
||||
// onPressed: () async {
|
||||
// ref.watch(authNotifierProvider.notifier).login(
|
||||
// "myEmail",
|
||||
// "myPassword",
|
||||
// );
|
||||
// },
|
||||
// child: const Text("Login"),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
29
lib/components/default_app_bar.dart
Normal file
29
lib/components/default_app_bar.dart
Normal file
|
@ -0,0 +1,29 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
|
||||
class DefaultAppBar extends AppBar {
|
||||
DefaultAppBar(BuildContext context,
|
||||
{super.key, required super.title, Widget? leading, List<Widget>? actions})
|
||||
: super(
|
||||
leading: leading ??
|
||||
Container(
|
||||
margin: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withAlpha(32),
|
||||
shape: BoxShape.circle),
|
||||
child: SvgPicture.asset("assets/images/vlogo.svg",
|
||||
height: 48)),
|
||||
actions: (actions ?? <Widget>[])
|
||||
..add(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.settings),
|
||||
tooltip: translate('app_bar.settings_tooltip'),
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
'Accessibility and language options coming soon')));
|
||||
},
|
||||
),
|
||||
));
|
||||
}
|
71
lib/components/new_account_form.dart
Normal file
71
lib/components/new_account_form.dart
Normal file
|
@ -0,0 +1,71 @@
|
|||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
|
||||
import '../components/default_app_bar.dart';
|
||||
import '../tools/desktop_control.dart';
|
||||
|
||||
class NewAccountForm extends ConsumerStatefulWidget {
|
||||
const NewAccountForm({super.key});
|
||||
|
||||
@override
|
||||
NewAccountFormState createState() {
|
||||
return NewAccountFormState();
|
||||
}
|
||||
}
|
||||
|
||||
class NewAccountFormState extends ConsumerState<NewAccountForm> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
key: const ValueKey("name"),
|
||||
autofocus: true,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate("new_account_form.name")),
|
||||
maxLength: 64,
|
||||
// The validator receives the text that the user has entered.
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Name is required';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
TextFormField(
|
||||
key: const ValueKey("title"),
|
||||
maxLength: 64,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate("new_account_form.title")),
|
||||
),
|
||||
Row(children: [
|
||||
const Spacer(),
|
||||
Text(translate("new_account_form.instructions"))
|
||||
.toCenter()
|
||||
.flexible(flex: 4),
|
||||
const Spacer(),
|
||||
]).paddingSymmetric(vertical: 24),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
// Validate returns true if the form is valid, or false otherwise.
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// If the form is valid, display a snackbar. In the real world,
|
||||
// you'd often call a server or save the information in a database.
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Processing Data')),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(translate('new_account_form.create')),
|
||||
).paddingSymmetric(vertical: 16).toCenter(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue