58 lines
1.8 KiB
Dart
58 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:initial_folder/size_config.dart';
|
|
import 'package:initial_folder/theme.dart';
|
|
|
|
class Header extends StatelessWidget {
|
|
const Header(
|
|
{Key? key,
|
|
this.text = '',
|
|
this.text2 = '',
|
|
required this.style,
|
|
this.jarak = 20,
|
|
this.title = true})
|
|
: super(key: key);
|
|
final String text;
|
|
final String text2;
|
|
final TextStyle style;
|
|
final double jarak;
|
|
final bool title;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final Brightness brightnessValue =
|
|
MediaQuery.of(context).platformBrightness;
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
|
return Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
title == true
|
|
? Image.asset(
|
|
isDarkMode
|
|
? 'assets/images/VOCASIA logo.png'
|
|
: 'assets/images/VOCASIA logo dark.png',
|
|
width: getProportionateScreenWidth(150),
|
|
height: getProportionateScreenHeight(50),
|
|
)
|
|
: Text(text2,
|
|
textAlign: TextAlign.center,
|
|
style: thirdTextStyle.copyWith(
|
|
color: isDarkMode ? baruTextutih : baruTexthitam,
|
|
fontWeight: bold,
|
|
fontSize: getProportionateScreenWidth(20),
|
|
letterSpacing: 0.23)),
|
|
SizedBox(height: getProportionateScreenHeight(jarak)),
|
|
// Padding(
|
|
// padding:
|
|
// EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(16)),
|
|
// child: Text(text,
|
|
// maxLines: 2,
|
|
// textAlign: TextAlign.justify,
|
|
// style: thirdTextStyle.copyWith(
|
|
// color: isDarkMode ? baruTexthitam : baruTextutih,
|
|
// )),
|
|
// ),
|
|
],
|
|
);
|
|
}
|
|
}
|