1676991148
Scan by mobile is in pattern in many applications, the Easiest method for sending/getting data from code that can be scanned by the camera.
Scan the QR Code and Bar Code
Check the Example for more info
Run this command:
With Flutter:
$ flutter pub add custom_scanner_pkg
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
custom_scanner_pkg: ^0.0.1
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:custom_scanner_pkg/custom_scanner_pkg.dart';
example/lib/main.dart
import 'package:custom_scanner_pkg/custom_scanner_pkg.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Scanner Package Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Scanner Package Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String _scanBarcode = 'Unknown';
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.center,
child: Scrollbar(
child: Flex(
direction: Axis.vertical,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
width: 200.0,
height: 300.0,
child: CustomScanner(
type: 'QR Code',
scanResult: (result) => {
setState(() {
_scanBarcode = result;
})
}),
),
SizedBox(
width: 400.0,
height: 300.0,
child: Text('Scan result : $_scanBarcode\n',
style: const TextStyle(fontSize: 20)))
]),
)));
}
}
Download Details:
Author:
Source Code: https://pub.dev/packages/custom_scanner_pkg
1639576860
In this video i tell you how to customise your logcat completely which will help to faster debugging
1627205706
#TheTechDesigner
#Flutter #FlutterUI #SpeedCode #FlutterTutorial #FlutterAnimation #FlutterWidgets
━ ━ ━ ━ ━ ━ ━ ━ ━ ━━ ━ ━ ━ ━ ━ ━ ━ ━ ━
Some Cool Gadgets :-
━ ━ ━ ━ ━ ━ ━ ━ ━ ━━ ━ ━ ━ ━ ━ ━ ━ ━ ━
► Wire Organizer + Charging & Stand Station - https://amzn.to/3q1VEdw
► wireless keyboard - https://amzn.to/3iuENxv
► Laptop Stand - https://amzn.to/3lK4VGM
► Table Lamp - https://amzn.to/2Vt0K7P
► 6-Socket Surge Protector Universal Socket - https://amzn.to/3AiBlfA
► SUPER TOY LCD Writing Tablet 8.5Inch E-Note Pad - https://amzn.to/39km1nk
► OnePlus Bullets Wireless Z Bass Edition - https://amzn.to/2XwZjWZ
► boAt Airdopes - https://amzn.to/2ZdkldB
► HP v236w 64GB USB 2.0 Pen Drive - https://amzn.to/3hMHQR6
► callas Multipurpose Foldable Laptop Table with Cup Holder | Drawer | Mac Holder | Table Holder Study Table, Breakfast Table -https://amzn.to/39jqyq1
► Crucial BX500 240GB 3D NAND SATA 2.5-inch (6.3 cm) SSD - https://amzn.to/3EAXBVc
► Zinq Technologies Cool Slate Dual Fan Cooling Pad for Notebook/Laptop with Dual USB Port - https://amzn.to/3Ct0dT6
You will learn to create beautiful UI and WIDGET for applications.
If you liked the video, then please show me by hitting the like button for video.
━ ━ ━ ━ ━ ━ ━ ━ ━ ━━ ━ ━ ━ ━ ━ ━ ━ ━ ━
Other Videos
━ ━ ━ ━ ━ ━ ━ ━ ━ ━━ ━ ━ ━ ━ ━ ━ ━ ━ ━
► Watch Store App UI - https://youtu.be/S_qzTkx9vCQ
► Food Recipes App UI - https://youtu.be/GxHyNwBOBMg
► Food Menu App UI - https://youtu.be/u8BZpZo6gOU
► E-Bike/Scooter App UI - https://youtu.be/GiF6r_tipx8
► Furniture Shop App UI - https://youtu.be/rjy02JKwcO0
► Watch Store App UI - https://youtu.be/S_qzTkx9vCQ
► Food Recipes App UI - https://youtu.be/GxHyNwBOBMg
► E-Commerce App | EP.02 Landing Screen -https://youtu.be/IvugwMnQXCs
► E-Commerce App | EP.03 Signup Screen - https://youtu.be/ZaKpWeuKhXs
► E-Commerce App | EP.04 SignIn & ForgotPassword Screen - https://youtu.be/sh52KFB94Lo
SUBSCRIBE FOR MORE VIDEOS LIKE THIS
LIKE & SHARE
THANKS FOR WATCHING!
#flutter #andoid #ios #ui #food #menu
1623157063
Businesses are striving for apps to increase the company’s growth. One can see a steep rise across the globe to create apps to lead the company. All your competitors are also working day and night tirelessly to stand like a rock in such times.
Do you know? As per Statista, the number of smartphone users will reach up to 3.8 billion by the end of 2021.
You have taken the right decision to develop the app for your business. But you might have slight confusion on which platform you should get the app first, Android or iOS.
Android and iOS platforms have different user bases that you need to target for your business. There are some factors that you need to focus on while developing the app. These are like target audience, budget for development and deadlines, desired features, and revenue.
In this blog, I have explained major factors to keep in mind for developing the app. I have also thrown some lights on the pros and cons of Android and iOS, comparing these two platforms.
At first, Let’s discuss the factors to consider when choosing between Android and iOS development.
Whenever you decide to build an app, what comes to mind is the audience, as they are the ones who will be using your app.
As far as Android users are concerned, they are more likely to be found in emerging markets like Asia, Africa, and South America. So, if you target a global audience, then creating the app on Android will be more fruitful than Apple.
Do you know? Android has opted for the first position in the market in terms of market share.
Despite it, If you want to develop the app on Android, make sure that your audience belongs to the medical or technical fields.
As far as iOS is concerned, the audience who use Apple are found in North America and Europe. They are professionals, managers, and sales experts who tend to be more affluent than Android users.
iOS users have higher education degrees and seek innovative technology. They engage more with mobile devices and make in-app purchases. Thus, if your audience is in North America and Europe, iOS may be your best bet.
If we compare both of these platforms in terms of budget development, iOS would be cheaper than Android. One of the main reasons is the coding language.
Android relies on Java, an open-source language that requires writing more code to develop the app. In contrast, iOS uses its programming language, Swift, to deliver the application.
Swift is more convenient and reliant than Java for creating an app. Thus, it saves developers time and effort to write codes, which leads to less development costs.
Since Android is an open-source platform, it requires more components, tools, and software fragmentation to develop the app that takes a lot of time.
iOS close system allows developers to work on less standardized devices that take less time to create the application. Hence creating an app with the iOS platform is a lot easier to hit the market than the Android one.
It is the dream of each developer to customize the app according to the requirements. The android platform lets developers fulfill this wish by giving them access to hardware and file systems.
Hence, he can add desired features and create unique applications. You can get in touch with an android app development company in India to develop a scintillating application.
In contrast, iOS does not provide developers with access to hardware and such components as it is a more secure system. Thus, you can not get desired features in the app compared to the Android platform.
As per the recent app development report, the iOS platform dominates the market with a 74% share in terms of revenue. The Apple app store generated $46.6 billion in 2019, whereas the Google play store collected $24.8 billion only.
In spite of the fact, Apple has less users and gets fewer app downloads, Apple’s app store brings in more revenue. This is because iOS users are affluent and buy in-app purchases, while Android users are less wealthy and tend to use free apps.
Another reason is iOS users have a higher lifetime value(LTV). That means they like to spend more money inside the apps buying additional content. You can also contact an iOS app development company in India to reap the benefits.
Having discussed the components, now look at the following comparison chart of Android and iOS.
Comparison Points | Android | iOS |
Developer | Android | |
Messaging | Google Hangouts | iMessage |
Internet Version | Google Chrome | Mobile Safari |
Customizability | easy to customize | Limited customizability |
Source | Open source | Closed, with open source components |
Development Language | Java, Kotlin | Objective-C, Swift |
Voice Commands | Google Now, Google Assistant | Siri |
Let’s discuss the pros and cons of each platform.
Indeed, as we discussed, both platforms are the right choice according to their specific features. You can’t ignore one over the other, still based on your audience, budget development, and revenue goal, you can opt for one.
If you are targeting a global audience, you should essentially opt for the Android platform. You can choose the iOS platform if your audience is in the Europe and North America region.
Even after going through several perspectives of both platforms, if you have any confusion, you can clear it by contacting any mobile app development company in India where you will get full support.
#andoid #ios #android app development #ios app development #mobile app development #apps development
1593330480
When I started developing Android apps, I didn’t write any tests. Of course not — I was just mucking about, making things for my own enjoyment. Then, I decided to be a professional. I started small, with the simplest possible app, and the simplest possible test, and was immediately stumped. For anyone in the same boat, this article is for you!
Say you have an activity with a button. When you press the button, you want to open a different activity.
Your source code might look something like this:
class ExampleActivity : AppCompatActivity() {
fun openOtherActivity() {
val intent = Intent(this, OtherActivity::class.java)
startActivity(intent)
}
}
Somewhere, in a layout file, you set the onClick
of a button to openOtherActivity
. But let’s just focus on the Kotlin code. No need to aim too high, right?
Then (or preferably beforehand, if you are diligently applying TDD) you try to write a test. To start with, you might not even check that it behaves as you expect. The simplest possible test is just “When you call the function, nothing explodes.”
It might look something like this:
class ExampleActivityTest {
@Test
fun breaks() {
val exampleActivity = ExampleActivity()
exampleActivity.openOtherActivity()
}
}
Even this very simple test, however, results in an error:
java.lang.RuntimeException: Method startActivity in android.app.Activity not mocked.
This is because in test environments, Android-specific stuff doesn’t exist. This was a deliberate design choice by Android, and it has its pros and cons. One outcome of this decision for unit testing is that we have to mock Android-specific components.
One mocking library for Kotlin is MockK, which I will use for this example. Any other similar mocking library should do the trick.
So, back to our test. We can mock the startActivity
method (and keep everything else as the real thing) using spyk
from MockK:
class ExampleActivityTest {
@Test
fun does_not_break() {
val exampleActivity = spyk(ExampleActivity())
every { exampleActivity.startActivity(any()) } returns Unit
exampleActivity.openOtherActivity()
}
}
And now the test passes!
From there, we could extend the test to more thoroughly check the actual behaviour of the function. For example, whether it calls startActivity
with the right kind of intent.
For the next example, suppose we want to add some extras to the intent before opening the activity:
class ExampleActivity : AppCompatActivity() {
fun openOtherActivityWithExtras() {
val intent = Intent(this, OtherActivity::class.java)
intent.putExtra("name", "value")
startActivity(intent)
}
}
We try running a similar simple test, just checking that nothing explodes:
class ExampleActivityTest {
@Test
fun breaks_again() {
val exampleActivity = spyk(ExampleActivity())
every { exampleActivity.startActivity(any()) } returns Unit
exampleActivity.openOtherActivityWithExtras()
}
}
We’ve used the same mocking trick as last time, but now we get another error:
java.lang.RuntimeException: Method putExtra in android.content.Intent not mocked.
#andoid #dependency-injection #kotlin #programming #mobile #app