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
| class YoutubeUtils { | |
| private val client = OkHttpClient() | |
| suspend fun isYoutubeShortVideo(videoId: String): Boolean = | |
| withContext(Dispatchers.IO) { | |
| val url = "https://www.youtube.com/watch?v=$videoId" | |
| val request = Request.Builder().url(url).build() | |
| client.newCall(request).execute().use { response -> |
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 android.animation.AnimatorSet | |
| import android.animation.ObjectAnimator | |
| import android.annotation.SuppressLint | |
| import android.content.Context | |
| import android.util.AttributeSet | |
| import android.view.GestureDetector | |
| import android.view.MotionEvent | |
| import android.view.View | |
| import android.widget.FrameLayout | |
| import androidx.core.view.GestureDetectorCompat |
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:flutter/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:scanning_aimation/scanner.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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
| phoneNumberFocusNode.addListener(() { | |
| bool hasFocus = searchData.phoneNumberFocusNode.hasFocus; | |
| if (hasFocus) | |
| showOverlay(context); | |
| else | |
| removeOverlay(); | |
| }); |
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
| showOverlay(BuildContext context) { | |
| if (overlayEntry != null) return; | |
| OverlayState overlayState = Overlay.of(context); | |
| overlayEntry = OverlayEntry(builder: (context) { | |
| return Positioned( | |
| bottom: MediaQuery.of(context).viewInsets.bottom, | |
| right: 0.0, | |
| left: 0.0, | |
| child: InputDoneView()); | |
| }); |
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
| class InputDoneView extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Container( | |
| width: double.infinity, | |
| color: Color(Const.doneButtonBg), | |
| child: Align( | |
| alignment: Alignment.topRight, | |
| child: Padding( | |
| padding: const EdgeInsets.only(top: 4.0, bottom: 4.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
| CupertinoPageScaffold( | |
| navigationBar: CupertinoNavigationBar( | |
| middle: Text( | |
| title, | |
| style: TextStyle(color: Colors.black), | |
| ), | |
| trailing: CupertinoButton( | |
| padding: EdgeInsets.only(top: 0, right: 16.0), | |
| child: Text( | |
| "Save", |
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
| showActionSheet( | |
| context: context, | |
| child: CupertinoActionSheet( | |
| message: const Text('Select image from'), | |
| actions: <Widget>[ | |
| CupertinoActionSheetAction( | |
| child: Padding( | |
| padding: const EdgeInsets.only(right: 16.0), | |
| child: Text( | |
| 'Camera', |
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
| showDialog( | |
| context: context, | |
| barrierDismissible: false, | |
| builder: (context) { | |
| return new CupertinoAlertDialog( | |
| title: new Text('Data not saved?'), | |
| content: new Text( | |
| 'Data will be lost. Are you sure you want to exit?'), | |
| actions: <Widget>[ | |
| new CupertinoButton( |
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
| final Map<int, Widget> children = <int, Widget>{ | |
| 0: Text('Basic'), | |
| 1: Text('Advanced'), | |
| }; | |
| CupertinoSegmentedControl<int>( | |
| children: children, | |
| onValueChanged: (int newValue) { | |
| setState(() { |
NewerOlder