From 27f81e5450dc90ab04aee5599a024973360032cc Mon Sep 17 00:00:00 2001 From: Adam Stolarczyk Date: Thu, 19 Dec 2024 20:31:56 +0100 Subject: [PATCH] add Assets.search.svg --- lib/pages/scan/scan.dart | 75 +++++++++++++++++++-------------------- lib/theme/assets.gen.dart | 33 +++-------------- 2 files changed, 41 insertions(+), 67 deletions(-) diff --git a/lib/pages/scan/scan.dart b/lib/pages/scan/scan.dart index cc612f9..3395ea2 100644 --- a/lib/pages/scan/scan.dart +++ b/lib/pages/scan/scan.dart @@ -17,7 +17,6 @@ import 'package:pola_flutter/theme/colors.dart'; import 'package:pola_flutter/theme/text_size.dart'; import 'package:pola_flutter/ui/menu_icon_button.dart'; import 'package:pola_flutter/ui/web_view_dialog.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class MainPage extends StatefulWidget { @override @@ -72,14 +71,15 @@ class _MainPageState extends State { children: [ _buildQrView(context), SafeArea( - child: Column( - children: [ - Center( - child: Padding( - padding: const EdgeInsets.only(top: 20.0), + child: Padding( + padding: + const EdgeInsets.symmetric(vertical: 20.0, horizontal: 16.0), + child: Column( + children: [ + Center( child: Container( - width: 328, - height: 40, + padding: const EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(25), @@ -87,26 +87,25 @@ class _MainPageState extends State { child: Row( children: [ Padding( - padding: - const EdgeInsets.only(left: 20.0, right: 10), - child: SvgPicture.asset( - 'assets/search.svg', - ), + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Assets.search.svg(), ), - Text( - 'Wyszukaj', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Colors.black, + Expanded( + child: Text( + 'Wyszukaj', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Colors.black, + ), ), ), ], ), ), ), - ), - ], + ], + ), ), ), SafeArea( @@ -145,24 +144,24 @@ class _MainPageState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( - child: CompaniesList(state, listScrollController)), - Column( - children: [ - GestureDetector( - onTap: () { - _scanBloc.add(ScanEvent.torchSwitched()); - cameraController.toggleTorch(); - }, - child: Container( - decoration: BoxDecoration( - boxShadow: [], - ), - child: state.isTorchOn - ? Assets.scan.flashlightOn.svg() - : Assets.scan.flashlightOff.svg(), + child: CompaniesList(state, listScrollController), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: GestureDetector( + onTap: () { + _scanBloc.add(ScanEvent.torchSwitched()); + cameraController.toggleTorch(); + }, + child: Container( + decoration: BoxDecoration( + boxShadow: [], ), - ) - ], + child: state.isTorchOn + ? Assets.scan.flashlightOn.svg() + : Assets.scan.flashlightOff.svg(), + ), + ), ) ], ); diff --git a/lib/theme/assets.gen.dart b/lib/theme/assets.gen.dart index 2034895..b65dbf8 100644 --- a/lib/theme/assets.gen.dart +++ b/lib/theme/assets.gen.dart @@ -52,46 +52,20 @@ class $AssetsMenuPageGen { /// File path: assets/menuPage/info.svg SvgGenImage get info => const SvgGenImage('assets/menuPage/info.svg'); - /// File path: assets/menuPage/leftbottomcorner.svg - SvgGenImage get leftbottomcorner => const SvgGenImage('assets/menuPage/leftbottomcorner.svg'); - /// File path: assets/menuPage/menu.svg SvgGenImage get menu => const SvgGenImage('assets/menuPage/menu.svg'); /// File path: assets/menuPage/rectangle.svg SvgGenImage get rectangle => const SvgGenImage('assets/menuPage/rectangle.svg'); - /// File path: assets/menuPage/rightbottomcorner.svg - SvgGenImage get rightbottomcorner => const SvgGenImage('assets/menuPage/rightbottomcorner.svg'); - /// File path: assets/menuPage/star.svg SvgGenImage get star => const SvgGenImage('assets/menuPage/star.svg'); /// File path: assets/menuPage/thumbs.svg SvgGenImage get thumbs => const SvgGenImage('assets/menuPage/thumbs.svg'); - /// File path: assets/menuPage/topleftcorner.svg - SvgGenImage get topleftcorner => const SvgGenImage('assets/menuPage/topleftcorner.svg'); - - /// File path: assets/menuPage/toprightcorner.svg - SvgGenImage get toprightcorner => const SvgGenImage('assets/menuPage/toprightcorner.svg'); - /// List of all assets - List get values => [ - diversity, - github, - groups, - handshake, - info, - leftbottomcorner, - menu, - rectangle, - rightbottomcorner, - star, - thumbs, - topleftcorner, - toprightcorner - ]; + List get values => [diversity, github, groups, handshake, info, menu, rectangle, star, thumbs]; } class $AssetsNavigationGen { @@ -133,10 +107,11 @@ class Assets { static const $AssetsMenuPageGen menuPage = $AssetsMenuPageGen(); static const $AssetsNavigationGen navigation = $AssetsNavigationGen(); static const $AssetsScanGen scan = $AssetsScanGen(); + static const SvgGenImage search = SvgGenImage('assets/search.svg'); /// List of all assets - static List get values => - [icAddBlack24dp, icBackspaceWhite36dp, icDialpadWhite36dp, icDoneWhite36dp, icLauncher, menu]; + static List get values => + [icAddBlack24dp, icBackspaceWhite36dp, icDialpadWhite36dp, icDoneWhite36dp, icLauncher, menu, search]; } class AssetGenImage {