Skip to content

[Bug]: Unable to create full-width slides #56

Closed
@nicholasfechner

Description

@nicholasfechner

Contact Details

No response

What happened?

I am trying to get widgets that span the full available width, but it seem, that the items only scale to about 1:1.

I created a minimal example (modified from the one on pub.dev), to show this. If run in a resizable way (e.g. MacOS), the problem can easily reproduced:

import 'package:flutter/material.dart';
import 'package:flutter_carousel_widget/flutter_carousel_widget.dart';

void main() {
  runApp(TestApp());
}

class TestApp extends StatelessWidget {
  const TestApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: FlutterCarousel(
          options: FlutterCarouselOptions(
            height: 400.0,
            viewportFraction: 1,
            showIndicator: true,
            slideIndicator: CircularSlideIndicator(),
          ),
          items: [1,2,3,4,5].map((i) {
            return Builder(
              builder: (BuildContext buildContext) {
                return Container(
                    width: double.infinity,
                    color: Colors.amber,
                    child: Text('text $i', style: TextStyle(fontSize: 16.0),)
                );
              },
            );
          }).toList(),
        ),
      ),
    );
  }
}

Version

^3.0.1

What devices are you seeing the problem on?

Android, iPhone, Mac

OS

All of them current

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions