Notifications with new Flutter app [Kinda work!]
This commit is contained in:
@@ -32,4 +32,8 @@
|
||||
- [ ] use sq.Query | sq.Update | sq.InsertAndQuery | ....
|
||||
- [ ] sq.DBOptions - enable CommentTrimmer and DefaultConverter
|
||||
- [ ] run unit-tests...
|
||||
- [ ] Copy db.Migrate code
|
||||
- [ ] Copy db.Migrate code
|
||||
|
||||
- [ ] Disable compat | remove code
|
||||
- [x] compat message title
|
||||
- [ ] ...
|
@@ -216,7 +216,7 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
padding: const EdgeInsets.fromLTRB(4, 1, 4, 1),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(8)),
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(4)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -228,7 +228,7 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
padding: const EdgeInsets.fromLTRB(4, 1, 4, 1),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.purple,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(8)),
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(4)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -240,18 +240,7 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Text(user.username ?? user.userID, overflow: TextOverflow.ellipsis)),
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.pen),
|
||||
iconSize: 18,
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 4, 0),
|
||||
constraints: BoxConstraints(),
|
||||
onPressed: () {/*TODO*/},
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(user.username ?? user.userID, overflow: TextOverflow.ellipsis),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
@@ -282,6 +271,29 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.pen),
|
||||
iconSize: 18,
|
||||
padding: EdgeInsets.all(4),
|
||||
constraints: BoxConstraints(),
|
||||
style: ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||
onPressed: () {/*TODO*/},
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
if (!user.isPro)
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.cartCircleArrowUp),
|
||||
iconSize: 18,
|
||||
padding: EdgeInsets.all(4),
|
||||
constraints: BoxConstraints(),
|
||||
style: ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||
onPressed: () {/*TODO*/},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -458,6 +470,7 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
acc.set(user.user, user.clients[0], KeyTokenAuth(userId: user.user.userID, tokenAdmin: user.adminKey, tokenSend: user.sendKey));
|
||||
|
||||
await acc.save();
|
||||
Toaster.success("Success", 'Successfully Created a new account');
|
||||
} catch (exc, trace) {
|
||||
ApplicationLog.error('Failed to create user account: ' + exc.toString(), trace: trace);
|
||||
Toaster.error("Error", 'Failed to create user account');
|
||||
@@ -469,6 +482,7 @@ class _AccountRootPageState extends State<AccountRootPage> {
|
||||
void _logout() async {
|
||||
final acc = Provider.of<UserAccount>(context, listen: false);
|
||||
|
||||
//TODO clear messages/channels/etc in open views
|
||||
acc.clear();
|
||||
await acc.save();
|
||||
|
||||
|
@@ -149,12 +149,13 @@ class _AccountLoginPageState extends State<AccountLoginPage> {
|
||||
|
||||
final user = await APIClient.getUser(kta, uid);
|
||||
|
||||
final client = await APIClient.addClient(acc.auth, fcmToken, Globals().deviceModel, Globals().version, Globals().hostname, Globals().clientType);
|
||||
final client = await APIClient.addClient(kta, fcmToken, Globals().deviceModel, Globals().version, Globals().hostname, Globals().clientType);
|
||||
|
||||
acc.set(user, client, kta);
|
||||
await acc.save();
|
||||
|
||||
Toaster.success("Login", "Successfully logged in");
|
||||
Navigator.popUntil(context, (route) => route.isFirst);
|
||||
} catch (exc, trace) {
|
||||
ApplicationLog.error('Failed to verify token: ' + exc.toString(), trace: trace);
|
||||
Toaster.error("Error", 'Failed to verify token');
|
||||
|
@@ -57,7 +57,7 @@ class _DebugMainPageState extends State<DebugMainPage> {
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.colors, icon: Icon(FontAwesomeIcons.solidPaintRoller, size: 14)),
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.actions, icon: Icon(FontAwesomeIcons.solidHammer, size: 14)),
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.requests, icon: Icon(FontAwesomeIcons.solidNetworkWired, size: 14)),
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.persistence, icon: Icon(FontAwesomeIcons.solidFloppyDisk, size: 14)),
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.persistence, icon: Icon(FontAwesomeIcons.solidDatabase, size: 14)),
|
||||
ButtonSegment<DebugMainPageSubPage>(value: DebugMainPageSubPage.logs, icon: Icon(FontAwesomeIcons.solidFileLines, size: 14)),
|
||||
],
|
||||
style: ButtonStyle(
|
||||
|
Reference in New Issue
Block a user