Commit f6f3af4a authored by Fikri's avatar Fikri

menampilkan hasil get setting di public

parent 00648504
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/api/setting_api.dart';
import 'package:url_launcher/url_launcher.dart';
class Footer extends StatelessWidget {
......@@ -268,53 +269,8 @@ class Footer extends StatelessWidget {
),
),
const SizedBox(height: 8),
Container(
width: screenSize.width * 0.2,
child: ListTile(
leading: const Icon(
Icons.phone,
size: 22,
),
title: TextButton(
onPressed: () {
launch('tel:02157958040');
},
child: Container(
height: screenSize.height * 0.04,
child: Text(
'(021) 5795 - 8040',
style: GoogleFonts.poppins(
fontSize: 16,
color: Colors.black87,
),
),
),
),
),
),
Container(
width: screenSize.width * 0.2,
child: ListTile(
leading: const Icon(
Icons.mail,
size: 22,
),
title: TextButton(
onPressed: () {
launch(
'mailto:Hello@eksad.com?subject=Hello saya ingin bertanya tentang Medapp');
},
child: Container(
height: screenSize.height * 0.04,
child: Text(
'Hello@eksad.com',
style: GoogleFonts.poppins(
fontSize: 16, color: Colors.black87),
),
),
),
),
),
TelphoneApi(),
EmailAPI(),
Container(
width: screenSize.width * 0.25,
height: screenSize.height * 0.29,
......@@ -385,3 +341,97 @@ class itemBawah extends StatelessWidget {
));
}
}
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(
width: screenSize.width * 0.19,
child: ListTile(
leading: const Icon(
Icons.phone,
size: 23,
color: Colors.black,
),
title: TextButton(
onPressed: () {
no = pgm['no'];
//02157958040
launch('tel:$no');
},
child: Text(
pgm['no'],
style: GoogleFonts.poppins(
fontSize: 16, 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(
width: screenSize.width * 0.2,
child: ListTile(
leading: const Icon(
Icons.mail,
size: 23,
color: Colors.black,
),
title: TextButton(
onPressed: () {
email = pgm['email'];
launch('mailto:$email?subject=Info MCS');
},
// child: SettingAPI(),
child: Text(
pgm['email'],
style: GoogleFonts.poppins(
fontSize: 16, color: Colors.black87, letterSpacing: 1.1),
)),
),
);
},
);
}
}
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