Skip to content

Instantly share code, notes, and snippets.

@xster
Created June 15, 2022 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xster/91dff3e708c6e668c4e7618c5b48d4d2 to your computer and use it in GitHub Desktop.
Save xster/91dff3e708c6e668c4e7618c5b48d4d2 to your computer and use it in GitHub Desktop.
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