git_info 1.0.2 copy "git_info: ^1.0.2" to clipboard
git_info: ^1.0.2 copied to clipboard

outdated

Reads information about the local git repository to show in app

example/lib/main.dart

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

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

// This will not work unless you create a git repo in the example folder
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('git_info_example'),
        ),
        body: FutureBuilder<GitInformation>(
          future: GitInfo.get(),
          builder: (context, snapshot) {
            if (snapshot.hasData) {
              return Center(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text('Branch: ${snapshot.data!.branch}'),
                    Text('Hash: ${snapshot.data!.hash}'),
                  ],
                ),
              );
            } else {
              return SizedBox.shrink();
            }
          },
        ),
      ),
    );
  }
}
4
likes
0
pub points
76%
popularity

Publisher

verified publisherrexios.dev

Reads information about the local git repository to show in app

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on git_info