8000 Collapse animation not working · Issue #32 · fweinaug/expandable_text · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Collapse animation not working #32
Open
@traed

Description

@traed

The animation only works when expanding the text, not collapsing it. Using version 2.3.0.

Tested and verified with a minimal demo:

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final String text =
      'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis nibh eu vestibulum ullamcorper. Suspendisse potenti. Praesent pulvinar a mauris nec efficitur. Integer ut luctus mi. Donec ut tristique sapien, et facilisis libero. In faucibus placerat erat, at cursus purus euismod vitae. Mauris tempor aliquam urna ac pretium. Pellentesque sapien libero, fringilla vel augue vitae, bibendum ultrices massa. Etiam maximus consectetur nulla sit amet eleifend.';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            ExpandableText(
              text,
              expandText: 'Show more',
              collapseText: 'Show less',
              animation: true,
              animationDuration: const Duration(seconds: 2),
            )
          ],
        ),
      ),
    );
  }
}
Flutter doctor

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.1 21C52 darwin-x64, locale en-SE)
    • Flutter version 3.0.5 at /usr/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (13 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mattias/Library/Android/sdk
    • Platform android-32, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • DF62181D-AB04-4849-964A-65357B8EC7F9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 12.1 21C52 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 103.0.5060.134

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0