Commit 799c82c4 authored by Ade Fikriatul  Ilmi's avatar Ade Fikriatul Ilmi

menambahkan get public and post

parent afdcae7d
......@@ -26,10 +26,11 @@ Future<bool> createSosmed (wa, ln, tw, ig, yt) async{
}
}
Future<bool> updateSosmed (wa,ln,tw,ig,yt) async {
Future<bool> updateSosmed (wa, ln, tw, ig, yt) async {
final response = await http
.put(Uri.parse('$cmd/settingsosmed/updateSettingSosmed'),
.put(Uri.parse('$cmd/settingsosmed/saveSettingSosmed'),
body: jsonEncode({
// 'idSettingSosmed': id,
'whatsapp': wa,
'linkedin': ln,
'twitter': tw,
......
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:medapp_eksad/api/sosmed_api.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:spring/spring.dart';
......@@ -6,7 +7,7 @@ class WAChat extends StatelessWidget {
WAChat({Key? key}) : super(key: key);
void launchWhatsApp({
required final int phone,
required final String phone,
required String message,
}) async {
String url() {
......@@ -21,32 +22,47 @@ class WAChat extends StatelessWidget {
}
final SpringController springController =
SpringController(initialAnim: Motion.play);
SpringController(initialAnim: Motion.play);
String wa = '';
@override
Widget build(BuildContext context) {
return FloatingActionButton(
onPressed: () {},
backgroundColor: Colors.green,
onPressed: (){
springController.play(
motion: Motion.reverse,
animDuration: const Duration(milliseconds: 1000),
curve: Curves.easeInBack,
delay: const Duration(milliseconds: 100));
launchWhatsApp(
phone: 6287701892981,
message:
'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD');
},
child: Spring.rotate(
endAngle: 360 * 10,
animDuration: const Duration(seconds: 3 * 10),
springController: springController,
alignment: Alignment.center,
animStatus: (AnimStatus status) {},
child: const Icon(Icons.whatsapp, size: 40,color: Colors.white,),
child: FutureBuilder<List<dynamic>>(
future: getSosmedDesc(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
if (snapshot.hasError ||
snapshot.data == null ||
snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
}
return GestureDetector(
onTap: () {
wa = pgm['whatsapp'];
springController.play(
motion: Motion.reverse,
animDuration: const Duration(milliseconds: 1000),
curve: Curves.easeInBack,
delay: const Duration(milliseconds: 100));
launchWhatsApp(
phone: wa,
message:
'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD');
},
child: Spring.rotate(
endAngle: 360 * 10,
animDuration: const Duration(seconds: 3 * 10),
springController: springController,
alignment: Alignment.center,
animStatus: (AnimStatus status) {},
child: const Icon(Icons.whatsapp, size: 30),
),
);
},
),
);
}
}
//phone: 81807890777,
\ 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