aves_mio/.flutter/examples/api/test/widgets/text/text.0_test.dart
Fabio Micheluz 2c988f959b
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-02-19 13:25:23 +01:00

26 lines
985 B
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/widgets/text/text.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('WidgetsApp test', (WidgetTester tester) async {
await tester.pumpWidget(const example.DefaultTextStyleApp());
expect(find.text('Flutter'), findsOneWidget);
final RichText text = tester.firstWidget(find.byType(RichText));
expect(text.text.style!.fontSize, 24);
expect(text.text.style!.fontWeight, FontWeight.bold);
// Because this example uses Material 3 and a light brightness, the text color
// should be the color scheme `onSurface` color.
final Color textColor = ColorScheme.fromSeed(
seedColor: Colors.purple,
).onSurface;
expect(text.text.style!.color, textColor);
});
}