218 lines
8.2 KiB
Dart
218 lines
8.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:nhance_app_pwa/customAppBar/customAppBar.dart';
|
|
import 'package:nhance_app_pwa/pages/postEnrollment/service/svg_service.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import '../../customAppBar/customFooter.dart';
|
|
import '../../customAppBar/responsive.dart';
|
|
import '../../customAppBar/tabs.dart';
|
|
|
|
class wellness extends StatefulWidget {
|
|
const wellness({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<wellness> createState() => _wellnessState();
|
|
}
|
|
|
|
class _wellnessState extends State<wellness> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
super.dispose();
|
|
}
|
|
|
|
// Function to open URL in the default browser
|
|
Future<void> _launchURL(String url) async {
|
|
final Uri uri = Uri.parse(url); // Parse the URL properly
|
|
print('_launchURL $uri');
|
|
if (uri != null) {
|
|
print('If $uri');
|
|
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
|
} else {
|
|
print('else $uri');
|
|
throw 'Could not launch $url';
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: CustomAppBar(),
|
|
body: Stack(children: [
|
|
SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment
|
|
.center, // Center both text and button vertically
|
|
children: <Widget>[
|
|
Container(
|
|
padding: Responsive.isDesktop(context)
|
|
? EdgeInsets.only(top: 15, bottom: 15, left: 25, right: 25)
|
|
: EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
flex: 12,
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.pushNamed(context, 'home');
|
|
},
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Icon(
|
|
Icons
|
|
.chevron_left, // Replace with your desired icon
|
|
color: Color(0xFF000000),
|
|
size: 30,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
flex: 12,
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Image.asset(
|
|
'assets/wellness.png', // Path to your image in assets folder
|
|
width: 250,
|
|
height: 250,
|
|
),
|
|
],
|
|
))),
|
|
],
|
|
),
|
|
// Add more rows as needed
|
|
],
|
|
),
|
|
),
|
|
SizedBox(height: 15),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white, // Set background color for the container
|
|
),
|
|
padding: Responsive.isDesktop(context)
|
|
? EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10)
|
|
: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.only(bottom: 10),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
'Nhance Account Manager Contact\nWellness is the active pursuit of activities and lifestyle choices that contribute to holistic physical, mental, and emotional well-being. It involves balancing various aspects of health to achieve a fulfilling and healthy life.',
|
|
textAlign:
|
|
TextAlign.center, // Center align the text
|
|
style: GoogleFonts.poppins(
|
|
fontSize:
|
|
Responsive.isDesktop(context) ? 16 : 12,
|
|
fontWeight: FontWeight.w400,
|
|
color: Color(0xFF777777),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
]),
|
|
),
|
|
SizedBox(height: 20), // Space between text and button
|
|
ElevatedButton(
|
|
onPressed: () {
|
|
_launchURL(
|
|
'https://venbait.in/nhance/dev/download-e-card/Oef7qV'); // Redirect to the browser on button click
|
|
},
|
|
child: Text(
|
|
'Wellness',
|
|
style: GoogleFonts.poppins(color: Colors.white),
|
|
),
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: Color(0xFFE26728),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(5),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
if (Responsive.isDesktop(context))
|
|
Align(
|
|
alignment: Alignment.bottomCenter,
|
|
child: Container(
|
|
width: double.infinity, // Make the footer full width
|
|
child: CustomFooter(),
|
|
),
|
|
),
|
|
]),
|
|
floatingActionButton: Responsive.isDesktop(context)
|
|
? null
|
|
: FloatingActionButton(
|
|
onPressed: () {
|
|
Navigator.pushNamed(context, 'chatbot');
|
|
},
|
|
child: Icon(Icons.chat),
|
|
),
|
|
floatingActionButtonLocation: Responsive.isDesktop(context)
|
|
? null
|
|
: FloatingActionButtonLocation.miniEndFloat,
|
|
bottomNavigationBar: Responsive.isDesktop(context)
|
|
? null
|
|
: CustomBottomNavigationBar(
|
|
onTabChanged: (index) {
|
|
// Add your navigation logic here
|
|
// For example:
|
|
if (index == 0) {
|
|
Navigator.pushNamed(context, 'home');
|
|
} else if (index == 1) {
|
|
Navigator.pushNamed(context, 'claims');
|
|
} else if (index == 2) {
|
|
Navigator.pushNamed(context, 'profile');
|
|
} else if (index == 3) {
|
|
Navigator.pushNamed(context, 'help');
|
|
} else if (index == 4) {
|
|
Navigator.pushNamed(context, 'wellness');
|
|
}
|
|
},
|
|
icons: [
|
|
Icons.home_outlined,
|
|
Icons.sticky_note_2_outlined,
|
|
Icons.person_outline_outlined,
|
|
Icons.headset_mic_outlined,
|
|
Icons.health_and_safety_outlined,
|
|
],
|
|
labels: [
|
|
"Home",
|
|
"Claim",
|
|
"Profile",
|
|
"Help",
|
|
"Wellness",
|
|
],
|
|
initialIndex: 4, // Initial index of the bottom navigation bar
|
|
),
|
|
);
|
|
}
|
|
}
|