Text Over The Image
flutter:
assets:
- assets/images/
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
MyHomePage({this.title});
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
centerTitle: true,
title: Text('Text Over Image '),
),
body: Center(
child: Container(
height: 250,
width: 200,
child: Stack(
children: <Widget>[
Center(
child: new Image.asset(
'assets/images/image3.jpg',
width: size.width,
height: size.height,
fit: BoxFit.fill,
),
),
Center(
child: Text("Bajarangisoft.com",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Colors.white)),
),
],
),
),
),
);
}
}