Skip to content

Instantly share code, notes, and snippets.

@ookami-kb
Created September 11, 2021 19:24
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 ookami-kb/0115748ad84a0b62a27b6e397e7d0a1f to your computer and use it in GitHub Desktop.
Save ookami-kb/0115748ad84a0b62a27b6e397e7d0a1f to your computer and use it in GitHub Desktop.
ftt_layout_text_over_image
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) => MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) => Stack(
children: [
Image.network('https://picsum.photos/seed/123/400/600'),
Positioned.fill(
top: 10,
bottom: 10,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
Text('Hello, World!'),
Text('Welcome to Flutter!'),
],
),
),
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment