bottom_sheet 3.1.1
bottom_sheet: ^3.1.1 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.
import 'package:example/bottom_sheet_based_on_content_height.dart';
import 'package:example/standard_bottom_sheet.dart';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: 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,
Key? key,
}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
child: Scaffold(
backgroundColor: Colors.white,
body: Column(
children: const [
TabBar(
labelColor: Colors.lightBlueAccent,
tabs: [
Text(
'Standard',
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
),
textAlign: TextAlign.center,
),
Text(
'Based on content height',
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
),
textAlign: TextAlign.center,
),
],
),
Expanded(
child: TabBarView(
children: [
StandardExample(),
BottomSheetBasedOnContentHeight(),
],
),
),
],
),
),
);
}
}