Commit c7419aa8 authored by Budi Prasetyo's avatar Budi Prasetyo
parents 3f11b019 d1c211a5
...@@ -27,18 +27,18 @@ Future<bool> createSetting(im, tt, em, no) async { ...@@ -27,18 +27,18 @@ Future<bool> createSetting(im, tt, em, no) async {
} }
} }
Future<bool> updateSetting(id, image, name, title, email, no,) async { Future<bool> updateSetting(id, title, email, no,) async {
final response = await http final response = await http
.put(Uri.parse('$cmd/setting/updateSetting'), .put(Uri.parse('$cmd/setting/updateSetting'),
body: jsonEncode({ body: jsonEncode({
"idsetting": id, "idsetting": id,
"image": image, // "image": image,
"name": name, //"name": name,
"title": title, "title": title,
// "tagline": tagline, // "tagline": tagline,
"email": email, "email": email,
"no": no, "no": no,
"idrole": "R001",
}), }),
headers: { headers: {
'Content-type': 'application/json; charset=UTF-8', 'Content-type': 'application/json; charset=UTF-8',
...@@ -61,3 +61,9 @@ Future<List<dynamic>> getSettingDesc() async { ...@@ -61,3 +61,9 @@ Future<List<dynamic>> getSettingDesc() async {
Uri.parse('$qry/setting/getSettingByIdDesc')); Uri.parse('$qry/setting/getSettingByIdDesc'));
return jsonDecode(response.body)['data']; return jsonDecode(response.body)['data'];
} }
Future<dynamic> getSettingDesc2() async {
var response = await http.get(
Uri.parse('$qry/setting/getSettingByIdDesc'));
return jsonDecode(response.body)['data'];
}
\ No newline at end of file
...@@ -146,10 +146,10 @@ class _Dashboard4State extends State<Dashboard4> { ...@@ -146,10 +146,10 @@ class _Dashboard4State extends State<Dashboard4> {
content: Form( content: Form(
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenSize.width * 0.045, left: screenSize.width * 0.040,
top: screenSize.height * 0.01), top: screenSize.height * 0.01),
width: screenSize.width * 0.50, width: screenSize.width * 0.55,
height: screenSize.height * 0.50, height: screenSize.height * 0.55,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
......
...@@ -59,7 +59,7 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -59,7 +59,7 @@ class _SettingDashboardState extends State<SettingDashboard> {
String id = ''; String id = '';
String im = ''; String im = '';
String tt = ''; String tt = '';
String tl = '';
String em = ''; String em = '';
String no = ''; String no = '';
final String role = 'MCS'; final String role = 'MCS';
...@@ -76,19 +76,24 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -76,19 +76,24 @@ class _SettingDashboardState extends State<SettingDashboard> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 10,), SizedBox(
height: 10,
),
const Text( const Text(
"General Setting", "General Setting",
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
color: Colors.black, fontSize: 37, fontWeight: FontWeight.bold), color: Colors.black, fontSize: 37, fontWeight: FontWeight.bold),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
Container( Container(
color: Colors.white, color: Colors.white,
height: screenSize.height*0.75, height: screenSize.height * 0.75,
width: screenSize.width*0.7, width: screenSize.width * 0.7,
padding: const EdgeInsets.only(left: 30,top: 15,right: 20,bottom: 15), padding:
const EdgeInsets.only(left: 30, top: 13, right: 20, bottom: 13),
child: Form( child: Form(
key: formKey, key: formKey,
child: Column( child: Column(
...@@ -101,44 +106,115 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -101,44 +106,115 @@ class _SettingDashboardState extends State<SettingDashboard> {
color: Colors.black, color: Colors.black,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.normal)), fontWeight: FontWeight.normal)),
// SizedBox(
// height: 0,
// width: 820, FutureBuilder<List<dynamic>>(
// ), future: getSettingDesc(),
ElevatedButton( builder: (BuildContext context,
style: ElevatedButton.styleFrom( AsyncSnapshot snapshot) {
shape: RoundedRectangleBorder( var pgm = snapshot.data[0];
borderRadius: BorderRadius.circular(5), final mcsController = TextEditingController();
), return ElevatedButton(
primary: const Color.fromARGB(255, 0, 67, 192), style: ElevatedButton.styleFrom(
), shape: RoundedRectangleBorder(
onPressed: () { borderRadius: BorderRadius.circular(5),
switch (btnText) { ),
case 'Save Setting': primary: const Color.fromARGB(255, 0, 67, 192),
createSetting(im.toString(), tt.toString(), ),
em.toString(), no.toString()); onPressed: () {
setState(() { switch (btnText) {
btnText = 'Update Setting'; case 'Save Setting':
enb = false; if(em.isEmpty&&no.isEmpty){
}); updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em=pgm['email'].toString(), no=pgm['no'].toString());
break; print(pgm['idsetting']);
case 'Update Setting': print('if pertama');
setState(() { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title Success'),backgroundColor: Colors.green,),);
enb = true; }else if(tt.isEmpty&&no.isEmpty){
btnText = 'Save Update'; updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em.toString(), no=pgm['no'].toString());
}); print(pgm['idsetting']);
break; print('if kedua');
case 'Save Update': ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Email Success'),backgroundColor: Colors.green,),);
break; }else if(tt.isEmpty&&em.isEmpty){
default: updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em=pgm['email'].toString(), no.toString());
} print('if ketiga');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save No Success'),backgroundColor: Colors.green,),);
}else if(tt.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em.toString(), no.toString());
print('if keempat');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Email and No Success'),backgroundColor: Colors.green,),);
}else if(em.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em=pgm['email'].toString(), no.toString());
print('if kelima');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title and No Success'),backgroundColor: Colors.green,),);
}else if(no.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em.toString(), no=pgm['no'].toString());
print('if keenam');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title and Email Success'),backgroundColor: Colors.green,),);
}
createSetting(im.toString(), tt.toString(),
em.toString(), no.toString());
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Data Success'),backgroundColor: Colors.green,),);
setState(() {
btnText = 'Update Setting';
enb = false;
});
break;
case 'Update Setting':
setState(() {
enb = true;
btnText = 'Save Update';
});
break;
case 'Save Update':
if(em.isEmpty&&no.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em=pgm['email'].toString(), no=pgm['no'].toString());
print(pgm['idsetting']);
print('if pertama');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title Success'),backgroundColor: Colors.green,),);
}else if(tt.isEmpty&&no.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em.toString(), no=pgm['no'].toString());
print(pgm['idsetting']);
print('if kedua');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Email Success'),backgroundColor: Colors.green,),);
}else if(tt.isEmpty&&em.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em=pgm['email'].toString(), no.toString());
print('if ketiga');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save No Success'),backgroundColor: Colors.green,),);
}else if(tt.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt=pgm['title'], em.toString(), no.toString());
print('if keempat');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Email and No Success'),backgroundColor: Colors.green,),);
}else if(em.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em=pgm['email'].toString(), no.toString());
print('if kelima');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title and No Success'),backgroundColor: Colors.green,),);
}else if(no.isEmpty){
updateSetting(id=pgm['idsetting'].toString(), tt.toString(), em.toString(), no=pgm['no'].toString());
print('if keenam');
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Title and Email Success'),backgroundColor: Colors.green,),);
}
createSetting(im.toString(), tt.toString(),
em.toString(), no.toString());
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Save Data Success'),backgroundColor: Colors.green,),);
break;
default:
}
},
child: Text(
btnText,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
);
}, },
child: Text(
btnText,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
), ),
], ],
), ),
const Divider( const Divider(
...@@ -148,11 +224,16 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -148,11 +224,16 @@ class _SettingDashboardState extends State<SettingDashboard> {
// endIndent: 0, // endIndent: 0,
color: Colors.grey, color: Colors.grey,
), ),
SizedBox(height: 25,), Text('Data Must Be Edited'),
Text(
'For data that is not modified, Please copy last data , delete then paste again'),
SizedBox(
height: 25,
),
Row( Row(
children: [ children: [
Container( Container(
height: 230, height: 220,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -235,7 +316,7 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -235,7 +316,7 @@ class _SettingDashboardState extends State<SettingDashboard> {
width: screenSize.width * 0.05, width: screenSize.width * 0.05,
), ),
Container( Container(
height: 230, height: 220,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -256,20 +337,36 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -256,20 +337,36 @@ class _SettingDashboardState extends State<SettingDashboard> {
Container( Container(
height: 40, height: 40,
width: screenSize1 * 0.5, width: screenSize1 * 0.5,
child: TextFormField( child: FutureBuilder<List<dynamic>>(
decoration: const InputDecoration( future: getSettingDesc(),
labelText: "MedApp", builder: (BuildContext context,
hintStyle: TextStyle(), AsyncSnapshot snapshot) {
border: OutlineInputBorder( var pgm = snapshot.data[0];
borderSide: BorderSide( final mcsController = TextEditingController();
width: 1, color: Colors.grey))),
onChanged: (value) => tt = value, if (snapshot.hasError ||
enabled: enb, snapshot.data == null ||
snapshot.connectionState ==
ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return TextFormField(
initialValue: pgm['title'],
decoration: const InputDecoration(
labelText: "MedApp",
hintStyle: TextStyle(),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 1, color: Colors.grey))),
onChanged: (value) => tt = value,
enabled: enb,
);
},
), ),
), ),
// const SizedBox( const SizedBox(
// height: 20, height: 20,
// ), ),
// const Text( // const Text(
// "Site tagline", // "Site tagline",
// style: TextStyle( // style: TextStyle(
...@@ -277,9 +374,9 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -277,9 +374,9 @@ class _SettingDashboardState extends State<SettingDashboard> {
// fontSize: 17, // fontSize: 17,
// fontWeight: FontWeight.bold), // fontWeight: FontWeight.bold),
// ), // ),
// const SizedBox( const SizedBox(
// height: 7, height: 7,
// ), ),
// Container( // Container(
// height: 40, // height: 40,
// width: screenSize1 * 0.5, // width: screenSize1 * 0.5,
...@@ -294,98 +391,112 @@ class _SettingDashboardState extends State<SettingDashboard> { ...@@ -294,98 +391,112 @@ class _SettingDashboardState extends State<SettingDashboard> {
// enabled: enb, // enabled: enb,
// ), // ),
// ), // ),
// const SizedBox( const SizedBox(
// height: 10, height: 10,
// ), ),
// const Text( const Text(
// "In a few words, explain what this site is about.", "In a few words, explain what this site is about.",
// overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
// style: TextStyle( style: TextStyle(
// color: Colors.grey, color: Colors.grey,
// fontSize: 16, fontSize: 16,
// fontWeight: FontWeight.normal)), fontWeight: FontWeight.normal)),
], ],
), ),
), ),
], ],
), ),
FutureBuilder<List<dynamic>>(
Row( future: getSettingDesc(),
children: [ builder: (BuildContext context, AsyncSnapshot snapshot) {
Column( var pgm = snapshot.data[0];
crossAxisAlignment: CrossAxisAlignment.start, if (snapshot.hasError ||
mainAxisAlignment: MainAxisAlignment.start, snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return Row(
children: [ children: [
const Text( Column(
"Email address", crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( mainAxisAlignment: MainAxisAlignment.start,
color: Colors.black, children: [
fontSize: 17, const Text(
fontWeight: FontWeight.bold), "Email address",
), style: TextStyle(
const SizedBox( color: Colors.black,
height: 10, fontSize: 17,
), fontWeight: FontWeight.bold),
Container( ),
height: 40, const SizedBox(
width: screenSize1 * 0.5, height: 10,
child: TextFormField( ),
decoration: InputDecoration( Container(
fillColor: Colors.grey[200], height: 40,
labelText: "xxxxxx@eksad.com", width: screenSize1 * 0.5,
hintStyle: const TextStyle(), child: TextFormField(
border: const OutlineInputBorder( initialValue: pgm['email'],
borderSide: BorderSide( decoration: InputDecoration(
width: 1, color: Colors.grey))), fillColor: Colors.grey[200],
onChanged: (value) => em = value, labelText: "xxxxxx@eksad.com",
enabled: enb, hintStyle: const TextStyle(),
), border: const OutlineInputBorder(
), borderSide: BorderSide(
const SizedBox( width: 1, color: Colors.grey))),
height: 10, onChanged: (value) => em = value,
), enabled: enb,
),
], ),
), const SizedBox(
SizedBox(width: 30,), height: 10,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, ],
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(
"No Office",
style: TextStyle(
color: Colors.black,
fontSize: 17,
fontWeight: FontWeight.bold),
),
const SizedBox(
height: 10,
),
Container(
height: 40,
width: screenSize1 * 0.5,
child: TextFormField(
decoration: const InputDecoration(
labelText: "02x-xxxx-xxxx",
hintStyle: TextStyle(),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 1, color: Colors.grey))),
onChanged: (value) => no = value,
enabled: enb,
),
), ),
const SizedBox( SizedBox(
height: 10, width: 30,
), ),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(
"No Office",
style: TextStyle(
color: Colors.black,
fontSize: 17,
fontWeight: FontWeight.bold),
),
const SizedBox(
height: 10,
),
Container(
height: 40,
width: screenSize1 * 0.5,
child: TextFormField(
initialValue: pgm['no'],
decoration: const InputDecoration(
labelText: "02x-xxxx-xxxx",
hintStyle: TextStyle(),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 1, color: Colors.grey))),
onChanged: (value) => no = value,
enabled: enb,
),
),
const SizedBox(
height: 10,
),
],
)
// const SizedBox(
// width: 30,
// ),
], ],
) );
// const SizedBox( },
// width: 30,
// ),
],
), ),
// const Spacer( // const Spacer(
// flex: 20, // flex: 20,
// ), // ),
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart'; import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart'; import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart'; ...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home2.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home2.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home3.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home3.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home4.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart'; import 'package:medapp_eksad/widget/whatsapp.dart';
...@@ -32,10 +35,26 @@ class HomePage extends StatefulWidget { ...@@ -32,10 +35,26 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
// Untuk pake PAGE per index
PageController controller = PageController();
void _scrollToIndex2(int index) {
controller.animateToPage(index,
duration: const Duration(seconds: 2),
curve: Curves.fastLinearToSlowEaseIn);
}
// Untuk pake LIST per height container
ScrollController controller2 = ScrollController();
void _scrollToIndex(double index) {
controller2.animateTo(index,
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn);
}
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('MedApp by Eksad', context); // setPageTitle('MedApp by Eksad', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -46,29 +65,94 @@ class _HomePageState extends State<HomePage> { ...@@ -46,29 +65,94 @@ class _HomePageState extends State<HomePage> {
Colors.black, Colors.black, Colors.black), Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
SmallHome1(), FutureBuilder<dynamic>(
SmallHome2(), future: getSettingDesc2(),
SmallHome3(), builder: (BuildContext context, AsyncSnapshot snapshot) {
SmallHome4(), var pgm = snapshot.data[0];
ContactUs2_small(), return Title(
FooterSmall(), title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
SmallHome1(wijet: Button_scroll_small()),
SmallHome2(),
SmallHome3(),
SmallHome4(),
ContactUs2_small(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
], ],
) )
: ListView( : Stack(
children: [ children: [
const Home1(), FutureBuilder<dynamic>(
const Home2(), future: getSettingDesc2(),
const Home3(), builder: (BuildContext context, AsyncSnapshot snapshot) {
const Home4(), var pgm = snapshot.data[0];
ContactUs2(), return Title(
Footer(), title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
Home1(wijet: Button_scroll()),
const Home2(),
const Home3(),
const Home4(),
ContactUs2(),
Footer(),
],
),
);
},
),
ScrollUpButton(controller2),
], ],
), ),
); );
} }
ElevatedButton Button_scroll() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(3780);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 17, letterSpacing: 2, fontWeight: FontWeight.w500),
),
);
}
ElevatedButton Button_scroll_small() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(5410);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8), fixedSize: const Size(50, 20)),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 15, letterSpacing: 1.5, fontWeight: FontWeight.w500),
),
);
}
AppBar AppBarKecil() { AppBar AppBarKecil() {
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
......
...@@ -29,20 +29,19 @@ class _SignInState extends State<SignIn> { ...@@ -29,20 +29,19 @@ class _SignInState extends State<SignIn> {
void loginUser() { void loginUser() {
context.read<FirebaseAuthMethods>().loginWithEmail( context.read<FirebaseAuthMethods>().loginWithEmail(
email: emailController.text, email: emailController.text,
password: passwordController.text, password: passwordController.text,
context: context, context: context,
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Login MedApps', context); // setPageTitle('Login MedApps', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
body: Stack( body: Stack(
children: [ children: [
Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
...@@ -57,7 +56,6 @@ class _SignInState extends State<SignIn> { ...@@ -57,7 +56,6 @@ class _SignInState extends State<SignIn> {
bottom: screenSize.height * 0.13), bottom: screenSize.height * 0.13),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color.fromARGB(255, 10, 116, 255), color: const Color.fromARGB(255, 10, 116, 255),
...@@ -71,7 +69,8 @@ class _SignInState extends State<SignIn> { ...@@ -71,7 +69,8 @@ class _SignInState extends State<SignIn> {
), ),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenSize.width * 0.33, top: screenSize.height * 0.07), left: screenSize.width * 0.33,
top: screenSize.height * 0.07),
child: Container( child: Container(
width: screenSize.width * 0.3, width: screenSize.width * 0.3,
height: screenSize.height * 0.6, height: screenSize.height * 0.6,
...@@ -106,8 +105,8 @@ class _SignInState extends State<SignIn> { ...@@ -106,8 +105,8 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: padding: EdgeInsets.only(
EdgeInsets.only(left: screenSize.width * 0.055), left: screenSize.width * 0.055),
height: screenSize.width * 0.02, height: screenSize.width * 0.02,
child: Image.asset("assets/logo/medapp-logo.png"), child: Image.asset("assets/logo/medapp-logo.png"),
), ),
...@@ -136,8 +135,15 @@ class _SignInState extends State<SignIn> { ...@@ -136,8 +135,15 @@ class _SignInState extends State<SignIn> {
child: TextFormField( child: TextFormField(
controller: emailController, controller: emailController,
textAlign: TextAlign.start, textAlign: TextAlign.start,
onFieldSubmitted: (String value){ onFieldSubmitted: (String value) {
loginUser(); if (emailController.value.text ==
'admin@admin.com' &&
passwordController.value.text ==
'administrator') {
Navigator.pushNamed(context, '/dashboard');
} else {
loginUser();
}
}, },
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Enter Your Email", labelText: "Enter Your Email",
...@@ -183,8 +189,15 @@ class _SignInState extends State<SignIn> { ...@@ -183,8 +189,15 @@ class _SignInState extends State<SignIn> {
width: screenSize.width * 0.2, width: screenSize.width * 0.2,
child: TextFormField( child: TextFormField(
controller: passwordController, controller: passwordController,
onFieldSubmitted: (String value){ onFieldSubmitted: (String value) {
loginUser(); if (emailController.value.text ==
'admin@admin.com' &&
passwordController.value.text ==
'administrator') {
Navigator.pushNamed(context, '/dashboard');
} else {
loginUser();
}
}, },
textAlign: TextAlign.start, textAlign: TextAlign.start,
obscureText: _isObscure, obscureText: _isObscure,
...@@ -224,10 +237,15 @@ class _SignInState extends State<SignIn> { ...@@ -224,10 +237,15 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
TextButton(onPressed: (){ TextButton(
Navigator.pushNamed(context, '/reset_password'); onPressed: () {
}, child: Text('Forgot Password?')), Navigator.pushNamed(
SizedBox(width: 52,) context, '/reset_password');
},
child: Text('Forgot Password?')),
SizedBox(
width: 52,
)
], ],
), ),
const Spacer( const Spacer(
...@@ -240,10 +258,13 @@ class _SignInState extends State<SignIn> { ...@@ -240,10 +258,13 @@ class _SignInState extends State<SignIn> {
width: screenSize.width * 0.08, width: screenSize.width * 0.08,
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
if (emailController.value.text == 'admin@admin.com' && if (emailController.value.text ==
passwordController.value.text == 'administrator') { 'admin@admin.com' &&
Navigator.pushNamed(context, '/dashboard'); passwordController.value.text ==
}else{ 'administrator') {
Navigator.pushNamed(
context, '/dashboard');
} else {
loginUser(); loginUser();
} }
// if (emailController.value.text == emailController && // if (emailController.value.text == emailController &&
...@@ -321,9 +342,11 @@ class _SignInState extends State<SignIn> { ...@@ -321,9 +342,11 @@ class _SignInState extends State<SignIn> {
), ),
Padding( Padding(
padding: const EdgeInsets.all(21.0), padding: const EdgeInsets.all(21.0),
child: ElevatedButton(onPressed: (){ child: ElevatedButton(
Navigator.pushNamed(context, '/'); onPressed: () {
}, child: Icon(Icons.arrow_back)), Navigator.pushNamed(context, '/');
},
child: Icon(Icons.arrow_back)),
), ),
], ],
), ),
......
...@@ -40,7 +40,7 @@ class MyApp extends StatelessWidget { ...@@ -40,7 +40,7 @@ class MyApp extends StatelessWidget {
], ],
child: MaterialApp( child: MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: "MedApp by Eksad", // title: "MedApp by Eksad",
initialRoute: '/', initialRoute: '/',
routes: { routes: {
'/': (context) => const HomePage(), '/': (context) => const HomePage(),
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart'; import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart'; import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart'; ...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home2.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home2.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home3.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home3.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home4.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart'; import 'package:medapp_eksad/widget/whatsapp.dart';
...@@ -32,10 +35,26 @@ class AboutUs extends StatefulWidget { ...@@ -32,10 +35,26 @@ class AboutUs extends StatefulWidget {
} }
class _AboutUsState extends State<AboutUs> { class _AboutUsState extends State<AboutUs> {
// Untuk pake PAGE per index
PageController controller = PageController();
void _scrollToIndex2(int index) {
controller.animateToPage(index,
duration: const Duration(seconds: 2),
curve: Curves.fastLinearToSlowEaseIn);
}
// Untuk pake LIST per height container
ScrollController controller2 = ScrollController();
void _scrollToIndex(double index) {
controller2.animateTo(index,
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn);
}
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('About Us', context); // setPageTitle('About Us', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -43,28 +62,93 @@ class _AboutUsState extends State<AboutUs> { ...@@ -43,28 +62,93 @@ class _AboutUsState extends State<AboutUs> {
appBar: ResponsiveWidget.isSmallScreen(context) appBar: ResponsiveWidget.isSmallScreen(context)
? AppBarKecil() ? AppBarKecil()
: AppbarHomeLarge(screenSize, context, Colors.black, Colors.blue, : AppbarHomeLarge(screenSize, context, Colors.black, Colors.blue,
Colors.black, Colors.black, Colors.black), Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
SmallHome1(), FutureBuilder<dynamic>(
SmallHome2(), future: getSettingDesc2(),
SmallHome3(), builder: (BuildContext context, AsyncSnapshot snapshot) {
SmallHome4(), var pgm = snapshot.data[0];
ContactUs2_small(), return Title(
FooterSmall(), title: pgm['title'],
], color: Colors.white,
) child: ListView(
: ListView( scrollDirection: Axis.vertical,
children: [ controller: controller2,
const Home1(), children: [
const Home2(), SmallHome1(wijet: Button_scroll_small()),
const Home3(), SmallHome2(),
const Home4(), SmallHome3(),
ContactUs2(), SmallHome4(),
Footer(), ContactUs2_small(),
], FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
)
: Stack(
children: [
FutureBuilder<dynamic>(
future: getSettingDesc2(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
Home1(wijet: Button_scroll()),
const Home2(),
const Home3(),
const Home4(),
ContactUs2(),
Footer(),
],
),
);
},
),
ScrollUpButton(controller2),
],
),
);
}
ElevatedButton Button_scroll() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(3780);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 17, letterSpacing: 2, fontWeight: FontWeight.w500),
),
);
}
ElevatedButton Button_scroll_small() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(5410);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8), fixedSize: const Size(50, 20)),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 15, letterSpacing: 1.5, fontWeight: FontWeight.w500),
), ),
); );
} }
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart'; import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us1.dart'; import 'package:medapp_eksad/screen_small/small_contact/small_contact_us1.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart'; import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
...@@ -6,6 +8,7 @@ import 'package:medapp_eksad/screen_small/small_footer.dart'; ...@@ -6,6 +8,7 @@ import 'package:medapp_eksad/screen_small/small_footer.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us1.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us1.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
import 'package:medapp_eksad/screen/footer.dart'; import 'package:medapp_eksad/screen/footer.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart'; import 'package:medapp_eksad/widget/whatsapp.dart';
...@@ -26,10 +29,26 @@ class ContactUs extends StatefulWidget { ...@@ -26,10 +29,26 @@ class ContactUs extends StatefulWidget {
} }
class _ContactUsState extends State<ContactUs> { class _ContactUsState extends State<ContactUs> {
// Untuk pake PAGE per index
PageController controller = PageController();
void _scrollToIndex2(int index) {
controller.animateToPage(index,
duration: const Duration(seconds: 2),
curve: Curves.fastLinearToSlowEaseIn);
}
// Untuk pake LIST per height container
ScrollController controller2 = ScrollController();
void _scrollToIndex(double index) {
controller2.animateTo(index,
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn);
}
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Contact Us', context); // setPageTitle('Contact Us', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -39,22 +58,86 @@ class _ContactUsState extends State<ContactUs> { ...@@ -39,22 +58,86 @@ class _ContactUsState extends State<ContactUs> {
Colors.black, Colors.black, Colors.blue), Colors.black, Colors.black, Colors.blue),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
ContactUs1_small(), FutureBuilder<dynamic>(
ContactUs2_small(), future: getSettingDesc2(),
FooterSmall(), builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
ContactUs1_small(wijet: Button_scroll_small()),
ContactUs2_small(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
], ],
) )
: ListView( : Stack(
children: [ children: [
ContactUs1(), FutureBuilder<dynamic>(
ContactUs2(), future: getSettingDesc2(),
Footer(), builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
ContactUs1(wijet: Button_scroll()),
ContactUs2(),
Footer(),
],
),
);
},
),
ScrollUpButton(controller2),
], ],
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
floatingActionButton: WAChat() floatingActionButton: WAChat());
}
ElevatedButton Button_scroll() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(3780);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 17, letterSpacing: 2, fontWeight: FontWeight.w500),
),
);
}
ElevatedButton Button_scroll_small() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(5410);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8), fixedSize: const Size(50, 20)),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 15, letterSpacing: 1.5, fontWeight: FontWeight.w500),
),
); );
} }
......
...@@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; ...@@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
class ContactUs1 extends StatefulWidget { class ContactUs1 extends StatefulWidget {
const ContactUs1({Key? key}) : super(key: key); ContactUs1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
State<ContactUs1> createState() => _ContactUsState(); State<ContactUs1> createState() => _ContactUsState();
......
...@@ -18,6 +18,9 @@ class ContactUs2 extends StatelessWidget { ...@@ -18,6 +18,9 @@ class ContactUs2 extends StatelessWidget {
final emailController = TextEditingController(); final emailController = TextEditingController();
final messageController = TextEditingController(); final messageController = TextEditingController();
String pattern =
r'(\+62|62|0)(\d{2,3})?\)?[ .-]?\d{2,4}[ .-]?\d{2,4}[ .-]?\d{2,4}';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
...@@ -186,6 +189,8 @@ class ContactUs2 extends StatelessWidget { ...@@ -186,6 +189,8 @@ class ContactUs2 extends StatelessWidget {
validator: (value) { validator: (value) {
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return 'Please enter your phone number'; return 'Please enter your phone number';
} else if (!RegExp(pattern).hasMatch(value)) {
return 'Start with 628 or 08';
} }
return null; return null;
}, },
......
...@@ -87,78 +87,21 @@ class Footer extends StatelessWidget { ...@@ -87,78 +87,21 @@ class Footer extends StatelessWidget {
), ),
), ),
const Spacer( const Spacer(
flex: 1, flex: 2,
), ),
Container( Container(
width: screenSize.width * 0.14, width: screenSize.width * 0.16,
height: screenSize.height * 0.03, height: screenSize.height * 0.03,
//color: Colors.blue, //color: Colors.blue,
child: FutureBuilder<List<dynamic>>( child: Row(
future: getSosmedDesc(), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
builder: (BuildContext context, AsyncSnapshot snapshot) { children: const [
var pgm = snapshot.data[0]; ApiLinkedin(),
if (snapshot.hasError || ApiTwitter(),
snapshot.data == null || ApiInstagram(),
snapshot.connectionState == ConnectionState.waiting) { ApiYoutube(),
return const CircularProgressIndicator(); ],
}
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
onPressed: () {
ln = pgm['linkedin'];
launch(ln);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.linkedinIn,
size: 25,
),
iconSize: 25,
color: Colors.black),
IconButton(
onPressed: () {
tw = pgm['twitter'];
launch(tw);
//_launchTwitter();
},
icon: const Icon(
FontAwesomeIcons.twitter,
size: 25,
),
iconSize: 25,
color: Colors.black,
),
IconButton(
onPressed: () {
ig = pgm['instagram'];
launch(ig);
// _launchInstagram();
},
icon: const Icon(
FontAwesomeIcons.instagram,
size: 25,
),
iconSize: 25,
color: Colors.black),
IconButton(
onPressed: () {
yt = pgm['youtube'];
launch(yt);
// _launchYoutube();
},
icon: const Icon(
FontAwesomeIcons.youtube,
size: 25,
),
iconSize: 25,
color: Colors.black)
],
);
},
), ),
), ),
const Spacer( const Spacer(
flex: 8, flex: 8,
...@@ -301,12 +244,13 @@ class Footer extends StatelessWidget { ...@@ -301,12 +244,13 @@ class Footer extends StatelessWidget {
child: ListTile( child: ListTile(
leading: const Icon( leading: const Icon(
Icons.location_on, Icons.location_on,
size: 25, size: 28,
color: Colors.black,
), ),
title: Container( title: Container(
padding: const EdgeInsets.only(left: 14), padding: const EdgeInsets.only(left: 25),
width: screenSize.width * 0.25, width: screenSize.width * 0.25,
height: screenSize.height * 0.3, height: screenSize.height * 0.8,
child: Text( child: Text(
'PT. Tiga Daya Digital Indonesia \nThe East ' 'PT. Tiga Daya Digital Indonesia \nThe East '
'Tower 19th Floor \nJl. Dr. Ide Anak Agung ' 'Tower 19th Floor \nJl. Dr. Ide Anak Agung '
...@@ -366,6 +310,153 @@ class itemBawah extends StatelessWidget { ...@@ -366,6 +310,153 @@ class itemBawah extends StatelessWidget {
} }
} }
class ApiLinkedin extends StatefulWidget {
const ApiLinkedin({Key? key}) : super(key: key);
@override
State<ApiLinkedin> createState() => _ApiLinkedinState();
}
class _ApiLinkedinState extends State<ApiLinkedin> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getLnDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['linkedin']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.linkedinIn,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiTwitter extends StatefulWidget {
const ApiTwitter({Key? key}) : super(key: key);
@override
State<ApiTwitter> createState() => _ApiTwitterState();
}
class _ApiTwitterState extends State<ApiTwitter> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getTwDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['twitter']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.twitter,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiInstagram extends StatefulWidget {
const ApiInstagram({Key? key}) : super(key: key);
@override
State<ApiInstagram> createState() => _ApiInstagramState();
}
class _ApiInstagramState extends State<ApiInstagram> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getIgDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['instagram']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.instagram,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiYoutube extends StatefulWidget {
const ApiYoutube({Key? key}) : super(key: key);
@override
State<ApiYoutube> createState() => _ApiYoutubeState();
}
class _ApiYoutubeState extends State<ApiYoutube> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getYtDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['youtube']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.youtube,
size: 25,
),
iconSize: 35,
color: Colors.black);
});
}
}
class TelphoneApi extends StatefulWidget { class TelphoneApi extends StatefulWidget {
const TelphoneApi({Key? key}) : super(key: key); const TelphoneApi({Key? key}) : super(key: key);
...@@ -388,7 +479,7 @@ class _TelphoneApiState extends State<TelphoneApi> { ...@@ -388,7 +479,7 @@ class _TelphoneApiState extends State<TelphoneApi> {
return const CircularProgressIndicator(); return const CircularProgressIndicator();
} }
return Container( return Container(
width: screenSize.width * 0.19, width: screenSize.width * 0.20,
child: ListTile( child: ListTile(
leading: const Icon( leading: const Icon(
Icons.phone, Icons.phone,
......
...@@ -6,7 +6,8 @@ import 'package:medapp_eksad/widget/button_color.dart'; ...@@ -6,7 +6,8 @@ import 'package:medapp_eksad/widget/button_color.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class Home1 extends StatelessWidget { class Home1 extends StatelessWidget {
const Home1({Key? key}) : super(key: key); Home1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart'; import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
import 'package:medapp_eksad/screen/footer.dart'; import 'package:medapp_eksad/screen/footer.dart';
...@@ -8,6 +10,7 @@ import 'package:medapp_eksad/screen/solution/our_solution3.dart'; ...@@ -8,6 +10,7 @@ import 'package:medapp_eksad/screen/solution/our_solution3.dart';
import 'package:medapp_eksad/screen_small/small_footer.dart'; import 'package:medapp_eksad/screen_small/small_footer.dart';
import 'package:medapp_eksad/screen_small/small_solution/small_solution1.dart'; import 'package:medapp_eksad/screen_small/small_solution/small_solution1.dart';
import 'package:medapp_eksad/screen_small/small_solution/small_solution2.dart'; import 'package:medapp_eksad/screen_small/small_solution/small_solution2.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/componen.dart'; import 'package:medapp_eksad/widget/componen.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
...@@ -39,7 +42,7 @@ class _SolutionsState extends State<Solutions> { ...@@ -39,7 +42,7 @@ class _SolutionsState extends State<Solutions> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('MeddApp Solutions', context); // setPageTitle('MeddApp Solutions', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -50,22 +53,55 @@ class _SolutionsState extends State<Solutions> { ...@@ -50,22 +53,55 @@ class _SolutionsState extends State<Solutions> {
Colors.blue, Colors.black, Colors.black), Colors.blue, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
SmallOurSolution(), FutureBuilder<dynamic>(
SmallOurSolution2(), future: getSettingDesc2(),
FooterSmall(), builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
SmallOurSolution(wijet: Button_scroll()),
SmallOurSolution2(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
], ],
) )
: ListView( : Stack(
controller: controller2,
children: [ children: [
OurSolution( FutureBuilder<dynamic>(
button: ButtonSolution(context), future: getSettingDesc2(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
controller: controller2,
children: [
OurSolution(
wijet: Button_scroll(),
button: ButtonSolution(context),
),
OurSolution2(),
ContactUs2(),
Footer(),
],
),
);
},
), ),
OurSolution2(), ScrollUpButton(controller2),
ContactUs2(),
Footer(),
], ],
), ),
); );
...@@ -95,6 +131,37 @@ class _SolutionsState extends State<Solutions> { ...@@ -95,6 +131,37 @@ class _SolutionsState extends State<Solutions> {
); );
} }
ElevatedButton Button_scroll() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(3780);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 17, letterSpacing: 2, fontWeight: FontWeight.w500),
),
);
}
ElevatedButton Button_scroll_small() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(5410);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8), fixedSize: const Size(50, 20)),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 15, letterSpacing: 1.5, fontWeight: FontWeight.w500),
),
);
}
AppBar AppBarKecil() { AppBar AppBarKecil() {
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
......
...@@ -2,11 +2,14 @@ import 'package:flutter/material.dart'; ...@@ -2,11 +2,14 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class OurSolution extends StatelessWidget { class OurSolution extends StatelessWidget {
const OurSolution({Key? key,required this.button}) : super(key: key); OurSolution({
Key? key,
required this.button,
required this.wijet,
}) : super(key: key);
final Widget button; final Widget button;
final Widget wijet;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
class ContactUs1_small extends StatefulWidget { class ContactUs1_small extends StatefulWidget {
const ContactUs1_small({Key? key}) : super(key: key); ContactUs1_small({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
State<ContactUs1_small> createState() => _ContactUsState(); State<ContactUs1_small> createState() => _ContactUsState();
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/api/sosmed_api.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class FooterSmall extends StatelessWidget { class FooterSmall extends StatelessWidget {
...@@ -36,10 +38,22 @@ class FooterSmall extends StatelessWidget { ...@@ -36,10 +38,22 @@ class FooterSmall extends StatelessWidget {
width: screenSize.width * 0.4, width: screenSize.width * 0.4,
height: screenSize.height * 0.08, height: screenSize.height * 0.08,
decoration: const BoxDecoration( decoration: const BoxDecoration(
//color: Colors.lightBlueAccent, //color: Colors.lightBlueAccent,
image: DecorationImage( image: DecorationImage(
image: AssetImage( image:
'assets/logo/medapp-logo.png'), AssetImage('assets/logo/medapp-logo.png'),
fit: BoxFit.fill)),
),
SizedBox(
height: 7,
),
Container(
width: screenSize.width * 0.4,
height: screenSize.height * 0.10,
decoration: const BoxDecoration(
//color: Colors.lightBlueAccent,
image: DecorationImage(
image: AssetImage('assets/logo/logo-eksad.png'),
fit: BoxFit.fill)), fit: BoxFit.fill)),
), ),
const Spacer(), const Spacer(),
...@@ -65,55 +79,16 @@ class FooterSmall extends StatelessWidget { ...@@ -65,55 +79,16 @@ class FooterSmall extends StatelessWidget {
Container( Container(
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.03, height: screenSize.height * 0.03,
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.15), padding: EdgeInsets.symmetric(
horizontal: screenSize.width * 0.15),
//color: Colors.blue, //color: Colors.blue,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
IconButton( ApiLinkedin(),
onPressed: () { ApiTwitter(),
launch( ApiInstagram(),
'https://www.linkedin.com/company/pt-tiga-daya-digital-indonesia-triputra-group-eksad-technology'); ApiYoutube(),
},
icon: const Icon(
FontAwesomeIcons.linkedinIn,
size: 30,
),
iconSize: 20,
),
IconButton(
onPressed: () {
launch(
'https://twitter.com/eksadtechnology/');
},
icon: const Icon(
FontAwesomeIcons.twitter,
size: 30,
),
iconSize: 20,
),
IconButton(
onPressed: () {
launch(
'https://www.instagram.com/eksad_technology/');
},
icon: const Icon(
FontAwesomeIcons.instagram,
size: 30,
),
iconSize: 20,
),
IconButton(
onPressed: () {
launch(
'https://www.youtube.com/channel/UCiZgIbpWgrAMrHW-TaS9EPw');
},
icon: const Icon(
FontAwesomeIcons.youtube,
size: 30,
),
iconSize: 20,
)
], ],
), ),
), ),
...@@ -163,16 +138,16 @@ class FooterSmall extends StatelessWidget { ...@@ -163,16 +138,16 @@ class FooterSmall extends StatelessWidget {
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.06, height: screenSize.height * 0.06,
child: const itemBawah_small( child: const itemBawah_small(
item: 'Service', item: 'Solutions',
routeName: '/service', routeName: '/solutions',
), ),
), ),
Container( Container(
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.06, height: screenSize.height * 0.06,
child: const itemBawah_small( child: const itemBawah_small(
item: 'Career', item: 'Contact Us',
routeName: '/career', routeName: '/contact',
), ),
), ),
Spacer() Spacer()
...@@ -180,7 +155,7 @@ class FooterSmall extends StatelessWidget { ...@@ -180,7 +155,7 @@ class FooterSmall extends StatelessWidget {
)), )),
Container( Container(
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.35, height: screenSize.height * 0.25,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
...@@ -198,37 +173,12 @@ class FooterSmall extends StatelessWidget { ...@@ -198,37 +173,12 @@ class FooterSmall extends StatelessWidget {
), ),
), ),
), ),
Container(
width: screenSize.width,
height: screenSize.height * 0.06,
child: const itemBawah_small(
item: 'Retained Search',
routeName: '/service',
),
),
Container(
width: screenSize.width,
height: screenSize.height * 0.06,
child: const itemBawah_small(
item: 'Dedicated Services',
routeName: '/service',
),
),
Container(
width: screenSize.width,
height: screenSize.height * 0.06,
child: const itemBawah_small(
item: 'Contract Services',
routeName: '/service',
),
),
Container( Container(
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.06, height: screenSize.height * 0.04,
child: const itemBawah_small( child: itemBawah_small(
item: 'Recruitment', item: 'Catalog',
routeName: '/service', routeName: '/solutions',
), ),
), ),
], ],
...@@ -256,56 +206,11 @@ class FooterSmall extends StatelessWidget { ...@@ -256,56 +206,11 @@ class FooterSmall extends StatelessWidget {
), ),
Column( Column(
children: [ children: [
TelphoneApi(),
EmailAPI(),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.15), padding: EdgeInsets.symmetric(
width: screenSize.width, horizontal: screenSize.width * 0.15),
child: ListTile(
minLeadingWidth: 2,
leading: const Icon(
Icons.phone,
size: 19,
color: Colors.black,
),
title: TextButton(
onPressed: () {
launch('tel:02157958040');
},
child: Text(
'(021) 5795 - 8040',
style: GoogleFonts.poppins(
fontSize: 14,
color: Colors.black87,
),
)),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.15),
width: screenSize.width ,
child: ListTile(
minLeadingWidth: 2,
leading: const Icon(
Icons.mail,
size: 19,
color: Colors.black,
),
title: TextButton(
onPressed: () {
launch(
'mailto:Info@eksad.com?subject=Info MCS');
},
child: Text(
'info@eksad.com',
style: GoogleFonts.poppins(
fontSize: 14, color: Colors.black87,letterSpacing: 1.1),
),
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: screenSize.width*0.15),
width: screenSize.width, width: screenSize.width,
child: ListTile( child: ListTile(
minLeadingWidth: 2, minLeadingWidth: 2,
...@@ -319,23 +224,19 @@ class FooterSmall extends StatelessWidget { ...@@ -319,23 +224,19 @@ class FooterSmall extends StatelessWidget {
width: screenSize.width * 0.48, width: screenSize.width * 0.48,
child: Text( child: Text(
'PT. Tiga Daya Digital Indonesia \nThe East ' 'PT. Tiga Daya Digital Indonesia \nThe East '
'Tower 19th Floor \nJl. Dr. Ide Anak Agung ' 'Tower 19th Floor \nJl. Dr. Ide Anak Agung '
'\nGde Agung Blok E3.2 ' '\nGde Agung Blok E3.2 '
'\nMega Kuningan, \nJakarta Selatan 12950', '\nMega Kuningan, \nJakarta Selatan 12950',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 13, fontSize: 13,
height: 1.45, height: 1.45,
letterSpacing: 1.1 letterSpacing: 1.1),
), textAlign: TextAlign.center,
textAlign: TextAlign.left,
), ),
)), )),
), ),
], ],
), ),
], ],
)), )),
), ),
...@@ -350,11 +251,11 @@ class FooterSmall extends StatelessWidget { ...@@ -350,11 +251,11 @@ class FooterSmall extends StatelessWidget {
width: screenSize.width, width: screenSize.width,
height: screenSize.height * 0.12, height: screenSize.height * 0.12,
child: const Center( child: const Center(
child: Text( child: Text(
'PT. Tiga Daya Digital Indonesia © 2018, \nAll Rights Reserved.', 'PT. Tiga Daya Digital Indonesia © 2018, \nAll Rights Reserved.',
style: TextStyle(letterSpacing: 1.3, height: 1.4, fontSize: 13), style: TextStyle(letterSpacing: 1.3, height: 1.4, fontSize: 13),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
) )
], ],
...@@ -380,8 +281,252 @@ class itemBawah_small extends StatelessWidget { ...@@ -380,8 +281,252 @@ class itemBawah_small extends StatelessWidget {
color: const Color(0xff1e5ea8), color: const Color(0xff1e5ea8),
//decoration: TextDecoration.underline, //decoration: TextDecoration.underline,
fontSize: 17, fontSize: 17,
letterSpacing: 1.2 letterSpacing: 1.2),
),
)); ));
} }
} }
class ApiLinkedin extends StatefulWidget {
const ApiLinkedin({Key? key}) : super(key: key);
@override
State<ApiLinkedin> createState() => _ApiLinkedinState();
}
class _ApiLinkedinState extends State<ApiLinkedin> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getLnDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['linkedin']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.linkedinIn,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiTwitter extends StatefulWidget {
const ApiTwitter({Key? key}) : super(key: key);
@override
State<ApiTwitter> createState() => _ApiTwitterState();
}
class _ApiTwitterState extends State<ApiTwitter> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getTwDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['twitter']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.twitter,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiInstagram extends StatefulWidget {
const ApiInstagram({Key? key}) : super(key: key);
@override
State<ApiInstagram> createState() => _ApiInstagramState();
}
class _ApiInstagramState extends State<ApiInstagram> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getIgDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['instagram']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.instagram,
size: 25,
),
iconSize: 35,
color: Colors.black);
},
);
}
}
class ApiYoutube extends StatefulWidget {
const ApiYoutube({Key? key}) : super(key: key);
@override
State<ApiYoutube> createState() => _ApiYoutubeState();
}
class _ApiYoutubeState extends State<ApiYoutube> {
@override
Widget build(BuildContext context) {
return FutureBuilder<List<dynamic>>(
future: getYtDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return IconButton(
onPressed: () {
// ln = ;
launch(pgm['youtube']);
// _launchLinkedIn();
},
icon: const Icon(
FontAwesomeIcons.youtube,
size: 25,
),
iconSize: 35,
color: Colors.black);
});
}
}
class TelphoneApi extends StatefulWidget {
const TelphoneApi({Key? key}) : super(key: key);
@override
State<TelphoneApi> createState() => _TelphoneApiState();
}
class _TelphoneApiState extends State<TelphoneApi> {
String no = '';
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
return FutureBuilder<List<dynamic>>(
future: getSettingDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return Container(
padding: EdgeInsets.symmetric(horizontal: screenSize.width * 0.15),
width: screenSize.width,
child: ListTile(
minLeadingWidth: 2,
leading: const Icon(
Icons.phone,
size: 19,
color: Colors.black,
),
title: TextButton(
onPressed: () {
no = pgm['no'];
//02157958040
launch('tel:$no');
},
child: Text(
pgm['no'],
style: GoogleFonts.poppins(
fontSize: 14, color: Colors.black87, letterSpacing: 1.5),
)),
),
);
},
);
}
}
class EmailAPI extends StatefulWidget {
const EmailAPI({Key? key}) : super(key: key);
@override
State<EmailAPI> createState() => _EmailAPIState();
}
class _EmailAPIState extends State<EmailAPI> {
String email = '';
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
return FutureBuilder<List<dynamic>>(
future: getSettingDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return Container(
padding: EdgeInsets.symmetric(horizontal: screenSize.width * 0.15),
width: screenSize.width,
child: ListTile(
minLeadingWidth: 2,
leading: const Icon(
Icons.mail,
size: 19,
color: Colors.black,
),
title: TextButton(
onPressed: () {
email = pgm['email'];
launch('mailto:$email?subject=Info Medapp');
},
// child: SettingAPI(),
child: Text(
pgm['email'],
style: GoogleFonts.poppins(
fontSize: 14, color: Colors.black87, letterSpacing: 1.1),
)),
),
);
},
);
}
}
...@@ -3,9 +3,9 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -3,9 +3,9 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/widget/button_color.dart'; import 'package:medapp_eksad/widget/button_color.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class SmallHome1 extends StatelessWidget { class SmallHome1 extends StatelessWidget {
const SmallHome1({Key? key}) : super(key: key); SmallHome1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -75,8 +75,8 @@ class SmallHome1 extends StatelessWidget { ...@@ -75,8 +75,8 @@ class SmallHome1 extends StatelessWidget {
// offset: -0.2, // offset: -0.2,
child: Text( child: Text(
'Welcome to healthcare’s most powerful collaboration suite. ' 'Welcome to healthcare’s most powerful collaboration suite. '
'Enhance clinical workflows, speed decisions, and improve' 'Enhance clinical workflows, speed decisions, and improve'
' patient outcomes, safely and securely.', ' patient outcomes, safely and securely.',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 15, fontSize: 15,
......
...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class SmallOurSolution extends StatefulWidget { class SmallOurSolution extends StatefulWidget {
const SmallOurSolution({Key? key}) : super(key: key); SmallOurSolution({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
State<SmallOurSolution> createState() => _SmallOurSolutionState(); State<SmallOurSolution> createState() => _SmallOurSolutionState();
...@@ -56,7 +57,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> { ...@@ -56,7 +57,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 34, fontSize: 34,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black87), color: Colors.white),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
...@@ -76,7 +77,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> { ...@@ -76,7 +77,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
letterSpacing: 1.8, letterSpacing: 1.8,
height: 1.4, height: 1.4,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black87), color: Colors.white),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
......
...@@ -30,7 +30,7 @@ class _DemoUserState extends State<DemoUser> { ...@@ -30,7 +30,7 @@ class _DemoUserState extends State<DemoUser> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Free Demo Medapp', context); // setPageTitle('Free Demo Medapp', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
final user = context.read<FirebaseAuthMethods>().user; final user = context.read<FirebaseAuthMethods>().user;
final String mail = user.email!; final String mail = user.email!;
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:medapp_eksad/appbar/appbar_home.dart'; import 'package:medapp_eksad/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart'; import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart'; ...@@ -12,6 +14,7 @@ import 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home2.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home2.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home3.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home3.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home4.dart'; import 'package:medapp_eksad/screen_small/small_home/small_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart'; import 'package:medapp_eksad/widget/whatsapp.dart';
...@@ -32,10 +35,26 @@ class HomePageUser extends StatefulWidget { ...@@ -32,10 +35,26 @@ class HomePageUser extends StatefulWidget {
} }
class _HomePageUserState extends State<HomePageUser> { class _HomePageUserState extends State<HomePageUser> {
// Untuk pake PAGE per index
PageController controller = PageController();
void _scrollToIndex2(int index) {
controller.animateToPage(index,
duration: const Duration(seconds: 2),
curve: Curves.fastLinearToSlowEaseIn);
}
// Untuk pake LIST per height container
ScrollController controller2 = ScrollController();
void _scrollToIndex(double index) {
controller2.animateTo(index,
duration: const Duration(seconds: 1),
curve: Curves.fastLinearToSlowEaseIn);
}
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('MedApp by Eksad', context); // setPageTitle('MedApp by Eksad', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -43,28 +62,87 @@ class _HomePageUserState extends State<HomePageUser> { ...@@ -43,28 +62,87 @@ class _HomePageUserState extends State<HomePageUser> {
appBar: ResponsiveWidget.isSmallScreen(context) appBar: ResponsiveWidget.isSmallScreen(context)
? AppBarKecil() ? AppBarKecil()
: AppbarHomeLarge(screenSize, context, Colors.blue, Colors.black, : AppbarHomeLarge(screenSize, context, Colors.blue, Colors.black,
Colors.black, Colors.black, Colors.black), Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
SmallHome1(), Title(
SmallHome2(), color: Colors.white,
SmallHome3(), child: ListView(
SmallHome4(), scrollDirection: Axis.vertical,
ContactUs2_small(), controller: controller2,
FooterSmall(), children: [
], SmallHome1(wijet: Button_scroll_small()),
) SmallHome2(),
: ListView( SmallHome3(),
children: [ SmallHome4(),
const Home1(), ContactUs2_small(),
const Home2(), FooterSmall(),
const Home3(), ],
const Home4(), ),
ContactUs2(), ),
Footer(), ScrollUpButton(controller2),
], ],
)
: Stack(
children: [
FutureBuilder<dynamic>(
future: getSettingDesc2(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white,
child: ListView(
scrollDirection: Axis.vertical,
controller: controller2,
children: [
Home1(wijet: Button_scroll()),
const Home2(),
const Home3(),
const Home4(),
ContactUs2(),
Footer(),
],
),
);
},
),
ScrollUpButton(controller2),
],
),
);
}
ElevatedButton Button_scroll() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(3780);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8),
),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 17, letterSpacing: 2, fontWeight: FontWeight.w500),
),
);
}
ElevatedButton Button_scroll_small() {
return ElevatedButton(
onPressed: () {
_scrollToIndex(5410);
},
style: ElevatedButton.styleFrom(
primary: const Color(0xff1e5ea8), fixedSize: const Size(50, 20)),
child: Text(
'CONTACT US',
style: GoogleFonts.poppins(
fontSize: 15, letterSpacing: 1.5, fontWeight: FontWeight.w500),
), ),
); );
} }
......
import 'package:flutter/material.dart';
class ScrollUpButton extends StatefulWidget {
const ScrollUpButton(this.controller);
final ScrollController controller;
@override
_ScrollUpButtonState createState() => _ScrollUpButtonState();
}
class _ScrollUpButtonState extends State<ScrollUpButton> {
bool _showScrollUp = false;
@override
void initState() {
super.initState();
widget.controller.addListener(() {
if (widget.controller.position.pixels > 150 && !_showScrollUp) {
setState(() {
_showScrollUp = true;
});
} else if (widget.controller.position.pixels < 150 && _showScrollUp) {
setState(() {
_showScrollUp = false;
});
}
// On GitHub there was a question on how to determine the event
// of widget being scrolled to the bottom. Here's the sample
// if (widget.controller.position.hasViewportDimension &&
// widget.controller.position.pixels >=
// widget.controller.position.maxScrollExtent - 0.01) {
// print('Scrolled to bottom');
//}
});
}
@override
Widget build(BuildContext context) {
return _showScrollUp
? Positioned(
right:20,
bottom: 170,
child: OutlinedButton(
onPressed: () => widget.controller.animateTo(0,
duration: const Duration(milliseconds: 300),
curve: Curves.easeIn),
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(Size(30, 30)),
backgroundColor: MaterialStateProperty.all(Colors.grey[50]),
foregroundColor: MaterialStateProperty.all(Colors.black)),
child: Icon(Icons.arrow_circle_up,color: Colors.grey,)
//child: const Text('Go\nTop',textAlign: TextAlign.center,),
))
: const SizedBox();
}
}
\ No newline at end of file
...@@ -11,7 +11,6 @@ export 'package:medapp_eksad/screen/solution/our_solution.dart'; ...@@ -11,7 +11,6 @@ export 'package:medapp_eksad/screen/solution/our_solution.dart';
export 'package:medapp_eksad/screen/solution/our_solution2.dart'; export 'package:medapp_eksad/screen/solution/our_solution2.dart';
export 'package:medapp_eksad/screen/contact_us/contact_us1.dart'; export 'package:medapp_eksad/screen/contact_us/contact_us1.dart';
export 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; export 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
export 'package:medapp_eksad/screen_small/small_footer.dart';
export 'package:medapp_eksad/screen_small/small_contact/small_contact_us1.dart'; export 'package:medapp_eksad/screen_small/small_contact/small_contact_us1.dart';
export 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart'; export 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
export 'package:medapp_eksad/screen_small/small_home/small_home1.dart'; export 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
......
...@@ -30,15 +30,10 @@ class WAChat extends StatelessWidget { ...@@ -30,15 +30,10 @@ class WAChat extends StatelessWidget {
return FloatingActionButton( return FloatingActionButton(
onPressed: () {}, onPressed: () {},
backgroundColor: Colors.green, backgroundColor: Colors.green,
child: FutureBuilder<List<dynamic>>( child: FutureBuilder<List<dynamic>>(
future: getSosmedDesc(), future: getWaDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0]; var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
wa = pgm['whatsapp']; wa = pgm['whatsapp'];
...@@ -50,7 +45,7 @@ class WAChat extends StatelessWidget { ...@@ -50,7 +45,7 @@ class WAChat extends StatelessWidget {
launchWhatsApp( launchWhatsApp(
phone: wa, phone: wa,
message: message:
'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD'); 'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD');
}, },
child: Spring.rotate( child: Spring.rotate(
endAngle: 360 * 10, endAngle: 360 * 10,
......
...@@ -81,6 +81,7 @@ flutter: ...@@ -81,6 +81,7 @@ flutter:
uses-material-design: true uses-material-design: true
assets: assets:
- assets/file/
- assets/icons/ - assets/icons/
- assets/logo/ - assets/logo/
- assets/images/ - assets/images/
......
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