Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
176 changes: 76 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,96 @@
# The Bitcoin UI Kit for Flutter
<h1 align="center"><a href="https://pub.dev/packages/bitcoin_ui_kit">Bitcoin UI Kit Flutter Package</a></h1>

This is the Flutter implementation of the [Bitcoin UI Kit](https://www.bitcoinuikit.com).
<img src="https://www.bitcoinuikit.com/assets/screens.png" alt="bitcoin_ui_kit package" />

## Getting started
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Add the package in your pubspec.yaml dependencies
Bitcoin UI Kit is a comprehensive Flutter package that provides a collection of beautifully designed UI components and themes for building Bitcoin-related applications. It offers a design foundation for prototypes, concept explorations, and open-source projects, allowing you to kickstart the design process and focus on creating unique Bitcoin products.

```dart
dependencies:
bitcoin_ui_kit: : ^1.0.3
```

## Usage

Import in the dart file where you want to use it

```dart
import 'package:bitcoin_ui_kit/bitcoin_ui_kit.dart';
```

## Colors

```dart
// Light primary and accent colors
Bitcoin.orange
Bitcoin.red
Bitcoin.green
Bitcoin.blue
Bitcoin.purple

// Light theme neutrals
Bitcoin.white
Bitcoin.neutral1
Bitcoin.neutral2
Bitcoin.neutral3
Bitcoin.neutral4
Bitcoin.neutral5
Bitcoin.neutral6
Bitcoin.neutral7
Bitcoin.neutral8
Bitcoin.black
```
## Features
- **Design System**: Bitcoin UI Kit offers a carefully crafted design system that includes a set of predefined colors, typography styles, and components tailored for Bitcoin-themed applications.
- **Reusable Components**: The UI kit provides a collection of reusable and customizable components such as buttons, divider, switches, avatars, pin entry, and more. These components are designed to seamlessly integrate into your Flutter projects.
- **Dynamic Theming**: Bitcoin UI Kit supports dynamic theming, allowing you to effortlessly switch between light and dark themes based on the user's preference or app configuration.

![image](https://github.com/bdgwallet/bitcoinuikit-flutter/assets/3393669/dd843296-6336-4920-b9e6-93dae58f4697)
## Installation
To use Bitcoin UI Kit in your Flutter project, add the following dependency to your `pubspec.yaml` file:

```dart
// Dark primary and accent colors
Bitcoin.orangeDark
Bitcoin.redDark
Bitcoin.greenDark
Bitcoin.blueDark
Bitcoin.purpleDark

// Dark theme neutrals
Bitcoin.neutral1Dark
Bitcoin.neutral2Dark
Bitcoin.neutral3Dark
Bitcoin.neutral4Dark
Bitcoin.neutral5Dark
Bitcoin.neutral6Dark
Bitcoin.neutral7Dark
Bitcoin.neutral8Dark
```yaml
dependencies:
bitcoin_ui_kit: ^1.0.3
```

![image](https://github.com/bdgwallet/bitcoinuikit-flutter/assets/3393669/65d5a45a-67cb-4972-bfde-b2f21f62a822)

## Text styles

There are five title styles and five body styles, each with a color parameter.
Then, run `flutter pub get` to fetch the package.

## Usage
Import the Bitcoin UI Kit package wherever you want to use its components:
```dart
// Title styles
BitcoinTextStyle.title1(Bitcoin.black)
BitcoinTextStyle.title2(Bitcoin.black)
BitcoinTextStyle.title3(Bitcoin.black)
BitcoinTextStyle.title4(Bitcoin.black)
BitcoinTextStyle.title5(Bitcoin.black)

// Body styles
BitcoinTextStyle.body1(Bitcoin.black)
BitcoinTextStyle.body2(Bitcoin.black)
BitcoinTextStyle.body3(Bitcoin.black)
BitcoinTextStyle.body4(Bitcoin.black)
BitcoinTextStyle.body5(Bitcoin.black)
import 'package:bitcoin_ui_kit/bitcoin_ui_kit.dart';
```

## Buttons

There are three styles of buttons in the UI Kit

- BitcoinButtonFilled
- BitcoinButtonOutlined
- BitcoinButtonPlain

They each have optional parameters like, textStyle, width, height, tintColor, textColor (for BitcoinButtonFilled), cornerRadius and the ability to set disabled and isLoading states.
You can then utilize the various UI components provided by the package, such as `BitcoinElevatedButton`, `BitcoinOutlinedButton`, `BitcoinSwitch`, and more. Refer to the code examples in the package for more details on using each component effectively.

## Example Usage
```dart
BitcoinButtonFilled(
title: "Filled",
onPressed: () {
debugPrint("Test button press");
import 'package:bitcoin_ui_kit/bitcoin_ui_kit.dart';
import 'package:flutter/material.dart';

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

class MainApp extends StatelessWidget {
final _lightTheme = LightBitcoinThemeData();
final _darkTheme = DarkBitcoinThemeData();

MainApp({super.key});

@override
Widget build(BuildContext context) {
return BitcoinTheme(
lightTheme: _lightTheme,
darkTheme: _darkTheme,
child: MaterialApp(
theme: _lightTheme.materialThemeData,
darkTheme: _darkTheme.materialThemeData,
// TODO: change to dark mode
themeMode: ThemeMode.light,
home: const BitcoinHomePage(),
),
);
}
}

class BitcoinHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Bitcoin UI Kit Demo'),
),
body: Center(
child: BitcoinElevatedButton(
label: 'Create a new wallet',
onPressed: () {},
backgroundColor: BitcoinColors.orange,
fontSize: 21,
height: 60,
textPadding: const EdgeInsets.symmetric(vertical: 19, horizontal: 20,
),
),
),
);
}
),
}
```

## Icons
## Showcase
Visit the [Storybook](https://aniketambore.github.io/bitcoinuikit-flutter/) to see a showcase of the widgets.

Most of the icons from [Bitcoin Icons](https://github.com/BitcoinDesign/Bitcoin-Icons) are included.

```dart
Image(
image: const AssetImage("icons/bitcoin_circle.png",
package: "bitcoin_ui_kit"),
color: Bitcoin.orange),
```
## Contributing
Bitcoin UI Kit is an open-source project, and contributions are welcome! If you find a bug, have a feature request, or want to contribute improvements, please submit an issue or a pull request in the GitHub repository.

## Additional information
## License
This project is licensed under the MIT License.

Find out more at [Bitcoin UI Kit](https://www.bitcoinuikit.com)
## Credits
Bitcoin UI Kit Flutter Package is inspired by the design principles and aesthetics of the [Bitcoin UI Kit](https://www.bitcoinuikit.com/).
44 changes: 44 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
45 changes: 45 additions & 0 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: android
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: ios
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: linux
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: macos
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: web
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: windows
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
3 changes: 3 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example

A new Flutter project.
1 change: 1 addition & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml
13 changes: 13 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
71 changes: 71 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
8 changes: 8 additions & 0 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Loading