bottom_sheet 4.0.4 copy "bottom_sheet: ^4.0.4" to clipboard
bottom_sheet: ^4.0.4 copied to clipboard

Flexible bottom sheet with the ability to scroll content even without a list.

example/lib/main.dart

// Copyright (c) 2019-present,  SurfStudio LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// ignore_for_file: library_private_types_in_public_api, prefer-match-file-name

import 'package:example/bottom_sheet_based_on_content_height.dart';
import 'package:example/standard_bottom_sheet_example.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Material(
        child: SafeArea(
          bottom: false,
          child: MyHomePage(title: 'Flutter Demo Home Page'),
        ),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  const MyHomePage({
    required this.title,
    super.key,
  });

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return const DefaultTabController(
      length: 2,
      child: Scaffold(
        backgroundColor: Colors.white,
        body: Column(
          children: [
            TabBar(
              labelColor: Colors.lightBlueAccent,
              tabs: [
                Text(
                  'Standard',
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 16,
                  ),
                  textAlign: TextAlign.center,
                ),
                Text(
                  'Based on content height',
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 16,
                  ),
                  textAlign: TextAlign.center,
                ),
              ],
            ),
            Expanded(
              child: TabBarView(
                children: [
                  StandardBottomSheetExample(),
                  BottomSheetBasedOnContentHeight(),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
383
likes
150
pub points
97%
popularity

Publisher

verified publishersurf.ru

Flexible bottom sheet with the ability to scroll content even without a list.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

bottom_inset_observer, flutter

More

Packages that depend on bottom_sheet