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 {
}
}
Future<bool> updateSetting(id, image, name, title, email, no,) async {
Future<bool> updateSetting(id, title, email, no,) async {
final response = await http
.put(Uri.parse('$cmd/setting/updateSetting'),
body: jsonEncode({
"idsetting": id,
"image": image,
"name": name,
// "image": image,
//"name": name,
"title": title,
// "tagline": tagline,
"email": email,
"no": no,
"idrole": "R001",
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
......@@ -61,3 +61,9 @@ Future<List<dynamic>> getSettingDesc() async {
Uri.parse('$qry/setting/getSettingByIdDesc'));
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> {
content: Form(
child: Container(
padding: EdgeInsets.only(
left: screenSize.width * 0.045,
left: screenSize.width * 0.040,
top: screenSize.height * 0.01),
width: screenSize.width * 0.50,
height: screenSize.height * 0.50,
width: screenSize.width * 0.55,
height: screenSize.height * 0.55,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
......
This diff is collapsed.
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/screen_small/small_contact/small_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';
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_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart';
......@@ -32,10 +35,26 @@ class HomePage extends StatefulWidget {
}
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>();
@override
Widget build(BuildContext context) {
setPageTitle('MedApp by Eksad', context);
// setPageTitle('MedApp by Eksad', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......@@ -46,19 +65,47 @@ class _HomePageState extends State<HomePage> {
Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? ListView(
children: const [
SmallHome1(),
? 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: [
SmallHome1(wijet: Button_scroll_small()),
SmallHome2(),
SmallHome3(),
SmallHome4(),
ContactUs2_small(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
)
: ListView(
: 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: [
const Home1(),
Home1(wijet: Button_scroll()),
const Home2(),
const Home3(),
const Home4(),
......@@ -67,6 +114,43 @@ class _HomePageState extends State<HomePage> {
],
),
);
},
),
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() {
......
......@@ -37,12 +37,11 @@ class _SignInState extends State<SignIn> {
@override
Widget build(BuildContext context) {
setPageTitle('Login MedApps', context);
// setPageTitle('Login MedApps', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
......@@ -57,7 +56,6 @@ class _SignInState extends State<SignIn> {
bottom: screenSize.height * 0.13),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: const Color.fromARGB(255, 10, 116, 255),
......@@ -71,7 +69,8 @@ class _SignInState extends State<SignIn> {
),
Padding(
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(
width: screenSize.width * 0.3,
height: screenSize.height * 0.6,
......@@ -106,8 +105,8 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.only(left: screenSize.width * 0.055),
padding: EdgeInsets.only(
left: screenSize.width * 0.055),
height: screenSize.width * 0.02,
child: Image.asset("assets/logo/medapp-logo.png"),
),
......@@ -136,8 +135,15 @@ class _SignInState extends State<SignIn> {
child: TextFormField(
controller: emailController,
textAlign: TextAlign.start,
onFieldSubmitted: (String value){
onFieldSubmitted: (String value) {
if (emailController.value.text ==
'admin@admin.com' &&
passwordController.value.text ==
'administrator') {
Navigator.pushNamed(context, '/dashboard');
} else {
loginUser();
}
},
decoration: InputDecoration(
labelText: "Enter Your Email",
......@@ -183,8 +189,15 @@ class _SignInState extends State<SignIn> {
width: screenSize.width * 0.2,
child: TextFormField(
controller: passwordController,
onFieldSubmitted: (String value){
onFieldSubmitted: (String value) {
if (emailController.value.text ==
'admin@admin.com' &&
passwordController.value.text ==
'administrator') {
Navigator.pushNamed(context, '/dashboard');
} else {
loginUser();
}
},
textAlign: TextAlign.start,
obscureText: _isObscure,
......@@ -224,10 +237,15 @@ class _SignInState extends State<SignIn> {
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(onPressed: (){
Navigator.pushNamed(context, '/reset_password');
}, child: Text('Forgot Password?')),
SizedBox(width: 52,)
TextButton(
onPressed: () {
Navigator.pushNamed(
context, '/reset_password');
},
child: Text('Forgot Password?')),
SizedBox(
width: 52,
)
],
),
const Spacer(
......@@ -240,10 +258,13 @@ class _SignInState extends State<SignIn> {
width: screenSize.width * 0.08,
child: ElevatedButton(
onPressed: () {
if (emailController.value.text == 'admin@admin.com' &&
passwordController.value.text == 'administrator') {
Navigator.pushNamed(context, '/dashboard');
}else{
if (emailController.value.text ==
'admin@admin.com' &&
passwordController.value.text ==
'administrator') {
Navigator.pushNamed(
context, '/dashboard');
} else {
loginUser();
}
// if (emailController.value.text == emailController &&
......@@ -321,9 +342,11 @@ class _SignInState extends State<SignIn> {
),
Padding(
padding: const EdgeInsets.all(21.0),
child: ElevatedButton(onPressed: (){
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/');
}, child: Icon(Icons.arrow_back)),
},
child: Icon(Icons.arrow_back)),
),
],
),
......
......@@ -40,7 +40,7 @@ class MyApp extends StatelessWidget {
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: "MedApp by Eksad",
// title: "MedApp by Eksad",
initialRoute: '/',
routes: {
'/': (context) => const HomePage(),
......
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/screen_small/small_contact/small_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';
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_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart';
......@@ -32,10 +35,26 @@ class AboutUs extends StatefulWidget {
}
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>();
@override
Widget build(BuildContext context) {
setPageTitle('About Us', context);
// setPageTitle('About Us', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......@@ -46,19 +65,47 @@ class _AboutUsState extends State<AboutUs> {
Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? ListView(
children: const [
SmallHome1(),
? 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: [
SmallHome1(wijet: Button_scroll_small()),
SmallHome2(),
SmallHome3(),
SmallHome4(),
ContactUs2_small(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
)
: ListView(
: 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: [
const Home1(),
Home1(wijet: Button_scroll()),
const Home2(),
const Home3(),
const Home4(),
......@@ -67,6 +114,43 @@ class _AboutUsState extends State<AboutUs> {
],
),
);
},
),
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() {
......
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/screen_small/small_contact/small_contact_us1.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';
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/footer.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart';
......@@ -26,10 +29,26 @@ class ContactUs extends StatefulWidget {
}
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>();
@override
Widget build(BuildContext context) {
setPageTitle('Contact Us', context);
// setPageTitle('Contact Us', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......@@ -39,22 +58,86 @@ class _ContactUsState extends State<ContactUs> {
Colors.black, Colors.black, Colors.blue),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? ListView(
children: const [
ContactUs1_small(),
? 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: [
ContactUs1_small(wijet: Button_scroll_small()),
ContactUs2_small(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
)
: ListView(
: 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: [
ContactUs1(),
ContactUs1(wijet: Button_scroll()),
ContactUs2(),
Footer(),
],
),
);
},
),
ScrollUpButton(controller2),
],
),
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';
import 'package:google_fonts/google_fonts.dart';
class ContactUs1 extends StatefulWidget {
const ContactUs1({Key? key}) : super(key: key);
ContactUs1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override
State<ContactUs1> createState() => _ContactUsState();
......
......@@ -18,6 +18,9 @@ class ContactUs2 extends StatelessWidget {
final emailController = TextEditingController();
final messageController = TextEditingController();
String pattern =
r'(\+62|62|0)(\d{2,3})?\)?[ .-]?\d{2,4}[ .-]?\d{2,4}[ .-]?\d{2,4}';
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
......@@ -186,6 +189,8 @@ class ContactUs2 extends StatelessWidget {
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your phone number';
} else if (!RegExp(pattern).hasMatch(value)) {
return 'Start with 628 or 08';
}
return null;
},
......
This diff is collapsed.
......@@ -6,7 +6,8 @@ import 'package:medapp_eksad/widget/button_color.dart';
import 'package:show_up_animation/show_up_animation.dart';
class Home1 extends StatelessWidget {
const Home1({Key? key}) : super(key: key);
Home1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override
Widget build(BuildContext context) {
......
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/screen/contact_us/contact_us2.dart';
import 'package:medapp_eksad/screen/footer.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_solution/small_solution1.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/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
......@@ -39,7 +42,7 @@ class _SolutionsState extends State<Solutions> {
@override
Widget build(BuildContext context) {
setPageTitle('MeddApp Solutions', context);
// setPageTitle('MeddApp Solutions', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......@@ -50,17 +53,44 @@ class _SolutionsState extends State<Solutions> {
Colors.blue, Colors.black, Colors.black),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? ListView(
children: const [
SmallOurSolution(),
? 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: [
SmallOurSolution(wijet: Button_scroll()),
SmallOurSolution2(),
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
)
: ListView(
: 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(
controller: controller2,
children: [
OurSolution(
wijet: Button_scroll(),
button: ButtonSolution(context),
),
OurSolution2(),
......@@ -69,6 +99,12 @@ class _SolutionsState extends State<Solutions> {
],
),
);
},
),
ScrollUpButton(controller2),
],
),
);
}
ElevatedButton ButtonSolution(BuildContext context) {
......@@ -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() {
return AppBar(
leading: IconButton(
......
......@@ -2,11 +2,14 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart';
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 wijet;
@override
Widget build(BuildContext context) {
......
......@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
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
State<ContactUs1_small> createState() => _ContactUsState();
......
This diff is collapsed.
......@@ -3,9 +3,9 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:medapp_eksad/widget/button_color.dart';
import 'package:show_up_animation/show_up_animation.dart';
class SmallHome1 extends StatelessWidget {
const SmallHome1({Key? key}) : super(key: key);
SmallHome1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override
Widget build(BuildContext context) {
......
......@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart';
class SmallOurSolution extends StatefulWidget {
const SmallOurSolution({Key? key}) : super(key: key);
SmallOurSolution({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override
State<SmallOurSolution> createState() => _SmallOurSolutionState();
......@@ -56,7 +57,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
style: GoogleFonts.poppins(
fontSize: 34,
fontWeight: FontWeight.bold,
color: Colors.black87),
color: Colors.white),
textAlign: TextAlign.center,
),
),
......@@ -76,7 +77,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
letterSpacing: 1.8,
height: 1.4,
fontWeight: FontWeight.bold,
color: Colors.black87),
color: Colors.white),
textAlign: TextAlign.center,
),
),
......
......@@ -30,7 +30,7 @@ class _DemoUserState extends State<DemoUser> {
@override
Widget build(BuildContext context) {
setPageTitle('Free Demo Medapp', context);
// setPageTitle('Free Demo Medapp', context);
var screenSize = MediaQuery.of(context).size;
final user = context.read<FirebaseAuthMethods>().user;
final String mail = user.email!;
......
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/screen_small/small_contact/small_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';
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_home4.dart';
import 'package:medapp_eksad/widget/Scroll_top.dart';
import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart';
......@@ -32,10 +35,26 @@ class HomePageUser extends StatefulWidget {
}
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>();
@override
Widget build(BuildContext context) {
setPageTitle('MedApp by Eksad', context);
// setPageTitle('MedApp by Eksad', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......@@ -46,19 +65,40 @@ class _HomePageUserState extends State<HomePageUser> {
Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? ListView(
children: const [
SmallHome1(),
? Stack(
children: [
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: [
const Home1(),
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(),
......@@ -67,6 +107,44 @@ class _HomePageUserState extends State<HomePageUser> {
],
),
);
},
),
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() {
......
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';
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_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_us2.dart';
export 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
......
......@@ -31,14 +31,9 @@ class WAChat extends StatelessWidget {
onPressed: () {},
backgroundColor: Colors.green,
child: FutureBuilder<List<dynamic>>(
future: getSosmedDesc(),
future: getWaDesc(),
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'];
......
......@@ -81,6 +81,7 @@ flutter:
uses-material-design: true
assets:
- assets/file/
- assets/icons/
- assets/logo/
- 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