diff --git a/lib/home_page.dart b/lib/home_page.dart new file mode 100644 index 0000000..5d1557d --- /dev/null +++ b/lib/home_page.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class HomePage extends StatelessWidget{ + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Home'), + ), + body: const Center( + child: Text('Flutterando'), + ), + floatingActionButton: FloatingActionButton( + child: const Icon(Icons.add), + onPressed: () { + debugPrint('Clicou'); + }, + ), + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index b77a5f8..f5f9da6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,38 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:hello_world/myapp.dart'; void main() { runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - @override - Widget build(BuildContext context){ - return const MaterialApp( - home: HomeWidget(), - ); - } -} - -class HomeWidget extends StatelessWidget{ - const HomeWidget({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Home'), - ), - body: const Center( - child: Text('Flutterando'), - ), - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.add), - onPressed: () { - debugPrint('Clicou'); - }, - ), - ); - } } \ No newline at end of file diff --git a/lib/myapp.dart b/lib/myapp.dart new file mode 100644 index 0000000..527158e --- /dev/null +++ b/lib/myapp.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'home_page.dart'; + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context){ + return const MaterialApp( + home: HomePage(), + ); + } +} \ No newline at end of file