flutter pod install is not installing anything

my podfile looks like this

        # Uncomment the next line to define a global platform for your project
    # platform :ios, '9.0'

    target 'Runner' do
        # Comment the next line if you don't want to use dynamic frameworks
        use_frameworks!
    
        # Pods for Runner
    
    end

If I run pod install, it shows

        MDs-MacBook-Pro:ios mdzainalabedin$ pod install
    Analyzing dependencies
    Downloading dependencies
    Generating Pods project
    Integrating client project
    Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

    (!) The Podfile does not contain any dependencies.

    (!) Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

    (!) CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

    (!) Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.
    MDs-MacBook-Pro:ios mdzainalabedin$ 

  

Any idea how can I generate one?

Thanks

flutter – Como acessar o valor alterado de uma variável de outra classe?

Eu tenho duas classes, classe da tela inicial do meu app (HomeScreen) e a classe do meu botão (Button).

Eu tenho essa função na classe do meu botão:

bool variável = false;

void alterarValor() {
  setState((){
    variável = !variável;
  })
}

Depois de alterar o valor dessa variável na minha classe do botão, como eu passo o valor dela em tempo real para minha classe da tela inicial?

Porque mesmo executando a função, o valor não altera na classe da tela inicial, ele fica no valor inicial da variável.

O que eu faço? kkkkkkkkkk

Estou realmente estagnado nisso :/

Agradeço desde já!

android – Correr aplicación Flutter con VS

Estaba haciendo mi aplicación de lo mas normal, hasta que volví a correr la aplicación en mi dispositivo virtual, siempre doy click a Run / Start Debugging y el programa automáticamente corre en el dispositivo virtual. Para este caso una vez le di a Start Debuggin, me abrió una serie de opciones, y ninguna corre en mi dispositivo virtual. No es la primera vez que me pasa, que esta sucediendo realmente y como puedo arreglarlo ?

Imagen: cuando le doy a correr

Imagen: Y ahora me salen estas opciones como si no detectara el dispositivo virtual:

flutter – i want to display events for table calendar from firestore

TableCalendar(
locale: ‘fr_FR’,
events: _events,
weekendDays: (DateTime.friday, DateTime.saturday),
initialCalendarFormat: CalendarFormat.week,
headerStyle: HeaderStyle(
formatButtonShowsNext: false,
centerHeaderTitle: true,
formatButtonDecoration: BoxDecoration(
color: Colors.teal,
borderRadius: BorderRadius.circular(20.0),
),
formatButtonTextStyle: TextStyle(color: Colors.white),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekdayStyle: TextStyle(
color: Colors.black, fontWeight: FontWeight.bold),
weekendStyle: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold)),
calendarStyle: CalendarStyle(
todayColor: Colors.teal(300),
selectedColor: Colors.teal(600),
),
calendarController: calendarController,
)

flutter não roda nem a pu no VSCODE

migrei do win7 para o win10… agora nada faz meu flutter abrir no VSCODE , no Android Estudio consegui iniciar um projeto novo, mas tbm não consegui abrir 2 outros projetos que eu ja tinha…. da mais de 300 erros, parece que não reconhece os packcages e imports, e não consigo abrir no VSCODE, e como eu não tenho tanta facilidade no Android Studio gostaria de saber se há alguma orientação para que volte a funcionar no VSCODE, desde já agradeço

Call Index into AlertDialog flutter

Hello guys I need to call a Index into buld method where my AlertDialog widget is because I need to call the Users Chat for a specific user.
this is my code and how to get index?

class InfluencerDescription extends StatefulWidget {
  final User user;

  InfluencerDescription({this.user});


  @override
  _InfluencerDescriptionState createState() => _InfluencerDescriptionState();
}

