textfiled and app button design change

merge-requests/913/head
hussam al-habibeh 4 years ago
parent bd7e683900
commit 3bfee08b9d

@ -36,7 +36,8 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<AuthenticationViewModel>(create: (context) => AuthenticationViewModel()), ChangeNotifierProvider<AuthenticationViewModel>(
create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),
@ -67,7 +68,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
primaryColor: Colors.grey, primaryColor: Colors.grey,
buttonColor: HexColor('#B8382C'), buttonColor: HexColor('#D02127'),
fontFamily: 'Poppins', fontFamily: 'Poppins',
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),

@ -196,7 +196,7 @@ class _LoginScreenState extends State<LoginScreen> {
AppButton( AppButton(
title: TranslationBase.of(context).login, title: TranslationBase.of(context).login,
color: Color(0xFFD02127), color: Color(0xFFD02127),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
disabled: authenticationViewModel.userInfo.userID == null || disabled: authenticationViewModel.userInfo.userID == null ||
authenticationViewModel.userInfo.password == null, authenticationViewModel.userInfo.password == null,
onPressed: () { onPressed: () {

@ -29,7 +29,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
padding: EdgeInsets.all(40), padding: EdgeInsets.all(40),
decoration: BoxDecoration( decoration: BoxDecoration(
border: border:
Border.all(color: HexColor('#B8382C'), width: 4), Border.all(color: HexColor('#D02127'), width: 4),
borderRadius: BorderRadius.all(Radius.circular(100))), borderRadius: BorderRadius.all(Radius.circular(100))),
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -54,10 +56,13 @@ class _AppButtonState extends State<AppButton> {
// height: MediaQuery.of(context).size.height * 0.075, // height: MediaQuery.of(context).size.height * 0.075,
height: widget.height, height: widget.height,
child: IgnorePointer( child: IgnorePointer(
ignoring: widget.loading ||widget.disabled, ignoring: widget.loading || widget.disabled,
child: RawMaterialButton( child: RawMaterialButton(
fillColor: widget.disabled fillColor: widget.disabled
? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), ? Colors.grey
: widget.color != null
? widget.color
: HexColor("#D02127"),
splashColor: widget.color, splashColor: widget.color,
child: Padding( child: Padding(
padding: (widget.hPadding > 0 || widget.vPadding > 0) padding: (widget.hPadding > 0 || widget.vPadding > 0)
@ -103,18 +108,21 @@ class _AppButtonState extends State<AppButton> {
widget.title, widget.title,
color: widget.fontColor, color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize, fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
), ),
], ],
), ),
), ),
onPressed: widget.disabled ? (){} : widget.onPressed, onPressed: widget.disabled ? () {} : widget.onPressed,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: color: widget.hasBorder
widget.hasBorder ? widget.borderColor : widget.disabled ? widget.borderColor
? Colors.grey : widget.color ?? Color(0xFFB8382C), : widget.disabled
? Colors.grey
: widget.color ?? Color(0xFFB8382C),
width: 0.8, width: 0.8,
), ),
borderRadius: BorderRadius.all(Radius.circular(widget.radius))), borderRadius: BorderRadius.all(Radius.circular(widget.radius))),

@ -102,7 +102,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Color(0Xffffffff), Color(0Xffffffff),
widget.validationError == null widget.validationError == null
? Color(0xFFEFEFEF) ? Color(0xFFEFEFEF)
: Colors.red.shade700) : Colors.red.shade700,
)
: null, : null,
padding: padding:
EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0),
@ -116,8 +117,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
padding: widget.dropDownText == null padding: widget.dropDownText == null
? widget.isSearchTextField ? widget.isSearchTextField
? EdgeInsets.only(top: 10) ? EdgeInsets.only(top: 10)
: EdgeInsets.symmetric(vertical: 0) : EdgeInsets.only(top: 7.5)
: EdgeInsets.symmetric(vertical: 0), // 8.0 : EdgeInsets.only(top: 0), // 8.0
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -135,6 +136,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
// (SizeConfig.isWidthLarge ? 1.1 : 1.3) // (SizeConfig.isWidthLarge ? 1.1 : 1.3)
: 0, : 0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
letterSpacing: -0.44,
fontFamily: 'Poppins',
), ),
widget.dropDownText == null widget.dropDownText == null
? Container( ? Container(
@ -147,14 +150,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? TextAlign.right ? TextAlign.right
: TextAlign.left, : TextAlign.left,
focusNode: _focusNode, focusNode: _focusNode,
textAlignVertical: TextAlignVertical.center, textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils decoration: TextFieldsUtils
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize:
14.0, //SizeConfig.textMultiplier * 1.7,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w400,
letterSpacing: -0.56,
), ),
controller: widget.controller, controller: widget.controller,
keyboardType: widget.inputType ?? keyboardType: widget.inputType ??
@ -203,7 +209,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Icons.keyboard_arrow_down, Icons.keyboard_arrow_down,
color: widget.dropDownColor != null color: widget.dropDownColor != null
? widget.dropDownColor ? widget.dropDownColor
: Colors.black, : Color(0xff2E303A),
size: 12.0,
), ),
) )
: Container(), : Container(),

@ -1,10 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TextFieldsUtils{ class TextFieldsUtils {
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor, Color containerColor, Color borderColor,
{double borderWidth = -1, double borderRadius = 12}) { {double borderWidth = -1, double borderRadius = 10.0}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -46,13 +45,15 @@ class TextFieldsUtils{
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),*/ ),*/
hintText: selectedText != null ? selectedText : hintText??"", hintText: selectedText != null ? selectedText : hintText ?? "",
suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), suffixIcon: Icon(
suffixIcon ?? null,
color: Colors.grey.shade600,
),
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 11,
color: Colors.grey.shade600, color: Colors.grey.shade600,
), ),
); );
} }
} }

Loading…
Cancel
Save