generated from uw-ssec/project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ability to edit personal and household information on the u…
…ser profile (#172) * chore: Add flutter form builder * feat: Add profile section component * feat: Allow to edit for personal and household sections * build: add auth env variables for dev * chore: Add new string catalog for user profile related strings * chore: Replace hardcoded text with string catalog constants --------- Co-authored-by: Don Setiawan <[email protected]>
- Loading branch information
Showing
11 changed files
with
413 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ auth: | |
GOTRUE_SMTP_SENDER_NAME: "[email protected]" | ||
GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_ENABLED: "true" | ||
GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_URI: "pg-functions://postgres/public/custom_access_token" | ||
GOTRUE_SMS_AUTOCONFIRM: "true" | ||
|
||
rest: | ||
imagePullSecrets: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/support_sphere/lib/presentation/components/profile_section.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:ionicons/ionicons.dart'; | ||
import 'package:support_sphere/logic/cubit/profile_cubit.dart'; | ||
|
||
class ProfileSection extends StatelessWidget { | ||
const ProfileSection({ | ||
super.key, | ||
this.title = "Section Header", | ||
this.children = const [], | ||
this.modalBody = const SizedBox(), | ||
this.displayTitle = true, | ||
this.readOnly = false, | ||
this.state = const ProfileState(), | ||
}); | ||
|
||
final String title; | ||
final List<Widget> children; | ||
final Widget modalBody; | ||
final bool displayTitle; | ||
final bool readOnly; | ||
final ProfileState state; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: const EdgeInsets.all(10), | ||
child: Column( | ||
children: [ | ||
_getTitle(context) ?? const SizedBox(), | ||
Card( | ||
child: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
children: children, | ||
), | ||
), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget? _getTitle(BuildContext context) { | ||
if (displayTitle) { | ||
return ListTile( | ||
title: Text(title), | ||
trailing: readOnly | ||
? null | ||
: GestureDetector( | ||
onTap: () => _showModalBottomSheet(context), | ||
child: const Icon(Ionicons.create_outline), | ||
), | ||
); | ||
} | ||
return null; | ||
} | ||
|
||
Future<dynamic> _showModalBottomSheet(BuildContext context) { | ||
return showModalBottomSheet( | ||
context: context, | ||
builder: (context) { | ||
return Container( | ||
padding: const EdgeInsets.all(16), | ||
child: modalBody, | ||
); | ||
}, | ||
); | ||
} | ||
} |
Oops, something went wrong.