• Taha Tesser's avatar
    Fix Chips with Tooltip throw an assertion when enabling or disabling (#138799) · e6d43ac6
    Taha Tesser authored
    fixes [Enabling or disabling a `Chip`/`RawChip` with a tooltip throws an exception](https://github.com/flutter/flutter/issues/138287) 
    
    ### Code sample
    
    <details>
    <summary>expand to view the code sample</summary> 
    
    ```dart
    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        bool isEnabled = true;
    
        return MaterialApp(
          home: Material(
            child: Center(
              child: StatefulBuilder(
                  builder: (BuildContext context, StateSetter setState) {
                return Column(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    RawChip(
                      tooltip: 'This is a tooltip',
                      isEnabled: isEnabled,
                      label: const Text('RawChip'),
                      onPressed: isEnabled ? () {} : null,
                    ),
                    const SizedBox(height: 20),
                    ElevatedButton(
                      onPressed: () {
                        setState(() {
                          isEnabled = !isEnabled;
                        });
                      },
                      child: Text('${isEnabled ? 'Disable' : 'Enable'} Chip'),
                    )
                  ],
                );
              }),
            ),
          ),
        );
      }
    }
    ```
    
    </details>
    e6d43ac6
Name
Last commit
Last update
..
flutter Loading commit data...
flutter_driver Loading commit data...
flutter_goldens Loading commit data...
flutter_goldens_client Loading commit data...
flutter_localizations Loading commit data...
flutter_test Loading commit data...
flutter_tools Loading commit data...
flutter_web_plugins Loading commit data...
fuchsia_remote_debug_protocol Loading commit data...
integration_test Loading commit data...
analysis_options.yaml Loading commit data...