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.
57 lines
1.6 KiB
Dart
57 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tangheem/extensions/int_extensions.dart';
|
|
import 'package:tangheem/extensions/string_extensions.dart';
|
|
|
|
class CommonHeader extends StatelessWidget {
|
|
final String title;
|
|
final Color gradiantColor;
|
|
final String assetImage;
|
|
final double ratio;
|
|
|
|
CommonHeader(this.title, this.assetImage, this.gradiantColor, {Key key,this.ratio}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AspectRatio(
|
|
aspectRatio: ratio ?? 469 / 313,
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.transparent,
|
|
image: DecorationImage(
|
|
fit: BoxFit.cover,
|
|
image: AssetImage(assetImage),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
gradient: LinearGradient(
|
|
begin: FractionalOffset.bottomLeft,
|
|
end: FractionalOffset.topRight,
|
|
colors: [
|
|
Color(0x00FFFFFF),
|
|
gradiantColor.withOpacity(.75),
|
|
gradiantColor,
|
|
],
|
|
stops: [0.0, 0.45, 1.0],
|
|
),
|
|
),
|
|
),
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50),
|
|
26.height,
|
|
title.toText(30),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|