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