Skip to content

Instantly share code, notes, and snippets.

@jogboms
Created December 19, 2018 08:17
Show Gist options
  • Select an option

  • Save jogboms/9aa3f86855b4d35c59f3c9f2cceaac1a to your computer and use it in GitHub Desktop.

Select an option

Save jogboms/9aa3f86855b4d35c59f3c9f2cceaac1a to your computer and use it in GitHub Desktop.
Flutter CustomScrollView and Keyboard issue repro
import 'package:flutter/material.dart';
void main() async {
runApp(App());
}
class App extends StatelessWidget {
const App({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Test App",
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
const Home({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("App Bar")),
body: CustomScrollView(
slivers: <Widget>[
SliverList(
delegate: SliverChildListDelegate(
<Widget>[
Center(
heightFactor: 4,
child: FlutterLogo(size: 64.0),
),
],
),
),
SliverAppBar(
elevation: 0.0,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
automaticallyImplyLeading: false,
pinned: true,
title: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
suffixIcon: Icon(Icons.search),
hintText: 'Enter Here',
),
),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int i) => ListTile(title: Text('Scroll')),
childCount: 100,
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment