Created
September 11, 2021 19:24
-
-
Save ookami-kb/0115748ad84a0b62a27b6e397e7d0a1f to your computer and use it in GitHub Desktop.
ftt_layout_text_over_image
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) => 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