Flutter available camera returns null - android

I'm using the flutter camera plugin to record a video but the code keeps throwing:
The method '[]' was called on null.
Receiver: null
Tried calling: [](0)
when I try to get the first camera (cameras.first or cameras[0]). This is happening even with the examples given in the plugin docs: https://pub.dev/packages/camera/example
Here's my pubspec.yaml:
# #format
name: camera_example
description: A camera example app
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
archive: ^3.1.2
bloc: ^7.0.0
cached_network_image: ^3.1.0
cupertino_icons: ^1.0.3
dio: null
equatable: ^2.0.3
eva_icons_flutter: ^3.0.0
flutter:
sdk: flutter
flutter_bloc: ^7.1.0
flutter_secure_storage: ^4.2.1
flutter_svg: ^0.22.0
font_awesome_flutter: ^8.8.1
http: ^0.13.3
image_picker: ^0.8.2
introduction_screen: ^2.1.0
line_icons: null
logger: null
path_provider: ^2.0.2
provider: ^5.0.0
rxdart: ^0.27.1
shared_preferences: ^2.0.6
video_player: ^2.1.10
camera:
# path: ./
carousel_slider: ^4.0.0
marquee: ^2.2.0
responsive_builder: ^0.4.1
page_indicator: ^0.4.1
path: ^1.8.0
permission_handler:
dev_dependencies:
flutter_launcher_icons: ^0.9.0
flutter_native_splash: ^1.2.0
flutter_native_splash:
color: "#000000"
image: "assets/images/bg.png"
android: true
ios: true
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/videos/
- assets/
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: TikTokIcons
fonts:
- asset: assets/fonts/TikTokIcons.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
I believe I have done everything according to the documentation but I keep on getting the error. I am testing on a real android(android 10) device.
The example code I'm referring to:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
List<CameraDescription> cameras;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
cameras = await availableCameras();
runApp(CameraApp());
}
class CameraApp extends StatefulWidget {
#override
_CameraAppState createState() => _CameraAppState();
}
class _CameraAppState extends State<CameraApp> {
CameraController controller;
#override
void initState() {
super.initState();
controller = CameraController(cameras[0], ResolutionPreset.max);
controller.initialize().then((_) {
if (!mounted) {
return;
}
setState(() {});
});
}
#override
void dispose() {
controller?.dispose();
super.dispose();
}
#override
Widget build(BuildContext context) {
if (!controller.value.isInitialized) {
return Container();
}
return MaterialApp(
home: CameraPreview(controller),
);
}
}
PS: I'm new to flutter

Related

Error when running flutter pub get command

