Skip to content

Commit

Permalink
cosmos_ui_components improvements (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejchm authored Sep 6, 2021
1 parent d9580f1 commit d8ee796
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import 'package:flutter/material.dart';

class CosmosAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget>? actions;

const CosmosAppBar({
Key? key,
this.title = "",
this.actions,
}) : super(key: key);

@override
Widget build(BuildContext context) {
return AppBar(
title: Text(title),
actions: actions,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import 'package:flutter/material.dart';

class CosmosPasswordField extends StatefulWidget {
final Function(String) onPasswordUpdated;
final String? helperText;
final String hintText;

const CosmosPasswordField({required this.onPasswordUpdated});
const CosmosPasswordField({
required this.onPasswordUpdated,
this.helperText = 'This password will be used to recover your account every time you log in to the app',
this.hintText = 'Enter password',
});

@override
_CosmosPasswordFieldState createState() => _CosmosPasswordFieldState();
Expand All @@ -22,8 +28,8 @@ class _CosmosPasswordFieldState extends State<CosmosPasswordField> {
widget.onPasswordUpdated(value);
},
decoration: InputDecoration(
hintText: 'Enter password',
helperText: 'This password will be used to recover your account every time you log in to the app',
hintText: widget.hintText,
helperText: widget.helperText,
helperMaxLines: 3,
suffixIcon: InkWell(
onTap: togglePasswordVisibility,
Expand Down
3 changes: 3 additions & 0 deletions packages/cosmos_ui_components/lib/cosmos_app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class CosmosAppTheme {
brightness: Brightness.light,
backgroundColor: CosmosColors.lightBg,
foregroundColor: CosmosColors.onLightText,
actionsIconTheme: IconThemeData(
color: CosmosColors.onLightText,
),
textTheme: TextTheme(
headline6: TextStyle(
fontSize: 20,
Expand Down

0 comments on commit d8ee796

Please sign in to comment.