Skip to content

Commit c230c45

Browse files
committed
chore: refactory
1 parent c4e6652 commit c230c45

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

example/lib/onboarding_example.dart

+15-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import 'package:concentric_transition/concentric_transition.dart';
22
import 'package:flutter/material.dart';
33

44
final pages = [
5+
const PageData(
6+
icon: Icons.bubble_chart,
7+
title: "Local news\nstories",
8+
bgColor: Color(0xFF0043D0),
9+
textColor: Colors.white,
10+
),
511
const PageData(
612
icon: Icons.format_size,
713
title: "Choose your\ninterests",
@@ -13,12 +19,6 @@ final pages = [
1319
title: "Drag and\ndrop to move",
1420
bgColor: Color(0xFFFFFFFF),
1521
),
16-
const PageData(
17-
icon: Icons.bubble_chart,
18-
title: "Local news\nstories",
19-
bgColor: Color(0xFF0043D0),
20-
textColor: Colors.white,
21-
),
2222
];
2323

2424
class OnboardingExample extends StatelessWidget {
@@ -30,14 +30,17 @@ class OnboardingExample extends StatelessWidget {
3030
return Scaffold(
3131
body: ConcentricPageView(
3232
colors: pages.map((p) => p.bgColor).toList(),
33-
radius: screenWidth * 0.12,
34-
curve: Curves.ease,
35-
nextButtonBuilder: (context) => Icon(
36-
Icons.navigate_next,
37-
size: screenWidth * 0.1,
33+
radius: screenWidth * 0.1,
34+
// curve: Curves.ease,
35+
nextButtonBuilder: (context) => Padding(
36+
padding: const EdgeInsets.only(left: 3), // visual center
37+
child: Icon(
38+
Icons.navigate_next,
39+
size: screenWidth * 0.08,
40+
),
3841
),
3942
// itemCount: pages.length,
40-
duration: const Duration(milliseconds: 1500),
43+
// duration: const Duration(milliseconds: 1500),
4144
// opacityFactor: 2.0,
4245
// scaleFactor: 0.2,
4346
// verticalPosition: 0.7,

0 commit comments

Comments
 (0)