diff --git a/lib/main.dart b/lib/main.dart index 2a16e46..5e18481 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,22 +70,15 @@ class _PolaAppState extends State { body: IndexedStack( index: _selectedIndex, children: _tabs, - ) - ), + )), ), ); } final List _tabs = [ MainPage(), - WebViewTab( - title: "Wyszukiwarka", - url: "https://www.pola-app.pl/m/search/" - ), - WebViewTab( - title: "Wiadomości", - url: "https://www.pola-app.pl/m/blog/" - ) + WebViewTab(title: "Wyszukiwarka", url: "https://www.pola-app.pl/m/search/"), + WebViewTab(title: "Wiadomości", url: "https://www.pola-app.pl/m/blog/") ]; AnalyticsMainTab _getTabParameter(int index) { diff --git a/lib/pages/scan/scan.dart b/lib/pages/scan/scan.dart index 6064e38..d39404c 100644 --- a/lib/pages/scan/scan.dart +++ b/lib/pages/scan/scan.dart @@ -87,61 +87,60 @@ class _MainPageState extends State { child: Column( children: [ Center( - child: Padding( - padding: const EdgeInsets.only(top: 20.0), - child: Text( - "Umieść kod kreskowy produktu w prostokącie powyżej aby dowiedzieć się więcej o firmie, która go wyprodukowała.", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - )))), + child: Padding( + padding: const EdgeInsets.only(top: 20.0), + child: Text( + "Umieść kod kreskowy produktu w prostokącie powyżej aby dowiedzieć się więcej o firmie, która go wyprodukowała.", + textAlign: TextAlign.center, + style: TextStyle(color: Colors.white), + ), + ), + ), ], ), ), SafeArea( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Spacer(), - BlocBuilder( - bloc: _scanBloc, - builder: (context, state) { - if (state.isError) { - SchedulerBinding.instance.addPostFrameCallback((_) { - showDialog( - context: context, - barrierDismissible: false, - builder: (_) { - return AlertDialog( - title: Text('Wystąpił błąd'), - content: Text( - 'Niestety nie udało się pobrać danych. Spróbuj ponownie.'), - actions: [ - TextButton( - child: Text('Zamknij.'), - onPressed: () { - _scanBloc - .add(ScanEvent.alertDialogDismissed()); - SchedulerBinding.instance - .addPostFrameCallback((_) { + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Spacer(), + BlocBuilder( + bloc: _scanBloc, + builder: (context, state) { + if (state.isError) { + SchedulerBinding.instance.addPostFrameCallback((_) { + showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return AlertDialog( + title: Text('Wystąpił błąd'), + content: Text( + 'Niestety nie udało się pobrać danych. Spróbuj ponownie.'), + actions: [ + TextButton( + child: Text('Zamknij.'), + onPressed: () { + _scanBloc + .add(ScanEvent.alertDialogDismissed()); Navigator.pop(context); - }); - }, - ), - ], - ); - }, - ); - }); - } - return CompaniesList(state, listScrollController); - }, - ), - ], - )), + }, + ), + ], + ); + }, + ); + }); + } + return CompaniesList(state, listScrollController); + }, + ), + ], + ), + ), Positioned( - bottom: 20, - right: 20, + bottom: 35, + right: 5, child: GestureDetector( onTap: () { setState(() { @@ -149,9 +148,14 @@ class _MainPageState extends State { cameraController.toggleTorch(); }); }, - child: _isTorchOn - ? Assets.menuPage.flashlighton.svg() - : Assets.menuPage.flashlightoff.svg(), + child: Container( + decoration: BoxDecoration( + boxShadow: [], + ), + child: _isTorchOn + ? Assets.menuPage.flashlighton.svg() + : Assets.menuPage.flashlightoff.svg(), + ), ), ), ], @@ -169,15 +173,16 @@ class _MainPageState extends State { children: [ Positioned.fill( child: MobileScanner( - controller: cameraController, - onDetect: (capture) { - final List barcodes = capture.barcodes; - for (final barcode in barcodes) { - final String code = barcode.rawValue!; - debugPrint('Barcode found! $code'); - _scanBloc.add(ScanEvent.barcodeScanned(code)); - } - }), + controller: cameraController, + onDetect: (capture) { + final List barcodes = capture.barcodes; + for (final barcode in barcodes) { + final String code = barcode.rawValue!; + debugPrint('Barcode found! $code'); + _scanBloc.add(ScanEvent.barcodeScanned(code)); + } + }, + ), ), Positioned.fill( child: Align( diff --git a/lib/ui/list_item.dart b/lib/ui/list_item.dart index f672a84..7763e47 100644 --- a/lib/ui/list_item.dart +++ b/lib/ui/list_item.dart @@ -145,8 +145,7 @@ class _ListItem extends StatelessWidget { Expanded(child: child), Padding( padding: EdgeInsets.only(right: 8.0), - child: Assets.menuPage.showmore.svg( - ), + child: Assets.menuPage.showmore.svg(), ), ], ),