flutster 1.1.1 copy "flutster: ^1.1.1" to clipboard
flutster: ^1.1.1 copied to clipboard

PlatformAndroid

Record your Flutter UI tests using this Widget on Android. Save the UI tests to play them again automatically.

example/lib/main.dart

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

import 'flutster_navigator.dart';

void main() {
  const flutsterKey = String.fromEnvironment("flutsterKey");
  const flutsterUser = String.fromEnvironment("flutsterUser");
  const flutsterUrl = String.fromEnvironment("flutsterUrl");
  if (flutsterKey.isNotEmpty &&
      flutsterUser.isNotEmpty &&
      flutsterUrl.isNotEmpty) {
    FlutsterTestRecord.defaultRecord.apiUrl = flutsterUrl;
    FlutsterTestRecord.defaultRecord.apiUser = flutsterUser;
    FlutsterTestRecord.defaultRecord.apiKey = flutsterKey;
  } else {
    FlutsterTestRecord.defaultRecord.apiUrl = "https://flutster.com";
    FlutsterTestRecord.defaultRecord.apiUser = "YOUR FLUTSTER USER";
    FlutsterTestRecord.defaultRecord.apiKey = "YOUR FLUTSTER API KEY";
  }
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutster Recorder Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const SafeArea(
        child: MyHomePage(title: 'Flutster Recorder Example Home Page'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool color = false;

  @override
  Widget build(BuildContext context) {
    return FlutsterScaffold(
      name: "exampleFlutsterTestRecorder",
      appBar: AppBar(
        title: Row(
          children: [
            Expanded(
                child: Text(widget.title, overflow: TextOverflow.ellipsis)),
            IconButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) => const FlutsterNavigator()),
                  );
                },
                icon: const Icon(Icons.web))
          ],
        ),
      ),
      body: SingleChildScrollView(
        scrollDirection: Axis.vertical,
        child: Column(
          children: [
            Card(
              color: color ? Colors.yellow : Colors.white,
              child: IconButton(
                icon: const Icon(Icons.add_reaction),
                onPressed: () {
                  setState(() {
                    color = !color;
                  });
                },
              ),
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
            TextFormField(
              initialValue: "test",
              onChanged: (value) {},
            ),
          ],
        ),
      ),
    );
  }
}
7
likes
160
points
230
downloads

Publisher

verified publisherjod.li

Weekly Downloads

Record your Flutter UI tests using this Widget on Android. Save the UI tests to play them again automatically.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

archive, cross_file, flutter, flutter_test, http, image_compare_2, intl, share_plus

More

Packages that depend on flutster