mobile_skt/lib/screens/guide/components/sale_quotation_guide.dart

77 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
import 'package:sk_base_mobile/widgets/core/sk_appbar.dart';
import 'package:sk_base_mobile/widgets/custom_contact_icon.dart';
class SaleQuotationGuide extends StatelessWidget {
final controller = Get.put(SaleQuotationGuideController());
SaleQuotationGuide({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppTheme.black,
appBar: SkAppbar(
title: '使用教程',
action: [
const CustomContactIcon(),
SizedBox(width: ScreenAdaper.width(20))
],
),
body: buildBody(),
);
}
Widget buildBody() {
return Stack(
alignment: AlignmentDirectional.bottomCenter,
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: ScreenAdaper.height(40),
horizontal: ScreenAdaper.width(20)),
child: PageView.builder(
controller: controller.pageController,
itemBuilder: (_, int index) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/sale_quotation_guide${index + 1}.jpg'),
),
),
),
itemCount: 4,
onPageChanged: (index) {
controller.currentPage.value = index;
},
),
),
Obx(() => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(
4,
(index) => Container(
margin: const EdgeInsets.all(4.0),
width: 10.0,
height: 10.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: controller.currentPage.value == index
? AppTheme.primaryColorLight
: Colors.grey,
),
),
),
)),
],
);
}
}
class SaleQuotationGuideController extends GetxController {
final currentPage = 0.obs;
final pageController = PageController();
}