Skip to content

Commit

Permalink
add DefectsScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Sep 11, 2024
1 parent 4e0f849 commit 962f300
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
Binary file added assets/bunny.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions lib/defects_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';

class DefectsScreen extends StatefulWidget {
const DefectsScreen({super.key});

@override
State<DefectsScreen> createState() => _DefectsScreenState();
}

class _DefectsScreenState extends State<DefectsScreen> {
int count = 0;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Defects test screen'),
),
body: Stack(
alignment: Alignment.topLeft,
children: [
const Positioned(
left: 0,
top: 100,
child: Text(
_loremIpsum,
maxLines: 2,
),
),
Positioned(
top: 0,
left: 0,
child: ElevatedButton(
onPressed: () {},
child: const Text('Do thing A'),
),
),
Align(
alignment: Alignment.center,
child: Image.asset('assets/bunny.jpg'),
),
Positioned(
left: 20,
top: 20,
child: ElevatedButton(
onPressed: () {},
child: const Text('Do thing B'),
),
),
Positioned(
right: 20,
bottom: 20,
child: ElevatedButton(
onPressed: () {},
child: const Text('Do thing X'),
),
),
Positioned(
right: 40,
bottom: 40,
child: ElevatedButton(
onPressed: () {},
child: const Text('Do thing Y'),
),
),
],
),
);
}
}

const _loremIpsum =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
9 changes: 9 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:demo_app/defects_screen.dart';
import 'package:demo_app/form_screen.dart';
import 'package:demo_app/issue_1619_repro.dart';
import 'package:demo_app/issue_1677_repro.dart';
Expand Down Expand Up @@ -72,6 +73,14 @@ class _MyHomePageState extends State<MyHomePage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const DefectsScreen()),
);
},
child: const Text('Defects Test'),
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dev_dependencies:
flutter:
uses-material-design: true

assets:
- assets/bunny.jpg



Expand Down

0 comments on commit 962f300

Please sign in to comment.