adding app structure
parent
baf4a85d8a
commit
0cf06d7bc6
|
@ -1,43 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import './appbar.dart';
|
||||
|
||||
void main() => runApp(BeepApp());
|
||||
|
||||
class BeepApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new MaterialApp(
|
||||
home: new Scaffold(
|
||||
appBar: new PreferredSize(
|
||||
child: new Container(
|
||||
padding: new EdgeInsets.only(top: 30.0),
|
||||
child: new Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 30.0, top: 20.0, bottom: 20.0),
|
||||
child: new Text(
|
||||
'Arnold Parge',
|
||||
style: new TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
decoration: new BoxDecoration(
|
||||
gradient:
|
||||
new LinearGradient(colors: [Colors.red, Colors.yellow]),
|
||||
boxShadow: [
|
||||
new BoxShadow(
|
||||
color: Colors.grey[500],
|
||||
blurRadius: 20.0,
|
||||
spreadRadius: 1.0,
|
||||
)
|
||||
]),
|
||||
),
|
||||
preferredSize: new Size.fromHeight(150.0),
|
||||
),
|
||||
body: new Center(
|
||||
child: new Text('Hello'),
|
||||
),
|
||||
),
|
||||
);
|
||||
return Column(children: <Widget>[
|
||||
AppBar("BeepApp"),
|
||||
Container(child: Text("Hello World"))
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend_flutter/widgets/app_bar/index.dart';
|
||||
|
||||
class Home extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: <Widget>[
|
||||
AppBar("BeepApp"),
|
||||
Container(child: Text("Hello World"))
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export 'home.dart';
|
|
@ -0,0 +1,33 @@
|
|||
import "package:flutter/material.dart";
|
||||
|
||||
class AppBar extends StatelessWidget {
|
||||
final String title;
|
||||
final double barHeight = 5.0;
|
||||
|
||||
AppBar(title) : title = title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double statusbarHeight = MediaQuery.of(context).padding.top;
|
||||
|
||||
return new Container(
|
||||
padding: new EdgeInsets.only(top: statusbarHeight),
|
||||
height: statusbarHeight + barHeight,
|
||||
child: new Center(
|
||||
child: new Text(
|
||||
title,
|
||||
style: new TextStyle(
|
||||
fontSize: 20.0, color: Colors.white, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
decoration: new BoxDecoration(
|
||||
gradient: new LinearGradient(
|
||||
colors: [Colors.red, Colors.blue],
|
||||
begin: const FractionalOffset(0.0, 0.0),
|
||||
end: const FractionalOffset(0.5, 0.0),
|
||||
stops: [0.0, 1.0],
|
||||
tileMode: TileMode.clamp),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export 'app_bar.dart';
|
Loading…
Reference in New Issue