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> { ...@@ -67,7 +67,12 @@ class _HomePageState extends State<HomePage> {
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? Stack( ? Stack(
children: [ children: [
Title( FutureBuilder<dynamic>(
future: getSettingDesc2(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white, color: Colors.white,
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
...@@ -81,6 +86,8 @@ class _HomePageState extends State<HomePage> { ...@@ -81,6 +86,8 @@ class _HomePageState extends State<HomePage> {
FooterSmall(), FooterSmall(),
], ],
), ),
);
},
), ),
ScrollUpButton(controller2), ScrollUpButton(controller2),
], ],
...@@ -112,7 +119,6 @@ class _HomePageState extends State<HomePage> { ...@@ -112,7 +119,6 @@ class _HomePageState extends State<HomePage> {
ScrollUpButton(controller2), ScrollUpButton(controller2),
], ],
), ),
); );
} }
......
...@@ -37,7 +37,7 @@ class _SignInState extends State<SignIn> { ...@@ -37,7 +37,7 @@ class _SignInState extends State<SignIn> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Login MedApps', context); // setPageTitle('Login MedApps', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
body: Stack( body: Stack(
......
...@@ -64,11 +64,15 @@ class _AboutUsState extends State<AboutUs> { ...@@ -64,11 +64,15 @@ class _AboutUsState extends State<AboutUs> {
: AppbarHomeLarge(screenSize, context, Colors.black, Colors.blue, : AppbarHomeLarge(screenSize, context, Colors.black, Colors.blue,
Colors.black, Colors.black, Colors.black), Colors.black, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? Stack( ? Stack(
children: [ children: [
Title( FutureBuilder<dynamic>(
future: getSettingDesc2(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
var pgm = snapshot.data[0];
return Title(
title: pgm['title'],
color: Colors.white, color: Colors.white,
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
...@@ -82,6 +86,8 @@ class _AboutUsState extends State<AboutUs> { ...@@ -82,6 +86,8 @@ class _AboutUsState extends State<AboutUs> {
FooterSmall(), FooterSmall(),
], ],
), ),
);
},
), ),
ScrollUpButton(controller2), ScrollUpButton(controller2),
], ],
...@@ -113,7 +119,6 @@ class _AboutUsState extends State<AboutUs> { ...@@ -113,7 +119,6 @@ class _AboutUsState extends State<AboutUs> {
ScrollUpButton(controller2), ScrollUpButton(controller2),
], ],
), ),
); );
} }
......
import 'package:flutter/material.dart'; 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/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_us1.dart';
import 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.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'; ...@@ -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_us1.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
import 'package:medapp_eksad/screen/footer.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/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart'; import 'package:medapp_eksad/widget/whatsapp.dart';
...@@ -26,10 +29,26 @@ class ContactUs extends StatefulWidget { ...@@ -26,10 +29,26 @@ class ContactUs extends StatefulWidget {
} }
class _ContactUsState extends State<ContactUs> { 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>(); final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Contact Us', context); // setPageTitle('Contact Us', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -39,22 +58,86 @@ class _ContactUsState extends State<ContactUs> { ...@@ -39,22 +58,86 @@ class _ContactUsState extends State<ContactUs> {
Colors.black, Colors.black, Colors.blue), Colors.black, Colors.black, Colors.blue),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
ContactUs1_small(), 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(), ContactUs2_small(),
FooterSmall(), 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: [ children: [
ContactUs1(), ContactUs1(wijet: Button_scroll()),
ContactUs2(), ContactUs2(),
Footer(), Footer(),
], ],
), ),
);
},
),
ScrollUpButton(controller2),
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, 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'; ...@@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
class ContactUs1 extends StatefulWidget { class ContactUs1 extends StatefulWidget {
const ContactUs1({Key? key}) : super(key: key); ContactUs1({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
State<ContactUs1> createState() => _ContactUsState(); State<ContactUs1> createState() => _ContactUsState();
......
import 'package:flutter/material.dart'; 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/appbar/appbar_home.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us2.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
import 'package:medapp_eksad/screen/footer.dart'; import 'package:medapp_eksad/screen/footer.dart';
...@@ -8,6 +10,7 @@ import 'package:medapp_eksad/screen/solution/our_solution3.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_footer.dart';
import 'package:medapp_eksad/screen_small/small_solution/small_solution1.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/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/componen.dart';
import 'package:medapp_eksad/widget/drawer.dart'; import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart'; import 'package:medapp_eksad/widget/responsive.dart';
...@@ -39,7 +42,7 @@ class _SolutionsState extends State<Solutions> { ...@@ -39,7 +42,7 @@ class _SolutionsState extends State<Solutions> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('MeddApp Solutions', context); // setPageTitle('MeddApp Solutions', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
...@@ -50,17 +53,44 @@ class _SolutionsState extends State<Solutions> { ...@@ -50,17 +53,44 @@ class _SolutionsState extends State<Solutions> {
Colors.blue, Colors.black, Colors.black), Colors.blue, Colors.black, Colors.black),
drawer: const DrawerMedApp(), drawer: const DrawerMedApp(),
body: ResponsiveWidget.isSmallScreen(context) body: ResponsiveWidget.isSmallScreen(context)
? ListView( ? Stack(
children: const [ children: [
SmallOurSolution(), 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(), SmallOurSolution2(),
FooterSmall(), 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, controller: controller2,
children: [ children: [
OurSolution( OurSolution(
wijet: Button_scroll(),
button: ButtonSolution(context), button: ButtonSolution(context),
), ),
OurSolution2(), OurSolution2(),
...@@ -69,6 +99,12 @@ class _SolutionsState extends State<Solutions> { ...@@ -69,6 +99,12 @@ class _SolutionsState extends State<Solutions> {
], ],
), ),
); );
},
),
ScrollUpButton(controller2),
],
),
);
} }
ElevatedButton ButtonSolution(BuildContext context) { ElevatedButton ButtonSolution(BuildContext context) {
...@@ -95,6 +131,37 @@ class _SolutionsState extends State<Solutions> { ...@@ -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() { AppBar AppBarKecil() {
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
......
...@@ -2,11 +2,14 @@ import 'package:flutter/material.dart'; ...@@ -2,11 +2,14 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class OurSolution extends StatelessWidget { 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 button;
final Widget wijet;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
......
...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
class ContactUs1_small extends StatefulWidget { 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 @override
State<ContactUs1_small> createState() => _ContactUsState(); State<ContactUs1_small> createState() => _ContactUsState();
......
...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:show_up_animation/show_up_animation.dart'; import 'package:show_up_animation/show_up_animation.dart';
class SmallOurSolution extends StatefulWidget { class SmallOurSolution extends StatefulWidget {
const SmallOurSolution({Key? key}) : super(key: key); SmallOurSolution({Key? key, required this.wijet}) : super(key: key);
final Widget wijet;
@override @override
State<SmallOurSolution> createState() => _SmallOurSolutionState(); State<SmallOurSolution> createState() => _SmallOurSolutionState();
...@@ -56,7 +57,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> { ...@@ -56,7 +57,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 34, fontSize: 34,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black87), color: Colors.white),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
...@@ -76,7 +77,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> { ...@@ -76,7 +77,7 @@ class _SmallOurSolutionState extends State<SmallOurSolution> {
letterSpacing: 1.8, letterSpacing: 1.8,
height: 1.4, height: 1.4,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black87), color: Colors.white),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
......
...@@ -25,7 +25,7 @@ class _DemoUserState extends State<DemoUser> { ...@@ -25,7 +25,7 @@ class _DemoUserState extends State<DemoUser> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Free Demo Medapp', context); // setPageTitle('Free Demo Medapp', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
return Scaffold( return Scaffold(
key: _scaffoldKey, 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