[READ-ONLY] Mirror of https://github.com/probablykasper/notifier. Android app for scheduling notifications
android app flutter notifications
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix weekdays always visible

Kasper (Jun 3, 2022, 4:06 AM +0200) a709c48d add2ae3e

+54 -64
+54 -64
lib/edit_dialog.dart
··· 109 109 110 110 @override 111 111 Widget build(context) { 112 + const removedTopPadding = 16.0; 112 113 return Form( 113 114 key: formKey, 114 115 child: SimpleDialog( ··· 267 268 ), 268 269 //* REPEAT EVERY 269 270 const SizedBox(width: 6), 270 - (() { 271 - if (widget.item.repeat == Repeat.never) { 272 - return const SizedBox(); 273 - } else { 274 - const removedTopPadding = 16.0; 275 - return SizedBox( 276 - width: 35, 277 - height: 278 - kMinInteractiveDimension - removedTopPadding, 279 - child: TextField( 280 - controller: widget.repeatEveryController, 281 - onChanged: (newValue) { 282 - setState(() { 283 - if (newValue == '') { 284 - widget.item.repeatEvery = 1; 285 - } else { 286 - widget.item.repeatEvery = 287 - int.parse(newValue); 288 - } 289 - }); 290 - }, 291 - textAlign: TextAlign.center, 292 - keyboardType: 293 - const TextInputType.numberWithOptions( 294 - signed: false, 295 - decimal: false, 296 - ), 297 - inputFormatters: [ 298 - FilteringTextInputFormatter.deny( 299 - RegExp('^0\$')), 300 - FilteringTextInputFormatter.digitsOnly, 301 - LengthLimitingTextInputFormatter(3), 302 - ], 303 - decoration: const InputDecoration( 304 - isDense: false, 305 - hintText: '1', 306 - contentPadding: 307 - EdgeInsets.only(top: -removedTopPadding), 308 - ), 271 + if (widget.item.repeat != Repeat.never) 272 + SizedBox( 273 + width: 35, 274 + height: kMinInteractiveDimension - removedTopPadding, 275 + child: TextField( 276 + controller: widget.repeatEveryController, 277 + onChanged: (newValue) { 278 + setState(() { 279 + if (newValue == '') { 280 + widget.item.repeatEvery = 1; 281 + } else { 282 + widget.item.repeatEvery = int.parse(newValue); 283 + } 284 + }); 285 + }, 286 + textAlign: TextAlign.center, 287 + keyboardType: const TextInputType.numberWithOptions( 288 + signed: false, 289 + decimal: false, 290 + ), 291 + inputFormatters: [ 292 + FilteringTextInputFormatter.deny(RegExp('^0\$')), 293 + FilteringTextInputFormatter.digitsOnly, 294 + LengthLimitingTextInputFormatter(3), 295 + ], 296 + decoration: const InputDecoration( 297 + isDense: false, 298 + hintText: '1', 299 + contentPadding: 300 + EdgeInsets.only(top: -removedTopPadding), 309 301 ), 310 - ); 311 - } 312 - })(), 302 + ), 303 + ), 313 304 const SizedBox(width: 6), 314 305 Text( 315 306 (() { ··· 331 322 ], 332 323 ), 333 324 ), 334 - //* WEEKDAY CHECKBOXES 335 - Container( 336 - padding: const EdgeInsets.symmetric(horizontal: 24), 337 - child: Wrap( 338 - children: [ 339 - for (var i = 0; i < 7; i++) 340 - LetterCheckbox( 341 - value: widget.item.weekdays[i], 342 - text: 'MTWTFSS'[i], 343 - toggle: (newValue) { 344 - setState(() { 345 - widget.item.weekdays[i] = newValue; 346 - }); 347 - }, 348 - enabledColor: Get.isDarkMode ? grey.c8 : blue, 349 - disabledColor: Get.isDarkMode ? grey.c5 : white.c6, 350 - ), 351 - ], 325 + if (widget.item.repeat == Repeat.weekly) 326 + //* WEEKDAY CHECKBOXES 327 + Container( 328 + padding: const EdgeInsets.symmetric(horizontal: 24), 329 + child: Wrap( 330 + children: [ 331 + for (var i = 0; i < 7; i++) 332 + LetterCheckbox( 333 + value: widget.item.weekdays[i], 334 + text: 'MTWTFSS'[i], 335 + toggle: (newValue) { 336 + setState(() { 337 + widget.item.weekdays[i] = newValue; 338 + }); 339 + }, 340 + enabledColor: Get.isDarkMode ? grey.c8 : blue, 341 + disabledColor: Get.isDarkMode ? grey.c5 : white.c6, 342 + ), 343 + ], 344 + ), 352 345 ), 353 - ), 354 346 ], 355 347 ), 356 348 ), ··· 372 364 }, 373 365 materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, 374 366 child: const Text('Delete'), 375 - ) 376 - else 377 - const SizedBox(), 367 + ), 378 368 SizedBox(width: widget.editMode ? 12 : 0), 379 369 //* CANCEL 380 370 MaterialButton(