Last active
March 15, 2021 12:30
-
-
Save dymx101/3bc4583fd164d618292f69eafd43905a to your computer and use it in GitHub Desktop.
flutter_overlapped_list_header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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