aves_mio1/.flutter/examples/api/lib/widgets/text/text.0.dart
FabioMich66 19a982ede6
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-03-05 15:51:30 +01:00

40 lines
1.1 KiB
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';
/// Flutter code sample for [DefaultTextStyle].
void main() => runApp(const DefaultTextStyleApp());
class DefaultTextStyleApp extends StatelessWidget {
const DefaultTextStyleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
brightness: Brightness.light,
colorSchemeSeed: Colors.purple,
),
home: const DefaultTextStyleExample(),
);
}
}
class DefaultTextStyleExample extends StatelessWidget {
const DefaultTextStyleExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('DefaultTextStyle.merge Sample')),
// Inherit MaterialApp text theme and override font size and font weight.
body: DefaultTextStyle.merge(
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
child: const Center(child: Text('Flutter')),
),
);
}
}