Skip to content

Commit

Permalink
Work in progres 110/prostokąt (#141)
Browse files Browse the repository at this point in the history
* ScanBackground

* Add Row and Column

* redRectangel

* add red corners

* changing the size of the rectangle

* add shadow

* add rectangle to scanbackground

* fixed expanded

* fixes review

* add rectangle.svg

* fixes review

---------

Co-authored-by: Marcin Stepnowski <[email protected]>
  • Loading branch information
D3bi7 and WezSieTato authored Dec 11, 2024
1 parent 0ba8db9 commit 4f4e7ea
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 21 deletions.
10 changes: 10 additions & 0 deletions assets/menuPage/rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/i18n/strings.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Locales: 1
/// Strings: 30
///
/// Built on 2024-10-01 at 14:21 UTC
/// Built on 2024-11-10 at 12:26 UTC
// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down
21 changes: 2 additions & 19 deletions lib/pages/scan/scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:pola_flutter/analytics/pola_analytics.dart';
import 'package:pola_flutter/data/pola_api_repository.dart';
import 'package:pola_flutter/pages/scan/companies_list.dart';
import 'package:pola_flutter/pages/scan/scan_background.dart';
import 'package:pola_flutter/pages/scan/scan_bloc.dart';
import 'package:pola_flutter/pages/scan/scan_event.dart';
import 'package:pola_flutter/pages/scan/scan_state.dart';
Expand Down Expand Up @@ -154,10 +155,6 @@ class _MainPageState extends State<MainPage> {
}

Widget _buildQrView(BuildContext context) {
var scanArea = (MediaQuery.of(context).size.width < 400 ||
MediaQuery.of(context).size.height < 400)
? 250.0
: 300.0;
return Stack(
children: [
Positioned.fill(
Expand All @@ -173,21 +170,7 @@ class _MainPageState extends State<MainPage> {
},
),
),
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: SizedBox(
width: scanArea,
height: scanArea / 1.25,
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(width: 5.0, color: Colors.black),
color: Colors.transparent,
),
),
),
),
),
ScanBackground(),
],
);
}
Expand Down
54 changes: 54 additions & 0 deletions lib/pages/scan/scan_background.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:pola_flutter/theme/assets.gen.dart';
import 'package:pola_flutter/theme/colors.dart';

class ScanBackground extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
_BlackOpacity(),
Row(
children: [
_SizedBlackOpacity(),
_RedRectangle(),
_SizedBlackOpacity(),
],
),
_BlackOpacity(),
],
);
}
}

class _SizedBlackOpacity extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Expanded(
child: SizedBox(
height: 187,
child: Container(
color: AppColors.text.withOpacity(0.7),
),
),
);
}
}

class _BlackOpacity extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
color: AppColors.text.withOpacity(0.7),
),
);
}
}

class _RedRectangle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Assets.menuPage.rectangle.svg();
}
}
31 changes: 30 additions & 1 deletion lib/theme/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f4e7ea

Please sign in to comment.