Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to delete character when mantissaLength = 0 #91

Closed
yosemiteyss opened this issue Sep 1, 2022 · 3 comments
Closed

Failed to delete character when mantissaLength = 0 #91

yosemiteyss opened this issue Sep 1, 2022 · 3 comments

Comments

@yosemiteyss
Copy link

yosemiteyss commented Sep 1, 2022

Hi, I want to implement a simple thousands formatter without any decimal place using CurrencyInputFormatter(mantissaLength: 0). But then, character can no longer be removed from text field. Any solution to this?

@caseyryan
Copy link
Owner

Hi!. Yes, I've just checked this without a trailing or leading symbol. There is a bug

@yosemiteyss
Copy link
Author

yosemiteyss commented Sep 2, 2022

I am able to reproduce it using the latest version.

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      darkTheme: ThemeData.dark(),
      theme: ThemeData.light(),
      home: const MyHomePage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter app'),
      ),
      body: Center(
        child: TextFormField(
          keyboardType: TextInputType.number,
          inputFormatters: [CurrencyInputFormatter(mantissaLength: 0)],
        ),
      ),
    );
  }
}

void main() {
  runApp(const MyApp());
}

@caseyryan
Copy link
Owner

fixed in version 2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants