google_analystic_charts 0.0.1 copy "google_analystic_charts: ^0.0.1" to clipboard
google_analystic_charts: ^0.0.1 copied to clipboard

Plugin Flutter para exibir Google Charts (gráficos do Google) em Android, iOS, macOS e Web, ideal para dados do Google Analytics (GA4) vindos do seu backend.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:google_analystic_charts/google_analystic_charts.dart';

void main() => runApp(const DemoApp());

class DemoApp extends StatelessWidget {
  const DemoApp({super.key});

  @override
  Widget build(BuildContext context) {
    final data = <List<Object?>>[
      ['Dia', 'Usuários'],
      ['Seg', 1200],
      ['Ter', 1350],
      ['Qua', 1280],
      ['Qui', 1600],
      ['Sex', 1900],
      ['Sáb', 900],
      ['Dom', 700],
    ];

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Google Analytics Charts - Demo')),
        body: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(
            children: [
              Expanded(
                child: Card(
                  clipBehavior: Clip.antiAlias,
                  child: GaChart(
                    type: GaChartType.line,
                    data: data,
                    options: const {
                      'legend': {'position': 'bottom'},
                      'curveType': 'function',
                    },
                    backgroundColor: Colors.white,
                    borderRadius: const BorderRadius.all(Radius.circular(8)),
                  ),
                ),
              ),
              const SizedBox(height: 12),
              Expanded(
                child: Card(
                  clipBehavior: Clip.antiAlias,
                  child: GaChart(
                    type: GaChartType.pie,
                    data: const [
                      ['Canal', 'Usuários'],
                      ['Orgânico', 3200],
                      ['Direto', 2100],
                      ['Social', 900],
                      ['Pago', 700],
                    ],
                    options: const {
                      'legend': {'position': 'right'},
                    },
                    backgroundColor: Colors.white,
                    borderRadius: const BorderRadius.all(Radius.circular(8)),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
60
points
22
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Plugin Flutter para exibir Google Charts (gráficos do Google) em Android, iOS, macOS e Web, ideal para dados do Google Analytics (GA4) vindos do seu backend.

Homepage

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, http, js, plugin_platform_interface, web, webview_flutter

More

Packages that depend on google_analystic_charts

Packages that implement google_analystic_charts