I would like to ask for help, I've searched all the answers here in the community and I can't solve my error.
I had to update a personal project to Android sdk 32, but when I try to run the Flutter pub get command I'm having an SDK version error, I'm leaving the pub spec and the error image below.
Error Picture Here
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.17.0 <3.0.0"
dependencies:
dio: ^4.0.0
rxdart: ^0.27.1
bloc_pattern: ^3.0.0
flutter_launcher_icons: ^0.10.0
flutter_translate: ^4.0.3
flutter_localizations:
sdk: flutter
equatable: any
json_annotation: any
freezed_annotation: any
webview_flutter: ^3.0.4
flutter_cache_manager: ^3.3.0
upgrader: ^4.6.1
video_thumbnail: ^0.5.3
## Animation rive
#rive: ^0.7.22
# Native
package_info_plus: ^1.0.3
geolocator: ^9.0.2
path_provider: ^2.0.2
file_picker: ^4.1.6
open_file: ^3.2.1
url_launcher: ^6.0.8
shared_preferences: ^2.0.6
qr_code_scanner: ^1.0.1
cross_file: ^0.3.2
camera: ^0.10.0+3
# Layout
introduction_screen: ^3.0.2
font_awesome_flutter: ^10.1.0
select_form_field: "^2.1.0"
#mask_text_input_formatter: ^2.0.0
another_flushbar: ^1.10.24
flutter_switch: ^0.3.2
flutter_app_badger: ^1.2.0
image_picker: ^0.8.5+3
flutter_neat_and_clean_calendar: ^0.3.8+22
date_utils: ^0.2.0
date_format: ^2.0.2
#flutter_form_builder: ^6.0.1
date_time_picker: ^2.1.0
flutter_rating_bar: ^4.0.0
signature: ^5.2.1
flutter_simple_treeview: ^3.0.0-nullsafety.1
widget_to_image: ^2.0.0
flutter_email_sender: ^5.0.2
in_app_review: ^2.0.2
flutter_typeahead: ^4.1.1
brasil_fields: ^1.5.0
grouped_list: ^5.1.2
mat_month_picker_dialog: ^1.0.1
# Videos Acesso Cameras
video_viewer: ^1.2.6
fijkplayer: ^0.10.1
# Conteudo html
flutter_html: ^3.0.0-alpha.5
## FIREBASE
firebase_core: ^1.13.1
firebase_messaging: ^13.0.3
flutter_local_notifications: ^11.0.1
## Share Social
share: ^2.0.4
flutter:
sdk: flutter
json_serializable: any
build_runner: any
freezed: any
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
dev_dependencies:
mockito: ^5.0.10
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_icons:
android: "ic_launcher"
ios: true
image_path: "assets/icon/icon.png"
adaptive_icon_background: "assets/icon/icon.png"
adaptive_icon_foreground: "assets/icon/icon.png"
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/img/
- assets/i18n/
- assets/animation/loading.riv
- assets/json/paises.json
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages```
replace your sdk with
sdk: ">=2.15.1 <3.0.0"
I managed to solve this problem, I uninstalled flutter on the mac and installed it again, I think the mac was cached.

Flutter: Google Icons not Appearing

I created a flutter project and when I tried to add an icon using icons.[icon here] it didn't show up even though uses-material-design: true in the pubspec
Code of Icon
import 'package:flutter/material.dart';
import 'package:search_choices/search_choices.dart';
class DonateFood extends StatefulWidget {
const DonateFood({Key? key}) : super(key: key);
#override
_DonorOtherState createState() => _DonorOtherState();
}
class _DonorOtherState extends State<DonateFood> {
#override
Widget build(BuildContext context) {
String dropdownValue = 'Food Type';
return Scaffold(
body: Container(
child: const Center(
child: Icon(
Icons.six_mp_sharp,
size: 100,
),
),
),
);
}
}
Pubspec.yaml
name: feedme
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_core: "^1.10.0"
firebase_performance: "^0.7.1"
firebase_database: ^7.2.1
firebase_auth: ^3.0.1
font_awesome_flutter: ^9.1.0
flutter_facebook_auth: ^3.5.0+1
google_sign_in: ^5.0.0
cloud_firestore: ^2.4.0
google_fonts: ^2.1.0
flutter_neumorphic: ^3.1.0
auto_size_text: ^3.0.0-nullsafety.0
splashscreen: ^1.3.5
flutter_google_places: ^0.3.0
places_service: ^0.1.0+2
provider: ^6.0.1
http: ^0.13.3
geolocator: ^7.7.1
google_maps_flutter: ^2.0.9
top_snackbar_flutter: ^1.0.2
firebase_storage: ^10.1.0
search_choices: ^2.0.14
dev_dependencies:
flutter_test:
sdk: flutter
lint: ^1.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
fonts:
- family: rHeavy
fonts:
- asset: Fonts/SF-Pro-Rounded-Heavy.otf
- family: rRegular
fonts:
- asset: Fonts/SF-Pro-Rounded-Regular.otf
- family: rBold
fonts:
- asset: Fonts/SF-Pro-Rounded-Bold.otf
- family: rLight
fonts:
- asset: Fonts/SF-Pro-Rounded-Light.otf
- family: rSemibold
fonts:
- asset: Fonts/SF-Pro-Rounded-Semibold.otf
- family: tMedium
fonts:
- asset: Fonts/SF-Pro-Text-Medium.otf
- family: tSemibold
fonts:
- asset: Fonts/SF-Pro-Text-Semibold.otf
- family: tRegular
fonts:
- asset: Fonts/SF-Pro-Text-Regular.otf
- family: dMedium
fonts:
- asset: Fonts/SF-Pro-Display-Medium.otf
assets:
- Images/

I am trying to add a png image but it is not loading?

I am trying to make an app where in by pressing the flat Button the image should change
This is my Code .Here the image is not able to load .It is throwing some exception despite my
pubspec.yaml file being correct.Can someone help me out.I am trying to use a random function inside my flat button to update my images on pressed.
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
runApp(Magic());
}
class Magic extends StatefulWidget {
const Magic({Key? key}) : super(key: key);
#override
_MagicState createState() => _MagicState();
}
class _MagicState extends State<Magic> {
var i=1;
#override
Widget build(BuildContext context) {
return MaterialApp(
home:Scaffold(
backgroundColor:Colors.blue,
appBar: AppBar(
centerTitle: true,
title:Text( 'Ask Me Anything',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.blue[900],
),
body: Container(
child:FlatButton(
onPressed: () {
setState(() {
i = Random().nextInt(5)+1;
});
},
child:Image(
image:AssetImage('images/dice$i.png'),
)
),
),
)
);
}
}
My Pubspec.yaml file
name: magicball
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
assets:
- images/ball1.png
- images/ball2.png
- images/ball3.png
- images/ball4.png
- images/ball5.png
- images/dice1.png
- images/dice2.png
- images/dice3.png
- images/dice4.png
- images/dice5.png
- images/dice6.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
This is the error
The following assertion was thrown resolving an image codec:
Unable to load asset: images/dice4.png
When the exception was thrown, this was the stack:
#0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:224:7)
<asynchronous suspension>
#1 AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:672:14)
<asynchronous suspension>
Image provider: AssetImage(bundle: null, name: "images/dice4.png")
Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#70fe4(), name: "images/dice4.png", scale: 1.0)
====================================================================================================
create an assets folder and put the images folder there.
and change the path to - assets/images/ball1.png. or you can just put the reference of the folder there.

Execution failed for task ':google_sign_in:verifyReleaseResources'. Flutter google sign in

I have created an app with flutter and firebase and i am trying to create the build apk. but i get error when running flutter build apk. i think it is because my google sign in is not setup for release.
Execution failed for task ':google_sign_in:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
E:\Mobile App evelopment\
Fiverr\pet_walker\build\google_sign_in\intermediates\res\merged\
release\values\values.xml:314: error: resource android:attr/fontVariationSettings not found.
I have signed android apk but i have not got sha-1 production certificate for flutter. someone please guide me how to setup google sign in for production
here is the pubspec.yaml file
name: pet_walker
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
firebase_auth: ^0.15.0+1
cloud_firestore: ^0.13.7
provider: ^4.3.1
flutter_spinkit: "^4.1.2"
flutter_facebook_login: ^3.0.0
google_sign_in: ^3.2.4
after_layout: ^1.0.7+2
firebase_storage: ^3.1.6
image_picker: ^0.6.7+4
uuid: 2.2.0
cached_network_image: ^2.2.0+1
popup_menu: ^1.0.5
google_maps_flutter: ^0.5.28+1
geolocator: ^5.3.2+2
latlong: ^0.6.1
carousel_slider: ^2.2.1
geocoder: ^0.2.1
geoflutterfire: ^2.1.0
firebase_core: ^0.4.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

Why is Flutter import provider package not working?

So following this tutorial for a simple login UI in Flutter
https://medium.com/better-programming/simple-firebase-login-flow-in-flutter-6f44c2b5c58a
Apparently this package in flutter isn't being imported correctly. The particular lines that are not working are these 3 lines of code
import 'package:provider/provider.dart';
ChangeNotifierProvider<AuthService>( //TODO: authservices and provider pages
future: Provider.of<AuthService>(context).getUser(),
I have been searching a bunch and tried reading the docs and couldn't get any easy answers, but anyway thank you to anyone who gets me the answer to this
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'home_page.dart';
import 'auth.dart';
import 'login_page.dart';
void main() => runApp(
ChangeNotifierProvider<AuthService>( //TODO: authservices and provider pages
child: MyApp(),
builder: (BuildContext context) {
return AuthService();
},
),
);
class MyApp extends StatelessWidget {
// This widget is the root of your application.
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: FutureBuilder(
future: Provider.of<AuthService>(context).getUser(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return snapshot.hasData ? HomePage() : LoginPage();
} else {
return Container(color: Colors.white);
}
},
),
);
}
}
the pubspec.yaml file for anyone looking
name: login_flutter_app
description: A new Flutter application.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Had to put these into the project
cupertino_icons: ^0.1.2
flutter_blue: ^0.6.3+1
provider: ^4.0.4
Just add dependency provider: ^4.1.1 in pubspec.yaml file. it looks like bellow
dependencies:
flutter:
sdk: flutter
provider: ^4.1.1

Categories

Resources