Skip to content

Commit

Permalink
add scan_search_button.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
D3bi7 committed Jan 12, 2025
1 parent c006f5d commit b67f323
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 31 deletions.
6 changes: 4 additions & 2 deletions lib/i18n/strings.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 1
/// Strings: 30
/// Strings: 31
///
/// Built on 2024-11-10 at 12:26 UTC
/// Built on 2025-01-12 at 20:22 UTC
// coverage:ignore-file
// ignore_for_file: type=lint
Expand Down Expand Up @@ -207,6 +207,7 @@ class _StringsScanEn {
String get lastScans => 'Ostatnie skany:';
String get error => 'Wystąpił błąd';
String get closeError => 'Zamknij.';
String get search => 'Wyszukaj';
}

/// Flat map(s) containing all translations.
Expand Down Expand Up @@ -245,6 +246,7 @@ extension on Translations {
case 'scan.lastScans': return 'Ostatnie skany:';
case 'scan.error': return 'Wystąpił błąd';
case 'scan.closeError': return 'Zamknij.';
case 'scan.search': return 'Wyszukaj';
default: return null;
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/i18n/strings.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"wait": "Proszę czekać, trwa Ładowanie...",
"lastScans": "Ostatnie skany:",
"error": "Wystąpił błąd",
"closeError": "Zamknij."
"closeError": "Zamknij.",
"search": "Wyszukaj"
}

}
30 changes: 2 additions & 28 deletions lib/pages/scan/scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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_search_button.dart';
import 'package:pola_flutter/pages/scan/scan_state.dart';
import 'package:pola_flutter/i18n/strings.g.dart';
import 'package:pola_flutter/pages/scan/scan_vibration.dart';
Expand Down Expand Up @@ -76,34 +77,7 @@ class _MainPageState extends State<MainPage> {
const EdgeInsets.symmetric(vertical: 20.0, horizontal: 16.0),
child: Column(
children: <Widget>[
Center(
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 10.0, vertical: 10.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(25),
),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Assets.search.svg(),
),
Expanded(
child: Text(
'Wyszukaj',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
),
],
),
),
),
ScanSearchButton(),
],
),
),
Expand Down
39 changes: 39 additions & 0 deletions lib/pages/scan/scan_search_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:pola_flutter/theme/assets.gen.dart';
import 'package:pola_flutter/theme/text_size.dart';
import 'package:pola_flutter/i18n/strings.g.dart';

class ScanSearchButton extends StatelessWidget {
const ScanSearchButton({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(25),
),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Assets.search.svg(),
),
Expanded(
child: Text(
t.scan.search,
style: TextStyle(
fontSize: TextSize.mediumTitle,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
),
],
),
),
);
}
}

0 comments on commit b67f323

Please sign in to comment.