Commit 6e6511ba authored by Ade Fikriatul  Ilmi's avatar Ade Fikriatul Ilmi

fixing title dan scroll up di mobile and

parent 90e1188c
......@@ -67,7 +67,12 @@ class _HomePageState extends State<HomePage> {
body: ResponsiveWidget.isSmallScreen(context)
? Stack(
children: [
Title(
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,
......@@ -81,6 +86,8 @@ class _HomePageState extends State<HomePage> {
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
......@@ -112,7 +119,6 @@ class _HomePageState extends State<HomePage> {
ScrollUpButton(controller2),
],
),
);
}
......
......@@ -37,7 +37,7 @@ 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(
......
......@@ -64,11 +64,15 @@ class _AboutUsState extends State<AboutUs> {
: AppbarHomeLarge(screenSize, context, Colors.black, Colors.blue,
Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context)
? Stack(
children: [
Title(
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,
......@@ -82,6 +86,8 @@ class _AboutUsState extends State<AboutUs> {
FooterSmall(),
],
),
);
},
),
ScrollUpButton(controller2),
],
......@@ -113,7 +119,6 @@ class _AboutUsState extends State<AboutUs> {
ScrollUpButton(controller2),
],
),
);
}
......
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();
......
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();
......
......@@ -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,
),
),
......
......@@ -25,7 +25,7 @@ class _DemoUserState extends State<DemoUser> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
setPageTitle('Free Demo Medapp', context);
// setPageTitle('Free Demo Medapp', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
key: _scaffoldKey,
......
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