Created
June 15, 2022 01:35
-
-
Save xster/91dff3e708c6e668c4e7618c5b48d4d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
const 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 CustomScrollView( | |
slivers: [ | |
const SliverPadding( | |
padding: EdgeInsets.only(top: 100), | |
), | |
SliverToBoxAdapter(child: Container(color: Colors.red, height: 400)), | |
SliverToBoxAdapter(child: Container(color: Colors.grey, height: 400)), | |
SliverToBoxAdapter(child: Container(color: Colors.blue, height: 400)), | |
SliverToBoxAdapter(child: Container(color: Colors.purple, height: 400)), | |
SliverToBoxAdapter(child: Container(color: Colors.green, height: 400)), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment