Commit 5acb8eac authored by Budi Prasetyo's avatar Budi Prasetyo

kerangka

parent 2aaaf004
Pipeline #399 failed with stages
import 'package:flutter/material.dart';
import 'package:medapp_eksad/widget/button_appbar.dart';
AppBar AppbarHomeLarge(Size screenSize, BuildContext context, Color home,
Color aboutUs, Color ourServices, Color career, Color contactUs) {
return AppBar(
backgroundColor: Colors.white,
toolbarHeight: 100,
leadingWidth: screenSize.width * 0.3,
leading: Row(
children: [
Container(
width: screenSize.width * 0.1,
),
IconButton(
onPressed: () {
Navigator.pushNamed(context, '/');
},
icon: const Image(
image: AssetImage('assets/logo/protalent.png'),
width: 500,
height: 200,
),
iconSize: 190,
),
],
),
title: Row(
children: [
ButtonAppbar_baru(arah: '/', menu: 'Home', warna: home),
const Spacer(
flex: 1,
),
ButtonAppbar_baru(arah: '/', menu: 'About Us', warna: aboutUs),
const Spacer(
flex: 1,
),
ButtonAppbar_baru(
arah: '/service', menu: 'Our Services', warna: ourServices),
const Spacer(
flex: 1,
),
ButtonAppbar_baru(arah: '/career', menu: 'Career', warna: career),
const Spacer(
flex: 1,
),
ButtonAppbar_baru(
arah: '/contact', menu: 'Contact Us', warna: contactUs),
const Spacer(
flex: 2,
),
TextButton(
onPressed: () {
Navigator.pushNamed(context, '/login');
},
child: const Text(
'Login',
style: TextStyle(
fontSize: 19, fontWeight: FontWeight.w500, color: Colors.black),
),
),
Container(
width: screenSize.width * 0.006,
),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/register');
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
fixedSize: const Size(130, 45),
onPrimary: Colors.red,
),
child: const Text(
'Register',
style: TextStyle(
color: Colors.white, fontSize: 19, fontWeight: FontWeight.w500),
),
),
const Spacer(
flex: 5,
),
],
),
);
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/widget/responsive.dart';
class HomePage extends StatefulWidget {
......@@ -9,9 +11,42 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Container();
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
appBar: ResponsiveWidget.isSmallScreen(context)
? AppBarKecil()
: AppbarHomeLarge(screenSize, context, Colors.blue, Colors.blue,
Colors.black, Colors.black, Colors.black),
body: ListView(
),
);
}
AppBar AppBarKecil() {
return AppBar(
leading: IconButton(
onPressed: () => _scaffoldKey.currentState!.openDrawer(),
icon: Icon(Icons.list_outlined,size: 30,color: Colors.black,),),
backgroundColor: Colors.white,
centerTitle: true,
title: Container(
child: SizedBox(
height: 50,
width: 150,
child: Image.asset("assets/logo/logo_protalent.png"),
),
),
// ),
);
}
}
import 'package:flutter/material.dart';
class ButtonAppbar_baru extends StatelessWidget {
const ButtonAppbar_baru(
{Key? key, required this.arah, required this.menu, required this.warna})
: super(key: key);
final String menu;
final String arah;
final Color warna;
@override
Widget build(BuildContext context) {
return Container(
child: TextButton(
onPressed: () {
Navigator.pushNamed(context, arah);
},
style: ButtonStyle(
foregroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered))
// ignore: curly_braces_in_flow_control_structures
return Colors.blue;
return warna; // null throus error in flutter 2.2+.
}),
),
child: Text(
menu,
style: const TextStyle(
fontSize: 18,
letterSpacing: 1.1,
fontWeight: FontWeight.w500,
),
),
),
);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment