mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-06 16:25:15 -04:00
xfer
This commit is contained in:
parent
08dab73757
commit
c08878b35a
39 changed files with 771 additions and 218 deletions
|
@ -1,4 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:radix_colors/radix_colors.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
class IndexPage extends StatelessWidget {
|
||||
const IndexPage({super.key});
|
||||
|
@ -6,8 +9,34 @@ class IndexPage extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Center(child: Text("Index Page")),
|
||||
);
|
||||
windowManager.setTitleBarStyle(TitleBarStyle.hidden);
|
||||
return Scaffold(
|
||||
body: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: <Color>[
|
||||
RadixColors.dark.plum.step4,
|
||||
RadixColors.dark.plum.step2,
|
||||
])),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 300),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/icon.svg",
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/title.svg",
|
||||
))
|
||||
]))),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,61 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../state/active_logins_state.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:reorderable_grid/reorderable_grid.dart';
|
||||
|
||||
import '../providers/local_accounts.dart';
|
||||
import '../providers/logins.dart';
|
||||
|
||||
class LoginPage extends ConsumerWidget {
|
||||
const LoginPage({super.key});
|
||||
static const path = '/login';
|
||||
|
||||
void _onReorder(WidgetRef ref, int oldIndex, int newIndex) {
|
||||
final accounts = ref.read(localAccountsProvider.notifier);
|
||||
accounts.reorderAccount(oldIndex, newIndex);
|
||||
// xxx fix this so we can await this properly, use FutureBuilder or whatever
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
windowManager.setTitleBarStyle(TitleBarStyle.normal);
|
||||
final accounts = ref.watch(localAccountsProvider);
|
||||
final logins = ref.watch(loginsProvider);
|
||||
|
||||
return Scaffold(
|
||||
appBar: null,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: const Text('Accounts'),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.settings),
|
||||
tooltip: 'Accessibility',
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content:
|
||||
Text('Accessibility and language options coming soon')));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Login Page"),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
await ref.watch(authNotifierProvider.notifier).login(
|
||||
"myEmail",
|
||||
"myPassword",
|
||||
);
|
||||
},
|
||||
child: const Text("Login"),
|
||||
),
|
||||
const Spacer(),
|
||||
accounts.when(
|
||||
error: (obj, err) => Text("error loading accounts: $err"),
|
||||
loading: () => CircularProgressIndicator(),
|
||||
data: (accountList) => ReorderableGridView.extent(
|
||||
maxCrossAxisExtent: 128,
|
||||
onReorder: (oldIndex, newIndex) =>
|
||||
_onReorder(ref, oldIndex, newIndex),
|
||||
children: accountList.map((account) {
|
||||
return AccountBubble(account);
|
||||
}),
|
||||
)),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue