search.dart 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. import 'package:flutter/material.dart';
  2. import 'package:date_format/date_format.dart';
  3. import 'package:dotted_line/dotted_line.dart';
  4. var date = formatDate(DateTime.now(), [HH, ':', nn]);
  5. class SearchPage extends StatelessWidget {
  6. final Map<String, dynamic> items;
  7. SearchPage({super.key, required this.items});
  8. @override
  9. Widget build(BuildContext context) {
  10. return Scaffold(
  11. appBar: AppBar(
  12. backgroundColor: Colors.white,
  13. automaticallyImplyLeading: false,
  14. elevation: 0,
  15. toolbarHeight: 44,
  16. title: Text(
  17. date,
  18. style: TextStyle(color: Color(0xff303336), fontSize: 15),
  19. ),
  20. actions: [
  21. Icon(
  22. Icons.signal_cellular_alt,
  23. color: Color(0xff303336),
  24. ),
  25. Icon(
  26. Icons.wifi,
  27. color: Color(0xff303336),
  28. ),
  29. RotatedBox(
  30. quarterTurns: -3,
  31. child: Icon(
  32. Icons.battery_std,
  33. color: Color(0xff303336),
  34. ),
  35. )
  36. ],
  37. ),
  38. body: SingleChildScrollView(
  39. child: Column(
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. children: [
  42. Row(
  43. children: [
  44. BackButton(),
  45. Container(
  46. height: 44,
  47. alignment: Alignment.centerLeft,
  48. padding: EdgeInsets.symmetric(horizontal: 10),
  49. child: Text(
  50. items['type'],
  51. style: TextStyle(fontWeight: FontWeight.w500, fontSize: 17),
  52. ),
  53. ),
  54. ],
  55. ),
  56. Padding(
  57. padding: const EdgeInsets.symmetric(horizontal: 10),
  58. child: SizedBox(
  59. width: 396,
  60. height: 267.72,
  61. child: gambar(items),
  62. ),
  63. ),
  64. Container(
  65. margin: EdgeInsets.all(10),
  66. decoration: BoxDecoration(
  67. border: Border.all(color: Colors.black.withOpacity(0.1)),
  68. shape: BoxShape.rectangle,
  69. borderRadius: BorderRadius.circular(12)),
  70. child: Column(
  71. crossAxisAlignment: CrossAxisAlignment.start,
  72. children: [
  73. Container(
  74. margin: EdgeInsets.all(5),
  75. child: Text(
  76. items['type'],
  77. overflow: TextOverflow.clip,
  78. style: TextStyle(
  79. fontWeight: FontWeight.w400,
  80. color: Color(0xff292D32),
  81. fontSize: 14),
  82. ),
  83. ),
  84. Padding(
  85. padding: const EdgeInsets.symmetric(horizontal: 5),
  86. child: DottedLine(
  87. lineLength: 396,
  88. ),
  89. ),
  90. Container(
  91. margin: EdgeInsets.all(5),
  92. width: 396,
  93. child: Text(
  94. items['longText'],
  95. overflow: TextOverflow.clip,
  96. style: TextStyle(
  97. fontWeight: FontWeight.w300,
  98. color: Color(0xff292D32),
  99. fontSize: 13),
  100. ),
  101. ),
  102. ],
  103. ),
  104. ),
  105. Container(
  106. margin: EdgeInsets.symmetric(horizontal: 10),
  107. child: Text(
  108. 'Your Location',
  109. style: TextStyle(fontWeight: FontWeight.w500, fontSize: 14),
  110. ),
  111. ),
  112. Container(
  113. margin: EdgeInsets.all(10),
  114. decoration: BoxDecoration(
  115. border: Border.all(color: Colors.black.withOpacity(0.1)),
  116. shape: BoxShape.rectangle,
  117. borderRadius: BorderRadius.circular(12)),
  118. child: Column(
  119. crossAxisAlignment: CrossAxisAlignment.start,
  120. children: [
  121. Row(
  122. children: [
  123. Icon(Icons.remove),
  124. Column(
  125. crossAxisAlignment: CrossAxisAlignment.start,
  126. children: [Text('Default Location'), Text('Room 331')],
  127. )
  128. ],
  129. ),
  130. Divider(),
  131. Row(
  132. children: [
  133. Icon(Icons.add),
  134. Column(
  135. children: [
  136. Text('I moved to other location'),
  137. Container(
  138. decoration: BoxDecoration(
  139. border: Border.all(
  140. color: Colors.black.withOpacity(0.1)),
  141. shape: BoxShape.rectangle,
  142. borderRadius: BorderRadius.circular(12)),
  143. )
  144. ],
  145. )
  146. ],
  147. ),
  148. ],
  149. ),
  150. ),
  151. ],
  152. ),
  153. ),
  154. );
  155. }
  156. Container gambar(items) {
  157. return Container(
  158. decoration: BoxDecoration(
  159. border: Border.all(color: items['color']),
  160. borderRadius: BorderRadius.all(Radius.circular(20)),
  161. color: items['color'].withOpacity(0.4)),
  162. padding: const EdgeInsets.all(5.0),
  163. child: Image.asset(
  164. items['image'],
  165. fit: BoxFit.cover,
  166. ),
  167. );
  168. }
  169. }