flutter_design_patterns/lib/main.dart

55 lines
1.2 KiB
Dart
Raw Normal View History

2024-05-02 11:41:57 -06:00
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
2024-05-02 11:43:16 -06:00
home: const MyHomePage(),
2024-05-02 11:41:57 -06:00
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
2024-05-02 11:43:16 -06:00
title: const Text('Abstract Factory'),
2024-05-02 11:41:57 -06:00
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
2024-05-02 11:43:16 -06:00
'some text',
2024-05-02 11:41:57 -06:00
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
);
}
}