no message
parent
d897463b42
commit
8dd38a8b3c
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,87 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ForgotPassword extends StatelessWidget {
|
||||||
|
final String selectedType = 'Saudi Arabia';
|
||||||
|
final TextEditingController nationalIDorFile = null;
|
||||||
|
final TextEditingController mobileNo = null;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).login,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||||
|
height: SizeConfig.realScreenHeight * .8,
|
||||||
|
width: SizeConfig.realScreenWidth,
|
||||||
|
child: Column(children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).enterNationalId,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
// add Expanded to have your dropdown button fill remaining space
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton(
|
||||||
|
isExpanded: true,
|
||||||
|
value: selectedType,
|
||||||
|
iconSize: 40,
|
||||||
|
elevation: 16,
|
||||||
|
// selectedItemBuilder:
|
||||||
|
// (BuildContext context) {},
|
||||||
|
onChanged: (String newValue) => {},
|
||||||
|
items: <String>[
|
||||||
|
'Saudi Arabia',
|
||||||
|
'Dubai',
|
||||||
|
].map<DropdownMenuItem<String>>(
|
||||||
|
(String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList()))),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
MobileNo(controller: mobileNo),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: RaisedButton(
|
||||||
|
color: Colors.grey,
|
||||||
|
textColor: Colors.white,
|
||||||
|
child: Text(TranslationBase.of(context).submit),
|
||||||
|
onPressed: () => {},
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
]),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,139 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/routes.dart';
|
||||||
|
|
||||||
|
class LoginType extends StatelessWidget {
|
||||||
|
static int loginType = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).welcome,
|
||||||
|
body: Padding(
|
||||||
|
padding: EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/habib-logo.png',
|
||||||
|
height: 80,
|
||||||
|
width: 80,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).logintypeRadio,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
onTap: () => {
|
||||||
|
LoginType.loginType = 2,
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamed(LOGIN_PAGE)
|
||||||
|
},
|
||||||
|
child: RoundedContainer(
|
||||||
|
borderColor: Colors.grey,
|
||||||
|
showBorder: true,
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.fromLTRB(20, 10, 20, 10),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/id_card_icon.png',
|
||||||
|
height: 60,
|
||||||
|
width: 70,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.nationalID,
|
||||||
|
fontSize:
|
||||||
|
SizeConfig.textMultiplier * 3,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
InkWell(
|
||||||
|
onTap: () => {
|
||||||
|
LoginType.loginType = 1,
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamed(LOGIN_PAGE)
|
||||||
|
},
|
||||||
|
child: RoundedContainer(
|
||||||
|
borderColor: Colors.grey,
|
||||||
|
showBorder: true,
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.fromLTRB(25, 10, 25, 10),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/my_file_white_icon.png',
|
||||||
|
height: 60,
|
||||||
|
width: 70,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).fileNo,
|
||||||
|
fontSize:
|
||||||
|
SizeConfig.textMultiplier * 3,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
color: Colors.grey,
|
||||||
|
height: 2,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).forgotPassword,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3,
|
||||||
|
margin: 10,
|
||||||
|
underline: true))
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: RaisedButton(
|
||||||
|
color: Colors.grey,
|
||||||
|
textColor: Colors.white,
|
||||||
|
child:
|
||||||
|
Text(TranslationBase.of(context).registerNow),
|
||||||
|
onPressed: () => {},
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,106 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Login extends StatelessWidget {
|
||||||
|
final String _selectedType = 'Saudi Arabia';
|
||||||
|
final TextEditingController nationalIDorFile = null;
|
||||||
|
final int loginType = LoginType.loginType;
|
||||||
|
final TextEditingController mobileNo = null;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).login,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||||||
|
height: SizeConfig.realScreenHeight * .8,
|
||||||
|
width: SizeConfig.realScreenWidth,
|
||||||
|
child: Column(children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).enterNationalId,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
// add Expanded to have your dropdown button fill remaining space
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton(
|
||||||
|
isExpanded: true,
|
||||||
|
value: _selectedType,
|
||||||
|
iconSize: 40,
|
||||||
|
elevation: 16,
|
||||||
|
// selectedItemBuilder:
|
||||||
|
// (BuildContext context) {},
|
||||||
|
onChanged: (String newValue) => {},
|
||||||
|
items: <String>[
|
||||||
|
'Saudi Arabia',
|
||||||
|
'Dubai',
|
||||||
|
].map<DropdownMenuItem<String>>(
|
||||||
|
(String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList()))),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
MobileNo(controller: mobileNo),
|
||||||
|
Container(
|
||||||
|
child: TextFields(
|
||||||
|
controller: nationalIDorFile,
|
||||||
|
prefixIcon: Icon(
|
||||||
|
loginType == 1
|
||||||
|
? Icons.receipt
|
||||||
|
: Icons.chrome_reader_mode,
|
||||||
|
color: Colors.red),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 20, bottom: 20, left: 10, right: 10),
|
||||||
|
hintText: loginType == 1
|
||||||
|
? TranslationBase.of(context).fileNo
|
||||||
|
: TranslationBase.of(context).nationalID,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: RaisedButton(
|
||||||
|
color: Colors.grey,
|
||||||
|
textColor: Colors.white,
|
||||||
|
child: Text(TranslationBase.of(context).login),
|
||||||
|
onPressed: () => {},
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
]),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,19 @@
|
|||||||
import 'package:diplomaticquarterapp/pages/landing_page.dart';
|
import 'package:diplomaticquarterapp/pages/landing_page.dart';
|
||||||
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
|
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/login/login.dart';
|
||||||
|
|
||||||
const String INIT_ROUTE = '/';
|
const String INIT_ROUTE = '/';
|
||||||
const String ROOT = 'root';
|
const String ROOT = 'root';
|
||||||
const String HOME = '/';
|
const String HOME = '/';
|
||||||
const String LOGIN = 'login';
|
const String LOGIN = 'login';
|
||||||
const String WELCOME_LOGIN = 'welcome-login';
|
const String WELCOME_LOGIN = 'welcome-login';
|
||||||
|
const String LOGIN_TYPE = 'login-type';
|
||||||
|
const String LOGIN_PAGE = 'login-page';
|
||||||
var routes = {
|
var routes = {
|
||||||
// ROOT: (_) => RootPage(),
|
// ROOT: (_) => RootPage(),
|
||||||
HOME: (_) => LandingPage(),
|
HOME: (_) => LandingPage(),
|
||||||
WELCOME_LOGIN: (_) => WelcomeLogin(),
|
WELCOME_LOGIN: (_) => WelcomeLogin(),
|
||||||
|
LOGIN_TYPE: (_) => LoginType(),
|
||||||
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
|
LOGIN_PAGE: (_) => Login(),
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,88 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// OWNER : Ibrahim albitar
|
||||||
|
// DATE : 05-04-2020
|
||||||
|
// DESCRIPTION : Custom widget for rounded container and custom decoration
|
||||||
|
|
||||||
|
class RoundedContainer extends StatefulWidget {
|
||||||
|
final double width;
|
||||||
|
final double height;
|
||||||
|
final double raduis;
|
||||||
|
final Color backgroundColor;
|
||||||
|
final double margin;
|
||||||
|
final double elevation;
|
||||||
|
final bool showBorder;
|
||||||
|
final Color borderColor;
|
||||||
|
final bool customCornerRaduis;
|
||||||
|
final double topLeft;
|
||||||
|
final double bottomRight;
|
||||||
|
final double topRight;
|
||||||
|
final double bottomLeft;
|
||||||
|
final Widget child;
|
||||||
|
final double borderWidth;
|
||||||
|
|
||||||
|
RoundedContainer(
|
||||||
|
{@required this.child,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.raduis = 10,
|
||||||
|
this.backgroundColor = Colors.white,
|
||||||
|
this.margin = 10,
|
||||||
|
this.elevation = 1,
|
||||||
|
this.showBorder = false,
|
||||||
|
this.borderColor = Colors.red,
|
||||||
|
this.customCornerRaduis = false,
|
||||||
|
this.topLeft = 0,
|
||||||
|
this.topRight = 0,
|
||||||
|
this.bottomRight = 0,
|
||||||
|
this.bottomLeft = 0,
|
||||||
|
this.borderWidth = 1});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RoundedContainerState createState() => _RoundedContainerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RoundedContainerState extends State<RoundedContainer> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: widget.width,
|
||||||
|
height: widget.height,
|
||||||
|
margin: EdgeInsets.all(widget.margin),
|
||||||
|
decoration: widget.showBorder == true
|
||||||
|
? BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: widget.borderColor, width: widget.borderWidth),
|
||||||
|
borderRadius: widget.customCornerRaduis
|
||||||
|
? BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(widget.topLeft),
|
||||||
|
topRight: Radius.circular(widget.topRight),
|
||||||
|
bottomRight: Radius.circular(widget.bottomRight),
|
||||||
|
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||||
|
: BorderRadius.circular(widget.raduis),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey.withOpacity(0.1),
|
||||||
|
spreadRadius: 10,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 5), // changes position of shadow
|
||||||
|
),
|
||||||
|
])
|
||||||
|
: null,
|
||||||
|
child: Card(
|
||||||
|
margin: EdgeInsets.all(0),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: widget.customCornerRaduis
|
||||||
|
? BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(widget.topLeft),
|
||||||
|
topRight: Radius.circular(widget.topRight),
|
||||||
|
bottomRight: Radius.circular(widget.bottomRight),
|
||||||
|
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||||
|
: BorderRadius.circular(widget.raduis),
|
||||||
|
),
|
||||||
|
color: widget.backgroundColor,
|
||||||
|
child: widget.child,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// OWNER : Ibrahim albitar
|
||||||
|
// DATE : 12-04-2020
|
||||||
|
// DESCRIPTION : Customization for Texts in app
|
||||||
|
|
||||||
|
class MobileNo extends StatefulWidget {
|
||||||
|
final bool disabled;
|
||||||
|
// final String data;
|
||||||
|
final String countryCode;
|
||||||
|
final double margin;
|
||||||
|
final double marginTop;
|
||||||
|
final double marginRight;
|
||||||
|
final double marginBottom;
|
||||||
|
final double marginLeft;
|
||||||
|
final TextEditingController controller;
|
||||||
|
MobileNo(
|
||||||
|
{this.disabled = false,
|
||||||
|
this.countryCode = '966',
|
||||||
|
this.marginTop = 0,
|
||||||
|
this.marginRight = 0,
|
||||||
|
this.marginBottom = 0,
|
||||||
|
this.controller,
|
||||||
|
this.marginLeft = 0,
|
||||||
|
this.margin = 0});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_MobileNo createState() => _MobileNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MobileNo extends State<MobileNo> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Visibility(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.grey),
|
||||||
|
borderRadius: BorderRadius.circular(10)),
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Icon(
|
||||||
|
Icons.phone,
|
||||||
|
color: Colors.red,
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
widget.countryCode,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Container(
|
||||||
|
margin: widget.margin != null
|
||||||
|
? EdgeInsets.all(widget.margin)
|
||||||
|
: EdgeInsets.only(
|
||||||
|
top: widget.marginTop,
|
||||||
|
right: widget.marginRight,
|
||||||
|
bottom: widget.marginBottom,
|
||||||
|
left: widget.marginLeft),
|
||||||
|
child: TextField(
|
||||||
|
controller: widget.controller,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: InputBorder.none, hintText: '5xxxxxxxx'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// OWNER : Ibrahim albitar
|
||||||
|
// DATE : 12-04-2020
|
||||||
|
// DESCRIPTION : Customization for Texts in app
|
||||||
|
|
||||||
|
class AppText extends StatefulWidget {
|
||||||
|
final String data;
|
||||||
|
final Color color;
|
||||||
|
final FontWeight fontWeight;
|
||||||
|
final double fontSize;
|
||||||
|
final String fontFamily;
|
||||||
|
final double margin;
|
||||||
|
final double marginTop;
|
||||||
|
final double marginRight;
|
||||||
|
final double marginBottom;
|
||||||
|
final double marginLeft;
|
||||||
|
final bool visibility;
|
||||||
|
final TextAlign textAlign;
|
||||||
|
final Color backGroundcolor;
|
||||||
|
final bool underline;
|
||||||
|
AppText(this.data,
|
||||||
|
{this.color = Colors.black,
|
||||||
|
this.fontWeight = FontWeight.normal,
|
||||||
|
this.fontSize,
|
||||||
|
this.fontFamily = 'WorkSans',
|
||||||
|
this.margin,
|
||||||
|
this.marginTop = 0,
|
||||||
|
this.marginRight = 0,
|
||||||
|
this.marginBottom = 0,
|
||||||
|
this.marginLeft = 0,
|
||||||
|
this.visibility = true,
|
||||||
|
this.textAlign,
|
||||||
|
this.underline = false,
|
||||||
|
this.backGroundcolor = Colors.white});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AppTextState createState() => _AppTextState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppTextState extends State<AppText> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Visibility(
|
||||||
|
visible: widget.visibility,
|
||||||
|
child: Container(
|
||||||
|
margin: widget.margin != null
|
||||||
|
? EdgeInsets.all(widget.margin)
|
||||||
|
: EdgeInsets.only(
|
||||||
|
top: widget.marginTop,
|
||||||
|
right: widget.marginRight,
|
||||||
|
bottom: widget.marginBottom,
|
||||||
|
left: widget.marginLeft),
|
||||||
|
child: Text(
|
||||||
|
widget.data,
|
||||||
|
textAlign: widget.textAlign,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
color: widget.color,
|
||||||
|
fontWeight: widget.fontWeight,
|
||||||
|
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2),
|
||||||
|
fontFamily: widget.fontFamily,
|
||||||
|
decoration: widget.underline == true
|
||||||
|
? TextDecoration.underline
|
||||||
|
: TextDecoration.none
|
||||||
|
// backgroundColor:widget.backGroundcolor
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue