-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
429 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:rtu_mirea_app/presentation/theme.dart'; | ||
import 'package:rtu_mirea_app/presentation/typography.dart'; | ||
|
||
class TextInput extends StatelessWidget { | ||
const TextInput({ | ||
Key? key, | ||
this.hintText, | ||
this.errorText, | ||
this.controller, | ||
this.keyboardType, | ||
this.maxLines, | ||
this.fillColor, | ||
}) : super(key: key); | ||
|
||
final String? hintText; | ||
final String? errorText; | ||
final TextEditingController? controller; | ||
final TextInputType? keyboardType; | ||
final int? maxLines; | ||
final Color? fillColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TextField( | ||
maxLines: maxLines, | ||
decoration: InputDecoration( | ||
errorText: errorText, | ||
errorStyle: AppTextStyle.captionL.copyWith( | ||
color: AppTheme.colors.colorful07, | ||
), | ||
hintText: hintText, | ||
hintStyle: AppTextStyle.titleS.copyWith( | ||
color: AppTheme.colors.deactive, | ||
), | ||
contentPadding: const EdgeInsets.symmetric( | ||
horizontal: 16, | ||
vertical: 12, | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide( | ||
color: AppTheme.colors.primary, | ||
), | ||
), | ||
focusedErrorBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide( | ||
color: AppTheme.colors.colorful07, | ||
), | ||
), | ||
disabledBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: const BorderSide( | ||
color: Colors.transparent, | ||
width: 0, | ||
), | ||
), | ||
enabledBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: const BorderSide( | ||
color: Colors.transparent, | ||
width: 0, | ||
), | ||
), | ||
errorBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide( | ||
color: AppTheme.colors.colorful07, | ||
), | ||
), | ||
fillColor: fillColor ?? AppTheme.colors.background01, | ||
filled: true, | ||
), | ||
keyboardType: keyboardType, | ||
textInputAction: TextInputAction.done, | ||
style: AppTextStyle.titleS, | ||
controller: controller, | ||
); | ||
} | ||
} |
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
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
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.