Skip to content

Instantly share code, notes, and snippets.

@Akhu
Last active April 18, 2023 12:32
Show Gist options
  • Save Akhu/946c1bfb366e88667bc6a73d9c4bbfde to your computer and use it in GitHub Desktop.
Save Akhu/946c1bfb366e88667bc6a73d9c4bbfde to your computer and use it in GitHub Desktop.
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter - Basics';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
body: const OnboardingPager(),
),
);
}
}
class OnboardingPager extends StatelessWidget {
const OnboardingPager({super.key});
@override
Widget build(BuildContext context) {
final PageController controller = PageController();
return ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(
dragDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
},
),
child: Container(
color: const Color.fromARGB(255, 240, 239, 235),
child: PageView(
controller: controller,
children: const <Widget>[
Center(
child: Text('First Page'),
),
Center(
child: Text('Second Page'),
),
Center(
child: Text('Third Page'),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment