forked from chimple/tahiti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop_menu.dart
78 lines (75 loc) · 2.83 KB
/
top_menu.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import 'package:flutter/material.dart';
import 'package:tahiti/popup_grid_view.dart';
import 'package:tahiti/select_sticker.dart';
class TopMenu extends StatelessWidget {
Size size;
Orientation orientation;
String title;
TopMenu(this.title);
@override
Widget build(BuildContext context) {
orientation = MediaQuery.of(context).orientation;
size = MediaQuery.of(context).size;
return Container(
height: orientation == Orientation.portrait
? (size.height - size.width) / 2
: (size.width - size.height) * .25,
width: orientation == Orientation.portrait
? (size.height - size.width) * .4
: (size.width - size.height) / 2,
child: Stack(
children: <Widget>[
Positioned(
top: 0.0,
left: orientation == Orientation.portrait ? 0.0 : null,
right: 0.0,
bottom: orientation == Orientation.portrait ? null : 0.0,
child: Container(
alignment: Alignment.centerRight,
height: orientation == Orientation.portrait
? (size.height - size.width) / 2
: (size.width - size.height) * .25,
width: orientation == Orientation.portrait
? (size.height - size.width) * .4
: (size.width - size.height) / 2,
color: Color(0xff2b3f4c),
),
),
Positioned(
top: 0.0,
left: 0.0,
right: 0.0,
child: orientation == Orientation.portrait
? Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.white,
width: (size.height - size.width) * .005)),
),
alignment: Alignment.center,
height: (size.height - size.width) * .2,
// width: size.width * .4,
child: Text(
title ?? '',
style: TextStyle(
color: Colors.white,
fontSize: (size.height - size.width) * .1,
),
))
: Container()),
Positioned(
top: orientation == Orientation.portrait
? (size.height - size.width) / 4
: 0.0,
right: orientation == Orientation.portrait ? 0.0 : null,
left: orientation == Orientation.portrait
? 0.0
: (size.width - size.height) / 6,
bottom: orientation == Orientation.portrait ? null : 0.0,
child: SelectSticker(side: DisplaySide.first)),
],
),
);
}
}