class _InfluencerDescriptionState extends State<InfluencerDescription> {
  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      elevation: 20,
      content: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>(
          Expanded(
            child: SizedBox(
            ),
          ),
          CircleAvatar(
            backgroundImage: AssetImage(
                'assets/images/background_circle.gif'),
            .....................


dart – Compare two values and achieve verification in flutter

  void _QrVerification() {
    if (_currentAddress == qrText) {
      print("DOGRU YAPTIM ");
    } else {
      print("HATA YAPTIM");
    }
  }

My problem is that ;

I am able to get current address via geolocator. Here I am trying to scan barcode which shows number 07600 for example. Current address postal code which ı get from gelocator is also 07600

I want to compare such both current address and scanned code. If both are same, page will be route to verification success page if not will give me error

How I can I do this?

Flutter take up all remaining space and scroll

I have same question as Make TabBarView take up all remaining space , So I Put TabBarView inside Expanded widget to fix error

In small devices, My view overflowed and I need to Column in a SingleChildScrollView but I stopped with RenderFlex children have non-zero flex but incoming height constraints are unbounded. error

How it is possible to have both TabBarView and scrollable page?

oop – Am I implementing this Cubit incorrectly into the BottomNavigationBar Flutter?

I’m learning the BloC pattern and trying to use a Cubit in the BottomNavigationBar but it’s not working properly. I see the state changing in the console when I press another tab but nothing changes… Not sure what I’m doing wrong here.

home page code below

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:fitgress/authentication/authentication.dart';
import 'package:fitgress/home/bloc/bottom_navigation_cubit.dart';

class HomePage extends StatelessWidget {

  static Route route() {
    return MaterialPageRoute<void>(builder: (_) => HomePage());
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: BlocProvider(
          create: (context) => BottomNavigationCubit(),
          child: Home(),
        ),
      ),
    );
  }
}

class Home extends StatelessWidget {

  static const TextStyle optionStyle =
  TextStyle(fontSize: 30, fontWeight: FontWeight.bold);

  static const List<Widget> _widgetOptions = <Widget>(
    Text(
      'Index 0: Home',
      style: optionStyle,
    ),
    Text(
      'Index 1: Business',
      style: optionStyle,
    ),
    Text(
      'Index 2: School',
      style: optionStyle,
    ),
    Text(
      'Index 3: Business',
      style: optionStyle,
    ),
    Text(
      'Index 4: School',
      style: optionStyle,
    ),
  );


  @override
  Widget build(BuildContext context) {

    final authenticationBloc = context.bloc<AuthenticationBloc>();
    final bottomNavigationCubit = BottomNavigationCubit();

    return Scaffold(
      appBar: AppBar(
        title: Center(
            child: Text('Fitgress')
        ),
        backgroundColor: Colors.white,
        actions: <Widget>(
          IconButton(
            key: const Key('homePage_logout_iconButton'),
            icon: const Icon(Icons.settings),
            onPressed: () => authenticationBloc.add(AuthenticationLogoutRequested()),
          )
        ),
      ),

      backgroundColor: Colors.white,

      body: BlocBuilder<BottomNavigationCubit, int> (
        buildWhen: (previous, current) => previous != current,
        builder: (BuildContext context, int currentIndex) {
          return Center(
              child: _widgetOptions.elementAt(currentIndex)
          );
        },
      ),

      bottomNavigationBar: BlocBuilder<BottomNavigationCubit, int>(
          buildWhen: (previous, current) => previous != current,
          builder: (BuildContext context, int currentIndex) {
            return BottomNavigationBar(
              items: (
                BottomNavigationBarItem(
                    icon: Icon(Icons.home_outlined, color: Colors.black),
                    label: 'Home',
                    backgroundColor: Colors.white
                ),

                BottomNavigationBarItem(
                  icon: Icon(Icons.analytics_outlined, color: Colors.black),
                  label: 'Analytic',
                ),

                BottomNavigationBarItem(
                  icon: Icon(Icons.search, color: Colors.black),
                  label: 'Search',
                ),

                BottomNavigationBarItem(
                  icon: Icon(Icons.build_circle_outlined, color: Colors.black),
                  label: 'Home',
                ),

                BottomNavigationBarItem(
                  icon: Icon(Icons.account_circle_outlined, color: Colors.black),
                  label: 'User',
                ),
              ),
              currentIndex: currentIndex,
              selectedItemColor: Colors.blue,
              onTap: (index) => bottomNavigationCubit.onTapped(index),
            );
          }
      ),
    );
  }
}

I wrote a simple cubit below that would emit a new state whenever the tab is tapped. From my understanding, the BlocProviders would rebuild the widget based on the new state that’s emitted.

Cubit code

import 'package:bloc/bloc.dart';

class BottomNavigationCubit extends Cubit<int> {
  BottomNavigationCubit() : super(0);

  void onTapped(int index) => emit(index);

