| // Copyright 2014 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| import 'package:flutter/material.dart'; |
| /// Flutter code sample for [RawScrollbar.shape]. |
| void main() => runApp(const ShapeExampleApp()); |
| class ShapeExampleApp extends StatelessWidget { |
| const ShapeExampleApp({super.key}); |
| Widget build(BuildContext context) { |
| return const MaterialApp( |
| class ShapeExample extends StatelessWidget { |
| const ShapeExample({super.key}); |
| Widget build(BuildContext context) { |
| shape: const StadiumBorder(side: BorderSide(color: Colors.brown, width: 3.0)), |
| // On mobile platforms, setting primary to true is not required, as |
| // the PrimaryScrollController automatically attaches to vertical |
| // ScrollPositions. On desktop platforms however, using the |
| // PrimaryScrollController requires ScrollView.primary be set. |
| physics: const BouncingScrollPhysics(), |
| children: List<Text>.generate(100, (int index) => Text((index * index).toString())), |