-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from famousj/develop
Add support for public/private profiles in the example app
- Loading branch information
Showing
19 changed files
with
265 additions
and
72 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
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
41 changes: 41 additions & 0 deletions
41
example/lib/src/presentation/ui/common/widgets/profile_radio_button.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,41 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:polygonid_flutter_sdk_example/utils/custom_colors.dart'; | ||
import 'package:polygonid_flutter_sdk_example/utils/custom_strings.dart'; | ||
|
||
enum SelectedProfile { public, private } | ||
|
||
typedef ProfileCallback = void Function(SelectedProfile); | ||
|
||
class ProfileRadio extends StatelessWidget { | ||
const ProfileRadio(SelectedProfile profile, ProfileCallback profileCallback, | ||
{Key? key}) | ||
: _profile = profile, | ||
_profileCallback = profileCallback, | ||
super(key: key); | ||
|
||
final ProfileCallback _profileCallback; | ||
final SelectedProfile? _profile; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
children: <Widget>[ | ||
_makeRadioListTile( | ||
CustomStrings.authPublicProfile, SelectedProfile.public), | ||
_makeRadioListTile( | ||
CustomStrings.authPrivateProfile, SelectedProfile.private), | ||
], | ||
); | ||
} | ||
|
||
Widget _makeRadioListTile(String text, SelectedProfile value) { | ||
return RadioListTile( | ||
title: Text(text), | ||
value: value, | ||
groupValue: _profile, | ||
activeColor: CustomColors.primaryButton, | ||
onChanged: (SelectedProfile? value) { | ||
_profileCallback(value!); | ||
}); | ||
} | ||
} |
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
Oops, something went wrong.