  @override
  void onChange(Change<int> change) {
    print(change);
  }

}

json – Error: Unhandled Exception: type ‘_InternalLinkedHashMap’ is not a subtype of type ‘int’ in Flutter

Olá, tudo bem?
Estou ainda aprendendo flutter e estou tendo um problema ao autenticar o usuário. Mesmo recebendo como response status 200, não consigo navegar para a página autorizada.
Será que alguém pode me ajudar?

Desde já agradeço

Tela de Login:

import 'package:celer_pesquisa_app/constantes.dart';
import 'package:celer_pesquisa_app/services/login_api.dart';
import 'package:celer_pesquisa_app/telas/recuperar_senha_tela.dart';
import 'package:celer_pesquisa_app/telas/iniciar_quiz_tela.dart';
import 'package:celer_pesquisa_app/utilidades/alert.dart';
import 'package:flutter/material.dart';

class LoginTela extends StatefulWidget {
  static const String id = 'login_tela';

  @override
  _LoginTelaState createState() => _LoginTelaState();
}

class _LoginTelaState extends State<LoginTela> {
  String email;
  String password;
  final _ctrlLogin = TextEditingController();
  final _ctrlSenha = TextEditingController();
  final _formKey = GlobalKey<FormState>();

  _textFormField(
    String label,
    String hint, {
    bool senha = false,
    TextEditingController controller,
    FormFieldValidator<String> validator,
  }) {
    return TextFormField(
      style: kTextCorEscuro,
      controller: controller,
      validator: validator,
      obscureText: senha,
      decoration: InputDecoration(
          labelText: label,
          labelStyle: TextStyle(
            color: kButtonCor2,
          ),
          hintText: hint,
          contentPadding:
              EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
          border: OutlineInputBorder(
            borderRadius: BorderRadius.all(Radius.circular(32.0)),
          ),
          enabledBorder: OutlineInputBorder(
            borderSide: BorderSide(color: kButtonCor1, width: 1.0),
            borderRadius: BorderRadius.all(Radius.circular(32.0)),
          ),
          focusedBorder: OutlineInputBorder(
            borderSide: BorderSide(color: kButtonCor1, width: 2.0),
            borderRadius: BorderRadius.all(Radius.circular(32.0)),
          )),
    );
  }

  String _validaLogin(String texto) {
    if (texto.isEmpty) {
      return 'Digite o email';
    }
    if (texto.length < 3) {
      return 'Email muito curto, insira novamente!';
    }
    return null;
  }

  String _validaSenha(String texto) {
    if (texto.isEmpty) {
      return "Digite o senha";
    }
    return null;
  }

  void _clickButton(BuildContext context) async {
    bool formOk = _formKey.currentState.validate();

    if (!formOk) {
      return;
    }

    String login = _ctrlLogin.text;
    String senha = _ctrlSenha.text;

    print('login: $login senha: $senha');

    var user = await LoginApi.login(login, senha);

    if (user != null) {
      //print('==> $user');
      _navegaQuizStart(context);
    } else {
      alert(context, "Login Inválido!");
    }
  }

