Code
import 'package:flutter/material.dart';
import 'package:top_snackbar_flutter/top_snack_bar.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Builder(builder: (context) {
return Scaffold(
body: Center(
child: TextButton(
onPressed: () => showTopSnackBar(
context,
Container(
width: double.infinity,
margin: const EdgeInsets.only(top: 47),
height: 41,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: const Color(0xffFF277F),
borderRadius: BorderRadius.circular(8),
),
child: const Text(
'Testing testing testing',
// minFontSize: 10,
maxLines: 1,
style: TextStyle(
color: Colors.white,
fontSize: 14,
height: 17 / 14,
fontWeight: FontWeight.w500,
),
),
),
displayDuration: const Duration(seconds: 10000),
),
child: const Text('click'),
),
),
);
}),
);
}
}
There are underlines on text. And, font family works wrong too, even if I've set default font family on MaterialApp.
So, I need to override every text style to show properly.
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale
en-KR)
• Flutter version 2.8.1 at /Users/suhwancha/development/GitHub/flutter
• Upstream repository [email protected]:SuhwanCha/flutter.git
• Framework revision 77d935af4d (2 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/suhwancha/Library/Android/sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• 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.10+0-b96-7249189)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.29.0
[✓] Connected device (2 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12
(API 31) (emulator)
• Chrome (web) • chrome • web-javascript • Google
Chrome 96.0.4664.110