From f91db3d6b07e44a82169aeaac2cfbf70914b9fb0 Mon Sep 17 00:00:00 2001 From: Bernd Wahlen Date: Mon, 24 Aug 2026 14:04:53 +0200 Subject: [PATCH] feat!: migrate to the decoupled material_ui package (fixes #237) --- CHANGELOG.md | 12 ++++++++++++ example/lib/demo/builder_example.dart | 2 +- example/lib/demo/demo.dart | 2 +- example/lib/demo/pages/all_pinputs_page.dart | 2 +- example/lib/demo/pages/gallery_page.dart | 2 +- example/lib/demo/pages/otp_page.dart | 2 +- example/lib/demo/pinput_templates/filled.dart | 2 +- .../lib/demo/pinput_templates/filled_rounded.dart | 2 +- .../demo/pinput_templates/only_bottom_cursor.dart | 2 +- .../demo/pinput_templates/rounded_with_cursor.dart | 2 +- .../demo/pinput_templates/rounded_with_shadow.dart | 2 +- example/lib/demo/sms_retriever_api_example.dart | 2 +- example/lib/demo/user_consent_api_example.dart | 2 +- example/lib/demo/widgets/alien_keyboard.dart | 2 +- example/lib/main.dart | 2 +- example/lib/test_examples.dart | 2 +- example/pubspec.yaml | 5 +++-- lib/src/pinput.dart | 2 +- pubspec.yaml | 7 ++++--- test/helpers/pump_app.dart | 2 +- test/pinput_test.dart | 2 +- 21 files changed, 37 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ffcec..3de7d75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +#### 7.0.0 · 24/08/2026 + +- **BREAKING**: migrated from `package:flutter/material.dart` to [`material_ui`](https://pub.dev/packages/material_ui). + Material was decoupled from the Flutter SDK; the in-SDK copy is frozen and scheduled for removal + ([flutter/flutter#184093](https://github.com/flutter/flutter/issues/184093), + [flutter/flutter#172942](https://github.com/flutter/flutter/issues/172942)). +- Fixes "No Material widget found" on Flutter 3.47 for apps using `material_ui` + ([#237](https://github.com/Tkko/Flutter_Pinput/issues/237)) — `debugCheckHasMaterial` matches the ancestor by exact + type, so a `material_ui` `Scaffold` never satisfied the legacy check. +- **BREAKING**: requires Flutter >= 3.44.0 and Dart >= 3.12.0 (the floor `material_ui` declares). Apps still on + `package:flutter/material.dart` should stay on 6.x. + #### 6.0.2 · 4/01/2026 - Added Prelude.so sponsorship badge diff --git a/example/lib/demo/builder_example.dart b/example/lib/demo/builder_example.dart index 18e4131..fab95dc 100644 --- a/example/lib/demo/builder_example.dart +++ b/example/lib/demo/builder_example.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:pinput/pinput.dart'; class PinputBuilderExample extends StatefulWidget { diff --git a/example/lib/demo/demo.dart b/example/lib/demo/demo.dart index 7c3ad52..4fddb2d 100644 --- a/example/lib/demo/demo.dart +++ b/example/lib/demo/demo.dart @@ -1,6 +1,6 @@ import 'dart:math'; import 'dart:ui'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput_example/demo/pages/gallery_page.dart'; diff --git a/example/lib/demo/pages/all_pinputs_page.dart b/example/lib/demo/pages/all_pinputs_page.dart index 01671e7..d2b7b2e 100644 --- a/example/lib/demo/pages/all_pinputs_page.dart +++ b/example/lib/demo/pages/all_pinputs_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; class AllPinputs extends StatefulWidget { final List pinPuts; diff --git a/example/lib/demo/pages/gallery_page.dart b/example/lib/demo/pages/gallery_page.dart index a561ff5..694edf7 100644 --- a/example/lib/demo/pages/gallery_page.dart +++ b/example/lib/demo/pages/gallery_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:pinput_example/demo/demo.dart'; import 'package:pinput_example/demo/pages/all_pinputs_page.dart'; import 'package:pinput_example/demo/pages/otp_page.dart'; diff --git a/example/lib/demo/pages/otp_page.dart b/example/lib/demo/pages/otp_page.dart index 683b733..57d4a70 100644 --- a/example/lib/demo/pages/otp_page.dart +++ b/example/lib/demo/pages/otp_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; class OtpPage extends StatefulWidget { diff --git a/example/lib/demo/pinput_templates/filled.dart b/example/lib/demo/pinput_templates/filled.dart index f977bfb..82db4fe 100644 --- a/example/lib/demo/pinput_templates/filled.dart +++ b/example/lib/demo/pinput_templates/filled.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/demo/pinput_templates/filled_rounded.dart b/example/lib/demo/pinput_templates/filled_rounded.dart index 2ab72c8..98acc86 100644 --- a/example/lib/demo/pinput_templates/filled_rounded.dart +++ b/example/lib/demo/pinput_templates/filled_rounded.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/demo/pinput_templates/only_bottom_cursor.dart b/example/lib/demo/pinput_templates/only_bottom_cursor.dart index b65e2c2..b9680cf 100644 --- a/example/lib/demo/pinput_templates/only_bottom_cursor.dart +++ b/example/lib/demo/pinput_templates/only_bottom_cursor.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/demo/pinput_templates/rounded_with_cursor.dart b/example/lib/demo/pinput_templates/rounded_with_cursor.dart index e108f46..c200a15 100644 --- a/example/lib/demo/pinput_templates/rounded_with_cursor.dart +++ b/example/lib/demo/pinput_templates/rounded_with_cursor.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/demo/pinput_templates/rounded_with_shadow.dart b/example/lib/demo/pinput_templates/rounded_with_shadow.dart index d75f56d..0d42208 100644 --- a/example/lib/demo/pinput_templates/rounded_with_shadow.dart +++ b/example/lib/demo/pinput_templates/rounded_with_shadow.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/demo/sms_retriever_api_example.dart b/example/lib/demo/sms_retriever_api_example.dart index 67b268f..c2c3d82 100644 --- a/example/lib/demo/sms_retriever_api_example.dart +++ b/example/lib/demo/sms_retriever_api_example.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:pinput/pinput.dart'; import 'package:smart_auth/smart_auth.dart'; diff --git a/example/lib/demo/user_consent_api_example.dart b/example/lib/demo/user_consent_api_example.dart index 30b4254..3b5d93b 100644 --- a/example/lib/demo/user_consent_api_example.dart +++ b/example/lib/demo/user_consent_api_example.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:pinput/pinput.dart'; import 'package:smart_auth/smart_auth.dart'; diff --git a/example/lib/demo/widgets/alien_keyboard.dart b/example/lib/demo/widgets/alien_keyboard.dart index 2f21cce..dcb219c 100644 --- a/example/lib/demo/widgets/alien_keyboard.dart +++ b/example/lib/demo/widgets/alien_keyboard.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/lib/main.dart b/example/lib/main.dart index 89105cf..cbf0908 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:flutter/services.dart'; import 'package:pinput/pinput.dart'; import 'package:smart_auth/smart_auth.dart'; diff --git a/example/lib/test_examples.dart b/example/lib/test_examples.dart index dc533b0..ed5b80e 100644 --- a/example/lib/test_examples.dart +++ b/example/lib/test_examples.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:flutter/services.dart'; import 'package:pinput/pinput.dart'; diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 20d7d56..2b4991b 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -17,13 +17,14 @@ publish_to: none version: 1.0.0+1 environment: - sdk: '>=3.8.0 <4.0.0' - flutter: ">=3.32.0" + sdk: '>=3.12.0 <4.0.0' + flutter: ">=3.44.0" dependencies: flutter: sdk: flutter + material_ui: ^1.0.0 pinput: path: ../ diff --git a/lib/src/pinput.dart b/lib/src/pinput.dart index e0c8c08..46cdaeb 100644 --- a/lib/src/pinput.dart +++ b/lib/src/pinput.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'dart:ui'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/foundation.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 78ad337..8071bb0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: pinput -version: 6.0.2 +version: 7.0.0 description: Pin code input (OTP) text field, iOS SMS autofill, Android SMS autofill One Time Code, Password, Passcode, Captcha, Security, Coupon, Wowcher, 2FA, Two step verification homepage: https://github.com/Tkko/Flutter_PinPut repository: https://github.com/Tkko/Flutter_PinPut @@ -19,13 +19,14 @@ funding: - https://ko-fi.com/flutterman environment: - sdk: '>=2.19.0 <4.0.0' - flutter: ">=3.7.0" + sdk: '>=3.12.0 <4.0.0' + flutter: ">=3.44.0" dependencies: flutter: sdk: flutter + material_ui: ^1.0.0 dev_dependencies: flutter_test: diff --git a/test/helpers/pump_app.dart b/test/helpers/pump_app.dart index 9713769..c683226 100644 --- a/test/helpers/pump_app.dart +++ b/test/helpers/pump_app.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:flutter_test/flutter_test.dart'; extension PumpApp on WidgetTester { diff --git a/test/pinput_test.dart b/test/pinput_test.dart index 2cd21da..0d9cf5d 100644 --- a/test/pinput_test.dart +++ b/test/pinput_test.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:material_ui/material_ui.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pinput/pinput.dart';