  _navegaQuizStart(BuildContext context) {
    Navigator.pushNamed(context, IniciarQuiz.id);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        leading: FlatButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: Icon(
            Icons.arrow_back_ios,
            size: 50.0,
            color: kButtonCor2,
          ),
        ),
      ),
      backgroundColor: Colors.white,
      body: Form(
        key: _formKey,
        child: ListView(children: (
          Padding(
            padding: EdgeInsets.symmetric(horizontal: 24.0),
            child: SafeArea(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>(
                  SizedBox(
                    height: 48.0,
                  ),
                  _textFormField('Login', 'Digite o email',
                      controller: _ctrlLogin, validator: _validaLogin),
                  SizedBox(
                    height: 8.0,
                  ),
                  _textFormField('Senha', 'Digite a senha',
                      senha: true,
                      controller: _ctrlSenha,
                      validator: _validaSenha),
                  SizedBox(
                    height: 24.0,
                  ),
                  Padding(
                    padding: EdgeInsets.symmetric(vertical: 16.0),
                    child: Material(
                      color: kButtonCor1,
                      borderRadius: BorderRadius.all(Radius.circular(30.0)),
                      elevation: 5.0,
                      child: MaterialButton(
                        onPressed: () {
                          _clickButton(context);
                        },
                        minWidth: 200.0,
                        height: 42.0,
                        child: Text(
                          'Entrar',
                          style: kTextCorClaro,
                        ),
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.symmetric(vertical: 16.0),
                    child: Material(
                      color: kButtonCor2,
                      borderRadius: BorderRadius.circular(30.0),
                      elevation: 5.0,
                      child: MaterialButton(
                        onPressed: () {
                          Navigator.pushNamed(context, RecuperarSenhaTela.id);
                        },
                        minWidth: 200.0,
                        height: 42.0,
                        child: Text(
                          'Esqueci a Senha',
                          style: kTextCorClaro,
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        )),
      ),
    );
  }
}

Login-api

import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:celer_pesquisa_app/services/user_info.dart';

class LoginApi {
  static Future<UserInfo> login(String username, String password) async {
    final baseUrl = 'https://iopoc.celer.ind.br:8080/api/v1/';

    var url = '$baseUrl/auth/user/login/';

    //Content-Type
    var header = {
      "Content-Type": "application/json",
      "Authorization": "Token <TOKEN>"
    };
    //Body
    Map params = {"username": username, "password": password};

    var userInfo;

    
    var _body = json.encode(params);

    var response = await http.post(url, headers: header, body: _body);

    print('Response status: ${response.statusCode}');
    //print('Response body: ${response.body}');

    Map mapResponse = json.decode(response.body);
    if (response.statusCode == 200)

      userInfo = UserInfo.fromJson(mapResponse);
    } else {
      userInfo = null;
    }
    return userInfo;
  }
}

Model

class UserInfo {
  UserInfo({
    this.user,
    this.token,
  });

  User user;
  String token;

  factory UserInfo.fromRawJson(String str) =>
      UserInfo.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory UserInfo.fromJson(Map<String, dynamic> json) => UserInfo(
        user: User.fromJson(json("user")),
        token: json("token"),
      );

  Map<String, dynamic> toJson() => {
        "user": user.toJson(),
        "token": token,
      };

  String toString() {
    return 'User(token: $token, user: $user )';
  }
}

class User {
  User({
    this.id,
    this.fullName,
    this.email,
    this.profile,
    this.phones,
    this.company,
    this.tads,
    this.createDate,
    this.createUser,
    this.lastUpdateDate,
    this.lastUpdateUser,
    this.isActive,
  });

  int id;
  String fullName;
  String email;
  String profile;
  List<Phone> phones;
  Company company;
  List<dynamic> tads;
  DateTime createDate;
  AteUser createUser;
  DateTime lastUpdateDate;
  AteUser lastUpdateUser;
  bool isActive;

  factory User.fromRawJson(String str) => User.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory User.fromJson(Map<String, dynamic> json) => User(
        id: json("id"),
        fullName: json("fullName"),
        email: json("email"),
        profile: json("profile"),
        phones: List<Phone>.from(json("phones").map((x) => Phone.fromJson(x))),
        company: Company.fromJson(json("company")),
        tads: List<dynamic>.from(json("tads").map((x) => x)),
        createDate: DateTime.parse(json("createDate")),
        createUser: AteUser.fromJson(json("createUser")),
        lastUpdateDate: DateTime.parse(json("lastUpdateDate")),
        lastUpdateUser: AteUser.fromJson(json("lastUpdateUser")),
        isActive: json("isActive"),
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "fullName": fullName,
        "email": email,
        "profile": profile,
        "phones": List<dynamic>.from(phones.map((x) => x.toJson())),
        "company": company.toJson(),
        "tads": List<dynamic>.from(tads.map((x) => x)),
        "createDate": createDate.toIso8601String(),
        "createUser": createUser.toJson(),
        "lastUpdateDate": lastUpdateDate.toIso8601String(),
        "lastUpdateUser": lastUpdateUser.toJson(),
        "isActive": isActive,
      };
}

class Company {
  Company({
    this.id,
    this.name,
    this.cnpj,
    this.email,
    this.responsibleName,
    this.responsibleEmail,
    this.responsiblePhone,
    this.street,
    this.number,
    this.complement,
    this.neighborhood,
    this.city,
    this.state,
    this.country,
    this.zipcode,
    this.phones,
    this.branch,
    this.createDate,
    this.createUser,
    this.lastUpdateDate,
    this.lastUpdateUser,
    this.isActive,
  });

  int id;
  String name;
  String cnpj;
  String email;
  String responsibleName;
  String responsibleEmail;
  String responsiblePhone;
  dynamic street;
  dynamic number;
  dynamic complement;
  dynamic neighborhood;
  dynamic city;
  dynamic state;
  dynamic country;
  dynamic zipcode;
  List<dynamic> phones;
  dynamic branch;
  DateTime createDate;
  AteUser createUser;
  DateTime lastUpdateDate;
  AteUser lastUpdateUser;
  bool isActive;

  factory Company.fromRawJson(String str) => Company.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory Company.fromJson(Map<String, dynamic> json) => Company(
        id: json("id"),
        name: json("name"),
        cnpj: json("cnpj"),
        email: json("email"),
        responsibleName: json("responsibleName"),
        responsibleEmail: json("responsibleEmail"),
        responsiblePhone: json("responsiblePhone"),
        street: json("street"),
        number: json("number"),
        complement: json("complement"),
        neighborhood: json("neighborhood"),
        city: json("city"),
        state: json("state"),
        country: json("country"),
        zipcode: json("zipcode"),
        phones: List<dynamic>.from(json("phones").map((x) => x)),
        branch: json("branch"),
        createDate: DateTime.parse(json("createDate")),
        createUser: AteUser.fromJson(json("createUser")),
        lastUpdateDate: DateTime.parse(json("lastUpdateDate")),
        lastUpdateUser: AteUser.fromJson(json("lastUpdateUser")),
        isActive: json("isActive"),
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "name": name,
        "cnpj": cnpj,
        "email": email,
        "responsibleName": responsibleName,
        "responsibleEmail": responsibleEmail,
        "responsiblePhone": responsiblePhone,
        "street": street,
        "number": number,
        "complement": complement,
        "neighborhood": neighborhood,
        "city": city,
        "state": state,
        "country": country,
        "zipcode": zipcode,
        "phones": List<dynamic>.from(phones.map((x) => x)),
        "branch": branch,
        "createDate": createDate.toIso8601String(),
        "createUser": createUser.toJson(),
        "lastUpdateDate": lastUpdateDate.toIso8601String(),
        "lastUpdateUser": lastUpdateUser.toJson(),
        "isActive": isActive,
      };
}

class AteUser {
  AteUser({
    this.id,
    this.createDate,
    this.lastUpdateDate,
    this.isActive,
    this.fullName,
    this.profile,
    this.createUser,
    this.lastUpdateUser,
    this.user,
    this.company,
    this.tads,
    this.email,
  });

  int id;
  DateTime createDate;
  DateTime lastUpdateDate;
  bool isActive;
  String fullName;
  String profile;
  int createUser;
  int lastUpdateUser;
  int user;
  int company;
  List<dynamic> tads;
  String email;

  factory AteUser.fromRawJson(String str) => AteUser.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory AteUser.fromJson(Map<String, dynamic> json) => AteUser(
        id: json("id"),
        createDate: DateTime.parse(json("createDate")),
        lastUpdateDate: DateTime.parse(json("lastUpdateDate")),
        isActive: json("isActive"),
        fullName: json("fullName"),
        profile: json("profile"),
        createUser: json("createUser"),
        lastUpdateUser: json("lastUpdateUser"),
        user: json("user"),
        company: json("company") == null ? null : json("company"),
        tads: List<dynamic>.from(json("tads").map((x) => x)),
        email: json("email") == null ? null : json("email"),
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "createDate": createDate.toIso8601String(),
        "lastUpdateDate": lastUpdateDate.toIso8601String(),
        "isActive": isActive,
        "fullName": fullName,
        "profile": profile,
        "createUser": createUser,
        "lastUpdateUser": lastUpdateUser,
        "user": user,
        "company": company == null ? null : company,
        "tads": List<dynamic>.from(tads.map((x) => x)),
        "email": email == null ? null : email,
      };
}

class Phone {
  Phone({
    this.phone,
    this.description,
  });

  String phone;
  String description;

  factory Phone.fromRawJson(String str) => Phone.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory Phone.fromJson(Map<String, dynamic> json) => Phone(
        phone: json("phone"),
        description: json("description"),
      );

  Map<String, dynamic> toJson() => {
        "phone": phone,
        "description": description,
      };
}

Print do json: json estrutura
Print do erro:erro