This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2014 The Flutter Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/services.dart'; | |
| // Offset from offscreen below to stopping below the top of the screen. | |
| final Animatable<Offset> _kBottomUpTween = Tween<Offset>( | |
| begin: const Offset(0.0, 1.0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| class CustomTimerWidget extends LeafRenderObjectWidget { | |
| final double progress; | |
| final String remainingTime; | |
| final String label; | |
| final VoidCallback? onTap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:formz/formz.dart'; | |
| enum EmailValidationError { invalid } | |
| class Email extends FormzInput<String, EmailValidationError> { | |
| Email.pure([super.value = '']) : super.pure(); | |
| Email.dirty([super.value = '']) : super.dirty(); | |
| static final _emailRegExp = RegExp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| onSelectNotification('agencyNotification', 'HereThere'); | |
| } | |
| void onSelectNotification(String type, String data) { | |
| switch (type) { | |
| case 'agencyNotification': | |
| case 'newAdsInSearch': | |
| if(data == 'HereThere') { | |
| print("Handle Search"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum MD2IndicatorSize { | |
| tiny, | |
| normal, | |
| full, | |
| } | |
| class MD2Indicator extends Decoration { | |
| final double indicatorHeight; | |
| final Color indicatorColor; | |
| final MD2IndicatorSize indicatorSize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| // Function to print numbers from 1 to 100, display Bud when in multiples of 3 | |
| // Display Vue when in multiples of 5 | |
| // Display "Budvue should consider $yourName for this position" when in multiples of both 3 and 5 | |
| printNumbers(1, 100); | |
| } | |
| void printNumbers(int start, int end) { | |
| var yourName = "Temitope Ajiboye"; | |
| for (var i = start; i <= end; i++) { | |
| //show mutliples of 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:freezed_annotation/freezed_annotation.dart'; | |
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
| part 'request_state_notifier.freezed.dart'; | |
| class RequestStateNotifier<T> extends StateNotifier<RequestState<T>> { | |
| RequestStateNotifier() : super(RequestState.idle()); | |
| Future<RequestState<T>> makeRequest(Future<T> Function() function) async { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:quiver/async.dart'; | |
| CountdownTimer _countdownTimer; | |
| Listener( | |
| behavior: HitTestBehavior.translucent, | |
| onPointerMove: (_) { | |
| _countdownTimer = | |
| CountdownTimer(Duration(minutes: 5), Duration(seconds: 1)); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:freezed_annotation/freezed_annotation.dart'; | |
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
| part 'request_state_notifier.freezed.dart'; | |
| abstract class RequestStateNotifier<T> extends StateNotifier<RequestState<T>> { | |
| RequestStateNotifier() : super(RequestState.idle()); | |
| //It returns a Future with state if you want to avoid ProviderListener | |
| Future<RequestState<T>> makeRequest(Future<T> Function() function) async { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension StringExtension on String { | |
| String get svg => 'assets/images/svg/$this.svg'; | |
| String get png => 'assets/images/png/$this.png'; | |
| } | |
| // Then you can do this | |
| SvgPicture.asset( | |
| 'back'.svg, | |
| height: 16, | |
| width: 16, |
NewerOlder