You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.0 KiB
Dart
76 lines
2.0 KiB
Dart
4 years ago
|
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'),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
]),
|
||
|
));
|
||
|
}
|
||
|
}
|