Skip to content

Commit d8ee796

Browse files
authored
cosmos_ui_components improvements (#95)
1 parent d9580f1 commit d8ee796

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

packages/cosmos_ui_components/lib/components/cosmos_app_bar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ import 'package:flutter/material.dart';
22

33
class CosmosAppBar extends StatelessWidget implements PreferredSizeWidget {
44
final String title;
5+
final List<Widget>? actions;
56

67
const CosmosAppBar({
78
Key? key,
89
this.title = "",
10+
this.actions,
911
}) : super(key: key);
1012

1113
@override
1214
Widget build(BuildContext context) {
1315
return AppBar(
1416
title: Text(title),
17+
actions: actions,
1518
);
1619
}
1720

packages/cosmos_ui_components/lib/components/template/cosmos_password_field.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import 'package:flutter/material.dart';
22

33
class CosmosPasswordField extends StatefulWidget {
44
final Function(String) onPasswordUpdated;
5+
final String? helperText;
6+
final String hintText;
57

6-
const CosmosPasswordField({required this.onPasswordUpdated});
8+
const CosmosPasswordField({
9+
required this.onPasswordUpdated,
10+
this.helperText = 'This password will be used to recover your account every time you log in to the app',
11+
this.hintText = 'Enter password',
12+
});
713

814
@override
915
_CosmosPasswordFieldState createState() => _CosmosPasswordFieldState();
@@ -22,8 +28,8 @@ class _CosmosPasswordFieldState extends State<CosmosPasswordField> {
2228
widget.onPasswordUpdated(value);
2329
},
2430
decoration: InputDecoration(
25-
hintText: 'Enter password',
26-
helperText: 'This password will be used to recover your account every time you log in to the app',
31+
hintText: widget.hintText,
32+
helperText: widget.helperText,
2733
helperMaxLines: 3,
2834
suffixIcon: InkWell(
2935
onTap: togglePasswordVisibility,

packages/cosmos_ui_components/lib/cosmos_app_theme.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class CosmosAppTheme {
3131
brightness: Brightness.light,
3232
backgroundColor: CosmosColors.lightBg,
3333
foregroundColor: CosmosColors.onLightText,
34+
actionsIconTheme: IconThemeData(
35+
color: CosmosColors.onLightText,
36+
),
3437
textTheme: TextTheme(
3538
headline6: TextStyle(
3639
fontSize: 20,

0 commit comments

Comments
 (0)