-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathresponsive_view.dart
117 lines (107 loc) · 4.19 KB
/
responsive_view.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// import 'package:flutter/material.dart';
// import 'package:get/get.dart';
// import 'package:get/get_state_manager/src/simple/get_responsive.dart';
// class ResponsiveController extends GetxController {}
// class ResponsiveView extends GetResponsiveView<ResponsiveController> {
// @override
// Widget builder() {
// return Scaffold(
// appBar: AppBar(title: Text('ResponsivePage')),
// body: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Text('Resize the screen to see the results',
// style: TextStyle(fontSize: 35)),
// _drawLine(),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// _getIcon(Icons.desktop_windows, ScreenType.Desktop),
// _getIcon(Icons.tablet, ScreenType.Tablet),
// _getIcon(Icons.phone, ScreenType.Phone),
// _getIcon(Icons.watch, ScreenType.Watch),
// ],
// ),
// Text(screen.screenType.toString(), style: TextStyle(fontSize: 35)),
// _drawLine(),
// Text('ResponsiveViewCases', style: TextStyle(fontSize: 35)),
// _drawLine(),
// Text('Or you can set specific value depending on the screnn type',
// style: TextStyle(
// fontSize: 35,
// color: screen.responsiveValue(
// desktop: Colors.indigo,
// tablet: Colors.yellow,
// mobile: Colors.red,
// watch: Colors.black))),
// ResponsiveViewCases(),
// _drawLine(),
// Text('ResponsiveViewCases1', style: TextStyle(fontSize: 35)),
// ResponsiveViewCases1(),
// _drawLine(),
// Text('ResponsiveViewCustomSettings',
// style: TextStyle(fontSize: 35)),
// ResponsiveViewCustomSettings(),
// ],
// ));
// }
// Widget _drawLine() => Container(
// width: double.infinity,
// height: 2,
// color: Colors.indigo,
// );
// Widget _getIcon(IconData icon, ScreenType type) {
// return AnimatedContainer(
// padding: EdgeInsets.all(20),
// decoration: BoxDecoration(
// color: screen.screenType == type ? Colors.amber : Colors.transparent,
// borderRadius: BorderRadius.circular(5),
// ),
// duration: 1.seconds,
// child: Icon(
// icon,
// size: 75,
// color: Colors.indigo,
// ),
// );
// }
// }
// class ResponsiveViewCases extends GetResponsiveView<ResponsiveController> {
// ResponsiveViewCases() : super(alwaysUseBuilder: false);
// @override
// Widget phone() => Icon(Icons.phone, size: 75);
// @override
// Widget desktop() => Container(
// child: Icon(Icons.desktop_windows, size: 75),
// color: screen.isTablet ? Colors.red : Colors.indigo);
// }
// class ResponsiveViewCases1 extends GetResponsiveView<ResponsiveController> {
// @override
// Widget builder() => screen.isDesktop
// ? Container(
// child: Icon(Icons.desktop_windows, size: 75),
// color: screen.isTablet ? Colors.red : Colors.indigo)
// : screen.isPhone
// ? Icon(Icons.phone, size: 75)
// : Icon(Icons.info, size: 75);
// }
// class ResponsiveViewCustomSettings
// extends GetResponsiveView<ResponsiveController> {
// ResponsiveViewCustomSettings()
// : super(
// settings: ResponsiveScreenSettings(
// desktopChangePoint: 800,
// tabletChangePoint: 700,
// watchChangePoint: 600));
// @override
// Widget builder() => Column(
// children: [
// Text('Desktop up 800, Tablet up 700 watch up 600',
// style: TextStyle(fontSize: 35)),
// Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
// Text(screen.width.toString(), style: TextStyle(fontSize: 35)),
// Text(screen.screenType.toString(), style: TextStyle(fontSize: 35)),
// ]),
// ],
// );
// }