-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mpl widgets of
MasterPassword
screen (inProgress) #41
- Loading branch information
1 parent
619a160
commit ae5c7d7
Showing
15 changed files
with
438 additions
and
19 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomFilledButton extends StatelessWidget { | ||
const CustomFilledButton( | ||
{super.key, | ||
required this.label, | ||
required this.onPressed, | ||
this.backgroundColor, | ||
this.textColor, | ||
required this.borderRadius, | ||
required this.elevation, | ||
required this.padding, | ||
this.icon}); | ||
final String label; | ||
final VoidCallback onPressed; | ||
final Color? backgroundColor; | ||
final Color? textColor; | ||
final double borderRadius; | ||
final double elevation; | ||
final EdgeInsets padding; | ||
final IconData? icon; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: backgroundColor ?? Theme.of(context).primaryColor, | ||
foregroundColor: textColor ?? Colors.white, | ||
padding: padding, | ||
elevation: elevation, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(borderRadius), | ||
), | ||
), | ||
onPressed: onPressed, | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
if (icon != null) ...[ | ||
Icon(icon, color: textColor ?? Colors.white), | ||
const SizedBox(width: 8), | ||
], | ||
Text( | ||
label, | ||
style: TextStyle( | ||
color: textColor ?? Colors.white, | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
lib/src/features/password/presentation/cubits/master_password_handler_cubit.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,7 @@ | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class MasterPasswordHandlerCubit extends Cubit<bool> { | ||
MasterPasswordHandlerCubit() : super(true); | ||
|
||
void toggleVisibility() => emit(!state); | ||
} |
Oops, something went wrong.