Skip to content

Instantly share code, notes, and snippets.

@dymx101
Last active March 15, 2021 12:30
Show Gist options
  • Save dymx101/3bc4583fd164d618292f69eafd43905a to your computer and use it in GitHub Desktop.
Save dymx101/3bc4583fd164d618292f69eafd43905a to your computer and use it in GitHub Desktop.
flutter_overlapped_list_header
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
color: Colors.white,
child: Stack(
children: [
Column(
children: <Widget>[
new Container(
height: 200,
color: Colors.teal,
child: Center(child: Text("Header")),
),
],
),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 170),
child: Column(
children: [
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
cell(),
],
),
),
],
),
),
);
}
Widget cell() {
return Container(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Container(
padding: EdgeInsets.all(8),
color: Colors.grey[100],
child: Row(
children: [
Container(
color: Colors.red,
width: 100,
height: 100,
),
SizedBox(
width: 16,
),
Text(
'Hello, World!',
style: TextStyle(color: Colors.black, fontSize: 20),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment