Some fixes

This commit is contained in:
2024-05-02 22:56:21 +03:00
parent 8805b2a9a0
commit 26f822e83a
2 changed files with 33 additions and 15 deletions

View File

@@ -35,7 +35,8 @@ const List<Map<String, String>> testData = [
"name": "Протеин", "name": "Протеин",
"image": "product.png", "image": "product.png",
"price": "150", "price": "150",
"details": "Test details", "details":
"that name factory say string eaten order harbor easier said tone now floor nest it comfortable such difficulty labor bridge fact market women badly chamber heading forest allow shirt possibly story strip elephant extra even joy lungs than low discussion barn rapidly evidence is stream crew let more sold bag river triangle court slept knowledge flat package research balloon station underline careful market better make curious secret boy poor captured creature harder public tool ring subject charge planet tone scientist piece page stone support bush way feathers summer describe back should said complex song giant his that name factory say string eaten order harbor easier said tone now floor nest it comfortable such difficulty labor bridge fact market women badly chamber heading forest allow shirt possibly story strip elephant extra even joy lungs than low discussion barn rapidly evidence is stream crew let more sold bag river triangle court slept knowledge flat package research balloon station underline careful market better make curious secret boy poor captured creature harder public tool ring subject charge planet tone scientist piece page stone support bush way feathers summer describe back should said complex song giant his that name factory say string eaten order harbor easier said tone now floor nest it comfortable such difficulty labor bridge fact market women badly chamber heading forest allow shirt possibly story strip elephant extra even joy lungs than low discussion barn rapidly evidence is stream crew let more sold bag river triangle court slept knowledge flat package research balloon station underline careful market better make curious secret boy poor captured creature harder public tool ring subject charge planet tone scientist piece page stone support bush way feathers summer describe back should said complex song giant his that name factory say string eaten order harbor easier said tone now floor nest it comfortable such difficulty labor bridge fact market women badly chamber heading forest allow shirt possibly story strip elephant extra even joy lungs than low discussion barn rapidly evidence is stream crew let more sold bag river triangle court slept knowledge flat package research balloon station underline careful market better make curious secret boy poor captured creature harder public tool ring subject charge planet tone scientist piece page stone support bush way feathers summer describe back should said complex song giant his",
"id": "34a26e82-7656-5e98-a44a-c2d01d0b1ad1123" "id": "34a26e82-7656-5e98-a44a-c2d01d0b1ad1123"
}, },
{ {
@@ -166,7 +167,9 @@ class _MainPageState extends State<MainPage> {
), ),
), ),
), ),
const SizedBox(width: 8), const Spacer(
flex: 2,
),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
@@ -175,7 +178,7 @@ class _MainPageState extends State<MainPage> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
minimumSize: const Size(40, kMinInteractiveDimension), minimumSize: const Size(50, kMinInteractiveDimension),
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
shape: const CircleBorder( shape: const CircleBorder(
side: BorderSide( side: BorderSide(
@@ -190,7 +193,9 @@ class _MainPageState extends State<MainPage> {
size: 24, size: 24,
), ),
), ),
const SizedBox(width: 8), const SizedBox(
width: 8,
),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
@@ -199,7 +204,7 @@ class _MainPageState extends State<MainPage> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
minimumSize: const Size(40, kMinInteractiveDimension), minimumSize: const Size(50, kMinInteractiveDimension),
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
shape: const CircleBorder( shape: const CircleBorder(
side: BorderSide( side: BorderSide(
@@ -214,6 +219,9 @@ class _MainPageState extends State<MainPage> {
size: 24, size: 24,
), ),
), ),
const SizedBox(
width: 10,
)
], ],
), ),
), ),

View File

@@ -31,7 +31,6 @@ class _DetailPageState extends State<DetailPage> {
void initState() { void initState() {
super.initState(); super.initState();
getCart().then((value) { getCart().then((value) {
debugPrint(value.toString());
setState(() { setState(() {
isInCart = value.any((element) => element['id'] == widget.id); isInCart = value.any((element) => element['id'] == widget.id);
if (isInCart) { if (isInCart) {
@@ -109,26 +108,37 @@ class _DetailPageState extends State<DetailPage> {
height: MediaQuery.sizeOf(context).height, height: MediaQuery.sizeOf(context).height,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
widget.image, widget.image,
Padding( Padding(
padding: padding:
const EdgeInsetsDirectional.fromSTEB(0, 30, 60, 60), const EdgeInsetsDirectional.fromSTEB(0, 30, 60, 60),
child: SizedBox( child: ConstrainedBox(
width: 340, constraints: const BoxConstraints(
height: MediaQuery.sizeOf(context).height, minWidth: 340,
maxWidth: 340,
maxHeight: 600,
),
child: Card( child: Card(
elevation: 4, elevation: 4,
color: const Color(0xFFF2F3F9), color: const Color(0xFFF2F3F9),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsetsDirectional.fromSTEB( child: Padding(
20, 15, 10, 15), padding: const EdgeInsetsDirectional.fromSTEB(
child: Text( 20, 15, 10, 15),
widget.description, child: ConstrainedBox(
style: Theme.of(context).textTheme.bodyMedium, constraints: const BoxConstraints(
minHeight: 100,
),
child: Text(
widget.description,
style: Theme.of(context).textTheme.bodyMedium,
),
),
), ),
), ),
), ),