Skip to content

Commit f83f943

Browse files
authored
Refactor password field (#688)
* Add password field * Fix generator output * Let's go * Prepare Forui for review * Update windows-latest goldens * Fix controller * Fix PR issues --------- Co-authored-by: Pante <[email protected]>
1 parent 791d55e commit f83f943

File tree

315 files changed

+2341
-1628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+2341
-1628
lines changed

.github/workflows/forui_build_artifact.yaml renamed to .github/workflows/forui_nightly.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Forui Build Artifact
1+
name: Forui Nightly
22

33
on:
44
workflow_dispatch: {}
55
push:
66
branches: [ main ]
77
paths:
8-
- .github/workflows/forui_build_artifact.yaml
8+
- forui_nightly.yaml
99
- forui/**
1010

1111
concurrency:
@@ -15,7 +15,7 @@ concurrency:
1515
jobs:
1616
build-artifact:
1717
if: github.actor != 'auto-maid[bot]'
18-
name: Build Forui Artifact
18+
name: Build Nightly Artifacts
1919
runs-on: ubuntu-latest
2020
defaults:
2121
run:
@@ -43,11 +43,11 @@ jobs:
4343

4444
- run: |
4545
git fetch origin main
46-
git checkout -B build-artifacts origin/main
47-
git push origin build-artifacts --force
46+
git checkout -B nightly origin/main
47+
git push origin nightly --force
4848
4949
- uses: EndBug/add-and-commit@v9
5050
with:
51-
add: '--force **/*.style.dart'
52-
new_branch: 'build-artifacts'
53-
push: 'origin build-artifacts --set-upstream --force'
51+
add: '--force **/*.design.dart'
52+
new_branch: 'nightly'
53+
push: 'origin nightly --set-upstream --force'

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ are exposed as hooks in the companion `forui_hooks` package.
5858

5959
Please read the [contributing guide](/CONTRIBUTING.md).
6060

61+
## Nightly Builds
62+
63+
Nightly builds are available on the `nightly` branch. To use the latest nightly build, add the following to your `pubspec.yaml`:
64+
65+
```yaml
66+
dependencies:
67+
forui:
68+
git:
69+
url: https://github.com/forus-labs/forui.git
70+
ref: nightly
71+
```
72+
73+
Nightly builds are not guaranteed to be stable. Use at your own risk.
74+
75+
6176
## License
6277
6378
Code is licensed under the [MIT License](LICENSE). Fonts are licensed under [Open Font License](LICENSE). Icons are licensed under [ISC License](https://github.com/forus-labs/forui/blob/main/LICENSE).

docs/app/docs/form/text-field/page.mdx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,7 @@ FTextField(
172172
</Tabs.Tab>
173173
<Tabs.Tab>
174174
```dart copy
175-
FTextField.email(
176-
initialValue: '[email protected]',
177-
controller: _controller, // TextEditingController
178-
);
175+
FTextField.email(initialValue: '[email protected]');
179176
```
180177
</Tabs.Tab>
181178
</Tabs>
@@ -188,10 +185,7 @@ FTextField(
188185
</Tabs.Tab>
189186
<Tabs.Tab>
190187
```dart copy
191-
FTextField.password(
192-
controller: _controller, // TextEditingController
193-
obscuringCharacter: '*',
194-
);
188+
FTextField.password();
195189
```
196190
</Tabs.Tab>
197191
</Tabs>
@@ -205,7 +199,6 @@ FTextField(
205199
<Tabs.Tab>
206200
```dart copy
207201
FTextField.multiline(
208-
controller: _controller, // TextEditingController
209202
label: const Text('Leave a review'),
210203
maxLines: 4,
211204
);

docs/app/docs/form/text-form-field/page.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ FTextFormField.password(
154154
keyboardType: TextInputType.visiblePassword,
155155
textCapitalization: TextCapitalization.none,
156156
maxLines: 1,
157+
obscureTextController: ValueNotifier(false),
157158
);
158159
```
159160

forui/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ We've added support for animated theme transitions. This should make transitions
6262

6363

6464
### `FTextField` & `FTextFormField`
65-
We've added password visibility toggle functionality to password fields.
65+
We've added a password visibility toggle to password fields.
6666

6767
* Add password visibility toggle to `FTextField.password(...)`.
6868
* Add password visibility toggle to `FTextFormField.password(...)`.

forui/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ are exposed as hooks in the companion `forui_hooks` package.
5555

5656
Please read the [contributing guide](https://github.com/forus-labs/forui/blob/main/CONTRIBUTING.md).
5757

58+
## Nightly Builds
59+
60+
Nightly builds are available on the `nightly` branch. To use the latest nightly build, add the following to your `pubspec.yaml`:
61+
62+
```yaml
63+
dependencies:
64+
forui:
65+
git:
66+
url: https://github.com/forus-labs/forui.git
67+
ref: nightly
68+
```
69+
70+
Nightly builds are not guaranteed to be stable. Use at your own risk.
71+
5872
## License
5973
6074
Licensed under the [MIT License](https://github.com/forus-labs/forui/blob/main/forui/LICENSE) and [Open Font License](https://github.com/forus-labs/forui/blob/main/forui/LICENSE).

forui/bin/commands/style/style.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

forui/example/lib/sandbox.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ enum Notification { all, direct, nothing, limitedTime, timeSensitive, selectedAp
1616

1717
class _SandboxState extends State<Sandbox> with SingleTickerProviderStateMixin {
1818
late final FTabController c;
19-
final obscureNotifier = ValueNotifier<bool>(false);
19+
final controller = ValueNotifier<bool>(false);
20+
final textController = TextEditingController();
2021

2122
@override
2223
void initState() {
@@ -27,7 +28,8 @@ class _SandboxState extends State<Sandbox> with SingleTickerProviderStateMixin {
2728
@override
2829
void dispose() {
2930
c.dispose();
30-
obscureNotifier.dispose();
31+
controller.dispose();
32+
textController.dispose();
3133
super.dispose();
3234
}
3335

@@ -52,13 +54,13 @@ class _SandboxState extends State<Sandbox> with SingleTickerProviderStateMixin {
5254
FTextField.password(
5355
label: Text('FTextField Password (starts visible)'),
5456
hint: 'Enter password',
55-
obscureText: obscureNotifier,
57+
obscureTextController: controller,
5658
),
5759
SizedBox(height: 20),
5860
FTextFormField.password(
5961
label: Text('FTextFormField Password (starts visible)'),
6062
hint: 'Enter password',
61-
obscureText: obscureNotifier,
63+
obscureTextController: controller,
6264
),
6365
],
6466
);

forui/example/macos/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SPEC CHECKSUMS:
2828
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
2929
package_info_plus: f0052d280d17aa382b932f399edf32507174e870
3030
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
31-
wakelock_plus: 21ddc249ac4b8d018838dbdabd65c5976c308497
31+
wakelock_plus: 917609be14d812ddd9e9528876538b2263aaa03b
3232

3333
PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3
3434

forui/lib/l10n/f_af.arb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
"popoverSemanticsLabel": "Opspringer",
2525
"multiSelectHint": "Kies items",
2626
"autocompleteNoResults": "Geen resultate gevind nie.",
27-
"progressSemanticsLabel": "Besig om te laai"
27+
"progressSemanticsLabel": "Besig om te laai",
28+
"passwordFieldObscureTextButtonSemanticsLabel": "Versteek wagwoord",
29+
"passwordFieldUnobscureTextButtonSemanticsLabel": "Wys wagwoord"
2830
}

0 commit comments

Comments
 (0)