Commit 5c18e929 authored by Fikri's avatar Fikri

menambahkan setting

parent c07c7e6f
import 'dart:convert';
import 'package:http/http.dart' as http;
var cmd = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/cmd';
var qry = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/qry';
Future<bool> createSetting(im, tt, em, no) async {
final response = await http.post(
Uri.parse('$cmd/setting/saveSetting'),
body: jsonEncode(
{
"image": im,
"title": tt,
// "tagline": tl,
"email": em,
"no": no,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> updateSetting(id, image, name, title, email, no,) async {
final response = await http
.put(Uri.parse('$cmd/setting/updateSetting'),
body: jsonEncode({
"idsetting": id,
"image": image,
"name": name,
"title": title,
// "tagline": tagline,
"email": email,
"no": no,
"idrole": "R001",
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<List<dynamic>> getSetting() async {
var response = await http.get(
Uri.parse('$cmd/setting/getAllSettingByIdRole'));
return jsonDecode(response.body)['data'];
}
Future<List<dynamic>> getSettingDesc() async {
var response = await http.get(
Uri.parse('$qry/setting/getSettingByIdDesc'));
return jsonDecode(response.body)['data'];
}
This diff is collapsed.
......@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:easy_sidemenu/easy_sidemenu.dart';
import 'package:medapp_eksad/dashboard/admin/admin_contact.dart';
import 'package:medapp_eksad/dashboard/admin/admin_dashboard.dart';
import 'package:medapp_eksad/dashboard/admin/admin_setting.dart';
import 'package:medapp_eksad/dashboard/admin/admin_sosmed.dart';
import 'package:medapp_eksad/dashboard/admin/admin_userControl.dart';
import 'package:medapp_eksad/dashboard/admin/admin_whatsapp.dart';
......@@ -123,7 +124,7 @@ class _DashboardAdminState extends State<DashboardAdmin> {
),
SideMenuItem(
priority: 1,
title: 'Files',
title: 'Setting',
onTap: () {
page.jumpToPage(1);
},
......@@ -159,15 +160,7 @@ class _DashboardAdminState extends State<DashboardAdmin> {
controller: page,
children: [
const Dashboard1(),
Container(
color: Colors.white,
child: const Center(
child: Text(
'Files',
style: TextStyle(fontSize: 35),
),
),
),
SettingDashboard(),
SosmedDashboard(),
//Dashboard3(),
Dashboard4(),
......
......@@ -3,6 +3,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
import '../api/setting_api.dart';
class Footer extends StatelessWidget {
const Footer({Key? key}) : super(key: key);
......@@ -11,7 +13,7 @@ class Footer extends StatelessWidget {
var screenSize = MediaQuery.of(context).size;
return Container(
width: screenSize.width,
height: screenSize.height * 0.78,
height: screenSize.height * 0.80,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
......@@ -25,7 +27,7 @@ class Footer extends StatelessWidget {
),
Container(
width: screenSize.width,
height: screenSize.height * 0.55,
height: screenSize.height * 0.50,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -212,10 +214,12 @@ class Footer extends StatelessWidget {
letterSpacing: 1.5),
),
),
SizedBox(height: 10,),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.04,
child: itemBawah(
child: itemBawah(
item: 'Catalog',
routeName: '/solutions',
),
......@@ -248,7 +252,7 @@ class Footer extends StatelessWidget {
)),
Container(
width: screenSize.width * 0.25,
height: screenSize.height * 0.55,
height: screenSize.height * 0.75,
//color: Colors.blue,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -266,30 +270,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,
),
),
),
),
),
),
TelphoneApi(),
Container(
width: screenSize.width * 0.2,
child: ListTile(
......@@ -383,3 +365,56 @@ 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.01,
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
),
)),
),
);
},
);
}
}
......@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
version: "2.8.2"
badges:
dependency: transitive
description:
......@@ -42,14 +42,21 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
version: "1.1.0"
collection:
dependency: transitive
description:
......@@ -57,6 +64,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3+2"
crypto:
dependency: transitive
description:
......@@ -98,7 +112,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.3.0"
ffi:
dependency: transitive
description:
......@@ -113,6 +127,55 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
file_picker:
dependency: "direct main"
description:
name: file_picker
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.1"
firebase_auth:
dependency: "direct main"
description:
name: firebase_auth
url: "https://pub.dartlang.org"
source: hosted
version: "3.9.0"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "6.8.0"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.1"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.22.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.1"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.2"
flutter:
dependency: "direct main"
description: flutter
......@@ -125,6 +188,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
flutter_test:
dependency: "direct dev"
description: flutter
......@@ -177,6 +247,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+3"
image_picker_android:
dependency: transitive
description:
name: image_picker_android
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+3"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.8"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.6+1"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
intl:
dependency: "direct main"
description:
......@@ -204,28 +309,35 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.12"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.7.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
version: "1.8.1"
path_provider:
dependency: transitive
description:
......@@ -303,6 +415,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.3"
scaled_list:
dependency: "direct main"
description:
......@@ -335,7 +454,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.8.2"
spring:
dependency: "direct main"
description:
......@@ -363,7 +482,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
version: "1.1.0"
supercharged:
dependency: transitive
description:
......@@ -384,14 +503,14 @@ packages:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
version: "0.4.9"
typed_data:
dependency: transitive
description:
......
......@@ -38,6 +38,8 @@ dependencies:
easy_sidemenu: ^0.3.1
form_validator: ^1.0.0
form_field_validator: ^1.0.1
image_picker: ^0.8.5+3
file_picker: ^5.0.1
flutter_web_plugins:
sdk: flutter
......
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