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.
doctor_app_flutter/lib/widgets/auth/auth_header.dart

101 lines
3.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_device_type/flutter_device_type.dart';
class AuthHeader extends StatelessWidget {
const AuthHeader({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
print(Device.get().isPhone);
print(Device.get().isAndroid);
print(Device.get().isIos);
var smallScreenSize = 660;
return LayoutBuilder(builder: (ctx, constraints) {
bool isSmallScreen = constraints.maxWidth<=smallScreenSize;
var screen = Container(
margin: isSmallScreen?null:EdgeInsetsDirectional.fromSTEB(constraints.maxWidth*0.30, constraints.maxWidth*0.1, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: isSmallScreen?EdgeInsetsDirectional.fromSTEB(0, 50, 0, 0):EdgeInsetsDirectional.fromSTEB(constraints.maxWidth*0.13, 0, 0, 0),
child: Image.asset(
'assets/images/login_icon.png',
fit: BoxFit.cover,
height: isSmallScreen?null: constraints.maxWidth*0.09,
),
),
SizedBox(
height: 10,
),
Container(
margin: isSmallScreen?null:EdgeInsetsDirectional.fromSTEB(constraints.maxWidth*0.13, 0, 0, 0),
child: Text(
"LOGIN",
style: TextStyle(fontSize: isSmallScreen?30:constraints.maxWidth*0.035, fontWeight: FontWeight.w800),
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: isSmallScreen?<Widget>[
SizedBox(
height: 10,
),
Text(
"Welcome to",
style: TextStyle(fontSize: isSmallScreen?24:constraints.maxWidth*0.029),
),
Text(
'Dr Sulaiman Al Habib',
style: TextStyle(
fontSize: isSmallScreen?24:constraints.maxWidth*0.029,
color: Theme.of(context).primaryColor,
),
),
]:<Widget>[SizedBox(
height: 10,
),Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
"Welcome to ",
style: TextStyle(fontSize: isSmallScreen?24:constraints.maxWidth*0.029),
),
Text(
'Dr Sulaiman Al Habib',
style: TextStyle(
fontSize: isSmallScreen?24:constraints.maxWidth*0.029,
color: Theme.of(context).primaryColor,
),
),
],
),Container(
margin: isSmallScreen?null:EdgeInsetsDirectional.fromSTEB(constraints.maxWidth*0.13, 0, 0, 0),
child: Text(
"Doctor App",
style: TextStyle(
fontSize: isSmallScreen?26:constraints.maxWidth*0.030, color: Theme.of(context).primaryColor),
),
)],
)
],
));
return screen;
});
}
}