This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
58 lines (53 loc) · 1.51 KB
/
main.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
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:my_popup_menu/my_popup_menu.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return PlatformApp(
title: 'Flutter Demo',
home: ExampleHomePage(),
);
}
}
class ExampleHomePage extends StatelessWidget {
ExampleHomePage({Key? key}) : super(key: key);
final StreamController<Size> controller = StreamController<Size>.broadcast();
@override
Widget build(BuildContext context) {
return PlatformScaffold(
appBar: PlatformAppBar(
title: Row(
children: [
Expanded(child: Container()),
MyPopupIconButton(
isSelected: true,
menuContent: MyPopupMenu(
sizeController: controller,
initialSize: const Size(200, 300),
child: TextButton(
child: Text("add Size"),
onPressed: () {
controller.add(Size(200, 800));
},
),
),
icon: Icon(
PlatformIcons(context).book,
),
notSelectedIcon: Icon(
PlatformIcons(context).book,
),
),
],
),
),
);
}
}