ft/adds logo and background image

This commit is contained in:
itsscb 2023-10-24 18:22:36 +02:00
parent 5f3952ea22
commit be41924b3b
5 changed files with 57 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
import 'package:app/pages/main_screen.dart';
void main() {
runApp(MaterialApp(home: MainScreen()));
void main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(MaterialApp(
home: MainScreen(),
));
}

View File

@ -15,17 +15,55 @@ class MainScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TextButton(
onPressed: () {
test();
},
child: const Text('Button'))
],
return Container(
decoration: const BoxDecoration(
// color: Color.fromARGB(230, 255, 255, 255),
gradient: LinearGradient(
colors: [Colors.black, Colors.white],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
image: DecorationImage(
image: AssetImage(
'lib/assets/hero-pattern-300x200.png',
// color: Colors.grey,
),
repeat: ImageRepeat.repeat,
fit: BoxFit.contain,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.black,
flexibleSpace: Image.asset(
'lib/assets/logo_300x200.png',
height: 80,
),
actions: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.menu),
tooltip: 'Menu',
),
// IconButton(
// onPressed: () {},
// icon: const Icon(Icons.login_sharp),
// tooltip: 'Login',
// ),
],
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TextButton(
onPressed: () {
test();
},
child: const Text('Button'))
],
),
),
);
}

View File

@ -64,7 +64,9 @@ flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
assets:
- lib/assets/logo_300x200.png
- lib/assets/hero-pattern-300x200.png
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg