This commit is contained in:
Christien Rioux 2023-08-01 00:39:50 -04:00
parent 57c366ef91
commit c35056f687
39 changed files with 1382 additions and 662 deletions

View file

@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:veilid/veilid.dart';
import '../../components/contact_list_widget.dart';
import '../../components/profile.dart';
@ -13,6 +12,7 @@ import '../../providers/account.dart';
import '../../providers/local_accounts.dart';
import '../../providers/logins.dart';
import '../../tools/tools.dart';
import '../../veilid_support/veilid_support.dart';
class AccountPage extends ConsumerStatefulWidget {
const AccountPage({super.key});
@ -40,7 +40,11 @@ class AccountPageState extends ConsumerState<AccountPage> {
// ignore: prefer_expression_function_bodies
Widget buildAccountList(BuildContext context) {
return Center(child: Text("account list"));
return Column(children: [
Center(child: Text("Small Profile")),
Center(child: Text("Contact invitations")),
Center(child: Text("Contacts"))
]);
}
Widget buildUnlockAccount(
@ -97,7 +101,9 @@ class AccountPageState extends ConsumerState<AccountPage> {
// Delete account
await ref
.read(localAccountsProvider.notifier)
.deleteAccount(activeUserLogin);
.deleteLocalAccount(activeUserLogin);
// Switch to no active user login
await ref.read(loginsProvider.notifier).switchToAccount(null);
});
return waitingPage(context);
case AccountInfoStatus.accountInvalid:
@ -109,7 +115,9 @@ class AccountPageState extends ConsumerState<AccountPage> {
// Delete account
await ref
.read(localAccountsProvider.notifier)
.deleteAccount(activeUserLogin);
.deleteLocalAccount(activeUserLogin);
// Switch to no active user login
await ref.read(loginsProvider.notifier).switchToAccount(null);
});
return waitingPage(context);
case AccountInfoStatus.accountLocked:

View file

@ -6,6 +6,7 @@ import 'package:flutter_translate/flutter_translate.dart';
import 'package:stylish_bottom_bar/model/bar_items.dart';
import 'package:stylish_bottom_bar/stylish_bottom_bar.dart';
import '../../components/contact_invitation_display.dart';
import 'account_page.dart';
import 'chats_page.dart';
@ -101,6 +102,25 @@ class MainPagerState extends ConsumerState<MainPager>
return bottomBarItems;
}
Future<void> _onNewContactInvitation(BuildContext context) async {
Scaffold.of(context).showBottomSheet<void>((context) => SizedBox(
height: 200, child: Center(child: ContactInvitationDisplay())));
}
Future<void> _onNewChat(BuildContext context) async {
//
}
Future<void> _onFloatingActionButtonPressed(BuildContext context) async {
if (_currentPage == 0) {
// New contact invitation
return _onNewContactInvitation(context);
} else if (_currentPage == 1) {
// New chat
return _onNewChat(context);
}
}
@override
// ignore: prefer_expression_function_bodies
Widget build(BuildContext context) {
@ -153,18 +173,15 @@ class MainPagerState extends ConsumerState<MainPager>
),
floatingActionButton: FloatingActionButton(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(14))),
//foregroundColor: theme.colorScheme.secondary,
backgroundColor: theme.colorScheme.secondaryContainer,
child: Icon(
_fabIconList[_currentPage],
color: theme.colorScheme.onSecondaryContainer,
),
onPressed: () {
// xxx
},
),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(14))),
//foregroundColor: theme.colorScheme.secondary,
backgroundColor: theme.colorScheme.secondaryContainer,
child: Icon(
_fabIconList[_currentPage],
color: theme.colorScheme.onSecondaryContainer,
),
onPressed: () async => _onFloatingActionButtonPressed(context)),
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
);
}