constrained_scroll_view 0.1.0 constrained_scroll_view: ^0.1.0 copied to clipboard
A widget that prevents the content to be hidden from the keyboard or the screen resolution change.
import 'package:constrained_scroll_view/constrained_scroll_view.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: 'ConstrainedScrollView Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Home(),
);
}
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
// Change the screen to the horizontal view and see how the content becomes scrollable.
body: ConstrainedScrollView(
// The Column widget is usually used as a child.
child: Column(
children: [
Container(
color: Colors.blue,
width: 100,
height: 100,
),
Container(
color: Colors.red,
width: 100,
height: 100,
),
Container(
color: Colors.green,
width: 100,
height: 100,
),
Container(
color: Colors.yellow,
width: 100,
height: 100,
),
],
),
),
);
}
}