Closes #2 - implemented app structure
parent
0cf06d7bc6
commit
090e36201b
|
@ -1,14 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import './appbar.dart';
|
||||
import 'routes.dart';
|
||||
|
||||
void main() => runApp(BeepApp());
|
||||
|
||||
class BeepApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: <Widget>[
|
||||
AppBar("BeepApp"),
|
||||
Container(child: Text("Hello World"))
|
||||
]);
|
||||
}
|
||||
void main() {
|
||||
Routes();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'screens/home/index.dart';
|
||||
|
||||
class Routes {
|
||||
final routes = <String, WidgetBuilder>{
|
||||
'/home': (BuildContext context) => Home()
|
||||
};
|
||||
|
||||
Routes() {
|
||||
runApp(MaterialApp(
|
||||
title: "Beep",
|
||||
routes: routes,
|
||||
home: Home(),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend_flutter/widgets/app_bar/index.dart';
|
||||
import 'package:frontend_flutter/widgets/top_bar/index.dart';
|
||||
|
||||
class Home extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: <Widget>[
|
||||
AppBar("BeepApp"),
|
||||
TopBar("BeepApp"),
|
||||
Container(child: Text("Hello World"))
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
export 'app_bar.dart';
|
|
@ -0,0 +1 @@
|
|||
export 'top_bar.dart';
|
|
@ -1,10 +1,10 @@
|
|||
import "package:flutter/material.dart";
|
||||
|
||||
class AppBar extends StatelessWidget {
|
||||
class TopBar extends StatelessWidget {
|
||||
final String title;
|
||||
final double barHeight = 5.0;
|
||||
final double barHeight = 40.0;
|
||||
|
||||
AppBar(title) : title = title;
|
||||
TopBar(title) : title = title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
Loading…
Reference in New Issue