Fix: shorten text
This commit is contained in:
@@ -280,7 +280,7 @@ class _BasketPageState extends State<BasketPage> {
|
||||
final item = cartItems[index];
|
||||
return BasketItemCard(
|
||||
name: item.title,
|
||||
price: item.price.toString(),
|
||||
price: item.price.toStringAsFixed(2),
|
||||
id: item.id,
|
||||
image: Image(
|
||||
image: NetworkImage(item.images[0].url),
|
||||
@@ -304,7 +304,7 @@ class _BasketPageState extends State<BasketPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Итого: $totalPrice руб.',
|
||||
'Итого: ${totalPrice.toStringAsFixed(2)} руб.',
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:gymlink_module_web/providers/main.dart';
|
||||
import 'package:gymlink_module_web/tools/items.dart';
|
||||
import 'package:gymlink_module_web/tools/prefs.dart';
|
||||
import 'package:gymlink_module_web/tools/routes.dart';
|
||||
import 'package:gymlink_module_web/tools/text.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -194,7 +195,7 @@ class _DetailPageState extends State<DetailPage> {
|
||||
appBar: const GymLinkAppBar(),
|
||||
body: item != null
|
||||
? Column(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
GymLinkHeader(title: item!.title),
|
||||
GymLinkHeader(title: shortString(item!.title, length: 20)),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -269,6 +270,14 @@ class _DetailPageState extends State<DetailPage> {
|
||||
item!.images[0].url,
|
||||
height: 400,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Text(
|
||||
item!.title,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
@@ -333,7 +342,7 @@ class _DetailPageState extends State<DetailPage> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Стоимость ${item!.price}руб.',
|
||||
'Стоимость ${item!.price.toStringAsFixed(2)}руб.',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:gymlink_module_web/tools/items.dart';
|
||||
import 'package:gymlink_module_web/tools/prefs.dart';
|
||||
import 'package:gymlink_module_web/tools/relative.dart';
|
||||
import 'package:gymlink_module_web/tools/routes.dart';
|
||||
import 'package:gymlink_module_web/tools/text.dart';
|
||||
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -251,7 +252,9 @@ class _MainPageState extends State<MainPage> {
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
children: [
|
||||
filteredData.isEmpty && searchText != '' && !isSearching
|
||||
filteredData.isEmpty &&
|
||||
(searchText != '' || selectedCategory != null) &&
|
||||
!isSearching
|
||||
? const Center(child: Text('Ничего не найдено'))
|
||||
: isSearching
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@@ -276,8 +279,8 @@ class _MainPageState extends State<MainPage> {
|
||||
.image,
|
||||
width: 50,
|
||||
),
|
||||
name: product.title,
|
||||
price: product.price.toString(),
|
||||
name: shortString(product.title),
|
||||
price: product.price.toStringAsFixed(2),
|
||||
onTap: () => Navigator.of(context).push(
|
||||
CustomPageRoute(
|
||||
builder: (context) => DetailPage(
|
||||
|
||||
@@ -61,6 +61,7 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
List<GymItem> cartItems = [];
|
||||
double totalPrice = 0;
|
||||
List<GymItem> gymCart = [];
|
||||
bool isAgree = false;
|
||||
bool _isLoading = true;
|
||||
|
||||
@override
|
||||
@@ -107,6 +108,7 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 350),
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: cartItems.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = cartItems[index];
|
||||
@@ -129,7 +131,8 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
MarkdownBody(data: '## Итого: $totalPrice'),
|
||||
MarkdownBody(
|
||||
data: '## Итого: ${totalPrice.toStringAsFixed(2)} руб.'),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
@@ -161,6 +164,15 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: const Text('Согласен с обаботкой персональных данных'),
|
||||
value: isAgree,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isAgree = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
_goToPage();
|
||||
|
||||
Reference in New Issue
Block a user