flutter_gemma 0.2.1 copy "flutter_gemma: ^0.2.1" to clipboard
flutter_gemma: ^0.2.1 copied to clipboard

The plugin allows running the Gemma AI model locally on a device from a Flutter application.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_gemma/flutter_gemma.dart';
import 'package:flutter_gemma_example/chat_screen.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterGemmaPlugin.instance.init(
    maxTokens: 512,
    temperature: 1.0,
    topK: 1,
    randomSeed: 1,
  );
  runApp(const ChatApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Gemma Example',
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        textTheme: const TextTheme(
          bodyLarge: TextStyle(color: Colors.white),
          bodyMedium: TextStyle(color: Colors.white),
        ),
      ),
      themeMode: ThemeMode.dark,
      home: const SafeArea(child: ChatScreen()),
    );
  }
}
49
likes
120
pub points
76%
popularity

Publisher

verified publishermobilepeople.dev

The plugin allows running the Gemma AI model locally on a device from a Flutter application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, js, plugin_platform_interface

More

Packages that depend on flutter_gemma