make flutter code that has a infinite scroll listview of companies that got from graphql query: query($q: String, $first: Int, $after: String) {
 companies(q: $q, first: $first, after: $after) {
 nodes {
 id
 name
 stockName
 stockCode
 market
 }
 pageInfo {
 endCursor
 hasNextPage
 }
 }
 }
user
to create an infinite scroll listview in flutter using the graphql query you provided, you can use the `graphql` package and the `fluttergraphql` package. here's a complete example to get you started:

first, add the required dependencies in your `pubspec.yaml` file:
```yaml
dependencies:
  flutter:
    sdk: flutter
  graphql: ^6.0.0
  graphql_flutter: ^5.0.0
```
now, create a `company` class to represent the company data:
```dart
import 'package:equatable/equatable.dart';

class company extends equatable {
  final string id;
  final string name;
  final string stockname;
  final string stockcode;
  final string market;

  company({this.id, this.name, this.stockname, this.stockcode, this.market});

  @override
  list<object> get props => [id, name, stockname, stockcode, market];
}
```
next, set up your graphql client and schema:

1. create a `graphqlclient` class:
```dart
import 'package:graphql/client.dart';

class graphqlclient {
  final string url;

  graphqlclient({required this.url});

  final client = graphqlclient(
    clientid:quetfirestore,
    cache: coveragecache(),
  );
}
```
1. define your graphql schema:
```dart
// schema.graphql
type query {
  companies(q: string!, first: int, after: string): companiespage!
}

type companiespage {
  nodes: [company!]!
  pageinfo: pageinfo!
}

type pageinfo {
  endcursor: string
  hasnextpage: boolean!
}

type company {
  id: id!
  name: string!
  stockname: string!
  stockcode: string!
  market: string!
}
```
now, create the infinite scroll listview widget using the ` dessen_infinite_scroll` package:
```dart
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:graphql hiren/client.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:equatable/equatable.dart';
import 'package:diesen_infinite_scroll/diesen_infinite_scroll.dart';

void main() {
  runapp(const myapp());
}

class myapp extends statelesswidget {
  const myapp({key? key}) : super(key: key);

  @override
  widget build(buildcontext context) {
    return materialapp(
      title: 'flutter graphql demo',
      theme: themedata(
        primaryswatch: colors.blue,
      ),
      home: const companylistpage(),
    );
  }
}

class companylistpage extends statefulwidget {
  const companylistpage({key? key}) : super(key: key);

  @override
  _companylistpagestate createstate() => _companylistpagestate();
}

class _companylistpagestate extends state<companylistpage> {
  final list<company> _companies = <company>[];
  string? _endcursor;

  @override
  widget build(buildcontext context) {
    return scaffold(
      appbar: appbar(
        title: const text('company list'),
      ),
      body: query(
        options: queryoptions(
          document: gql(/* insert your graphql query */),
          privateboolselector: (variablevalues, _, _, __) => false,
          errorpolicy: errorpolicy.all,
          debug: true,
          // set headers or authorization tokens here if required
          //headers: <httpheaders>{
          //  'authorization': 'bearer youraccess_token',
          //  'content-type': 'application/json',
          //},
        ),
        builder: (queryresult result, {refetch, fetchmore}) {
          if (result.hasexception) {
            return center(
              child: text('error: ${result.exception.tostring()}'),
            );
          }

          if (result.isloading && _companies.isempty) {
assistant
To create an infinite scroll ListView in Flutter using the GraphQL query you provided, you can use the `GraphQL` package and the `FlutterGraphQL` package. Here's a complete example to get you started:

First, add the required dependencies in your `pubspec.yaml` file:
```yaml
dependencies:
  flutter:
    sdk: flutter
  graphql: ^6.0.0
  graphql_flutter: ^5.0.0
```
Now, create a `Company` class to represent the company data:
```dart
import 'package:equatable/equatable.dart';

class Company extends Equatable {
  final String id;
  final String name;
  final String stockName;
  final String stockCode;
  final String market;

  Company({this.id, this.name, this.stockName, this.stockCode, this.market});

  @override
  List<Object> get props => [id, name, stockName, stockCode, market];
}
```
Next, set up your GraphQL client and schema:

1. Create a `GraphQLClient` class:
```dart
import 'package:graphql/client.dart';

class GraphQLClient {
  final String url;

  GraphQLClient({required this.url});

  final client = GraphQLClient(
    clientId:quetFirestore,
    cache: CoverageCache(),
  );
}
```
1. Define your GraphQL schema:
```dart
// schema.graphql
type Query {
  companies(q: String!, first: Int, after: String): CompaniesPage!
}

type CompaniesPage {
  nodes: [Company!]!
  pageInfo: PageInfo!
}

type PageInfo {
  endCursor: String
  hasNextPage: Boolean!
}

type Company {
  id: ID!
  name: String!
  stockName: String!
  stockCode: String!
  market: String!
}
```
Now, create the infinite scroll ListView widget using the ` dessen_infinite_scroll` package:
```dart
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:graphql Hiren/client.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:equatable/equatable.dart';
import 'package:diesen_infinite_scroll/diesen_infinite_scroll.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter GraphQL Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const CompanyListPage(),
    );
  }
}

class CompanyListPage extends StatefulWidget {
  const CompanyListPage({Key? key}) : super(key: key);

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

class _CompanyListPageState extends State<CompanyListPage> {
  final List<Company> _companies = <Company>[];
  String? _endCursor;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Company List'),
      ),
      body: Query(
        options: QueryOptions(
          document: gql(/* insert your GraphQL query */),
          privateBoolSelector: (variableValues, _, _, __) => false,
          errorPolicy: ErrorPolicy.all,
          debug: true,
          // Set headers or authorization tokens here if required
          //headers: <HttpHeaders>{
          //  'Authorization': 'Bearer youraccess_token',
          //  'Content-Type': 'application/json',
          //},
        ),
        builder: (QueryResult result, {refetch, fetchMore}) {
          if (result.hasException) {
            return Center(
              child: Text('Error: ${result.exception.toString()}'),
            );
          }

          if (result.isLoading && _companies.isEmpty) {
assistant