@@ -1,3 +1,4 @@
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
@@ -11,6 +12,16 @@ class DetailsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DetailsScreenState extends State<DetailsScreen> {
|
||||
int _current = 0;
|
||||
final CarouselController _controller = CarouselController();
|
||||
final List imgList = [
|
||||
{'id': 1, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
|
||||
{'id': 2, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
|
||||
{'id': 3, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
|
||||
{'id': 4, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
|
||||
{'id': 5, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -54,13 +65,58 @@ class _DetailsScreenState extends State<DetailsScreen> {
|
||||
topLeft: Radius.circular(20.0),
|
||||
topRight: Radius.circular(20.0),
|
||||
),
|
||||
child: Image.asset(
|
||||
'assets/images/portfolio_screen/detailsbg.png',
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
alignment: Alignment.topCenter,
|
||||
child: CarouselSlider(
|
||||
items: imgList
|
||||
.map(
|
||||
(item) => Image.asset(
|
||||
item['img_path'],
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
alignment: Alignment.topCenter,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
carouselController: _controller,
|
||||
options: CarouselOptions(
|
||||
scrollPhysics: const BouncingScrollPhysics(),
|
||||
autoPlay: true,
|
||||
aspectRatio: 2,
|
||||
viewportFraction: 1,
|
||||
onPageChanged: (index, reason) {
|
||||
setState(() {
|
||||
_current = index;
|
||||
});
|
||||
}),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 17.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children:
|
||||
imgList.asMap().entries.map((entry) {
|
||||
return GestureDetector(
|
||||
onTap: () =>
|
||||
_controller.animateToPage(entry.key),
|
||||
child: Container(
|
||||
width: 20.w,
|
||||
height: 7.h,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 3.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
color: (_current == entry.key)
|
||||
? Colors.white
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
top: 20,
|
||||
left: 20,
|
||||
|
||||
@@ -45,7 +45,8 @@ class BottomSection extends StatelessWidget {
|
||||
successToastMessage(context, "login successful !");
|
||||
goRouter.pop();
|
||||
|
||||
goRouter.goNamed(RouteName.biometricScreen);
|
||||
// goRouter.goNamed(RouteName.biometricScreen);
|
||||
goRouter.goNamed(RouteName.mainScreen);
|
||||
} else if (state is LoginFailure) {
|
||||
goRouter.pop();
|
||||
errorToastMessage(
|
||||
|
||||
@@ -105,6 +105,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
carousel_slider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: carousel_slider
|
||||
sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -76,6 +76,7 @@ dependencies:
|
||||
|
||||
#OTP Autofill
|
||||
sms_autofill: ^2.3.1
|
||||
carousel_slider: ^4.2.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user