Skip to content

Commit

Permalink
feat: add catalyst voices assets pub (#154)
Browse files Browse the repository at this point in the history
* wip

* Update analysis_options.1.0.0.yaml

* feat: update flutter packages

* feat: add CatalystImage

* Update README.md

* Update catalyst_image.dart

* Update project.dic

* add example for catalyst_voices_assets

* update example
  • Loading branch information
minikin authored Nov 20, 2023
1 parent b9f2aff commit e82e3c8
Show file tree
Hide file tree
Showing 48 changed files with 650 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dotglob
drep
dreps
encryptor
gapless
gcloud
genhtml
gmtime
Expand All @@ -50,6 +51,7 @@ netkey
oneshot
openapi
opentelemetry
pbxproj
Pdart
permissionless
pg_isready
Expand All @@ -75,12 +77,14 @@ thiserror
timelike
Traceback
TXNZD
unmanaged
vitss
voteplan
voteplans
xcconfig
xcfilelist
xcodebuild
xcodeproj
xctest
xctestrun
xcworkspace
Expand Down
25 changes: 23 additions & 2 deletions catalyst_voices/lib/dummy/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
import 'package:catalyst_voices/dummy/dummy.dart';
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return const Scaffold(
return Scaffold(
key: WidgetKeys.homeScreen,
body: Center(
child: Text('Catalyst Voices'),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Catalyst Voices',
style: TextStyle(
color: VoicesColors.purpleGradientStart,
fontFamily: VoicesFonts.sFPro,
fontSize: 32,
),
),
const SizedBox(height: 20),
SizedBox(
height: 200,
width: 200,
child: CatalystImage.asset(
VoicesAssets.images.dummyCatalystVoices.path,
),
),
],
),
),
);
}
Expand Down
10 changes: 5 additions & 5 deletions catalyst_voices/lib/dummy/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class _LoginPageState extends State<LoginPage> {
padding: const EdgeInsets.all(16),
child: ElevatedButton(
key: WidgetKeys.loginButton,
onPressed: () => _loginButtonPressed(context),
onPressed: () async => _loginButtonPressed(context),
child: const Text(_Constants.loginButtonText),
),
),
Expand All @@ -87,16 +87,16 @@ final class _LoginPageState extends State<LoginPage> {
passwordTextController = TextEditingController();
}

void _loginButtonPressed(BuildContext context) {
Future<void> _loginButtonPressed(BuildContext context) async {
if (_validateCredentials()) {
_navigateToHomeScreen(context);
await _navigateToHomeScreen(context);
} else {
_showError(context);
}
}

void _navigateToHomeScreen(BuildContext context) {
Navigator.push(
Future<void> _navigateToHomeScreen(BuildContext context) async {
await Navigator.push(
context,
MaterialPageRoute<HomeScreen>(
builder: (context) => const HomeScreen(),
Expand Down
4 changes: 2 additions & 2 deletions catalyst_voices/lib/main_development.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:catalyst_voices/app/app.dart';
import 'package:catalyst_voices/bootstrap.dart';

void main() {
bootstrap(() => const App());
void main() async {
await bootstrap(() => const App());
}
4 changes: 2 additions & 2 deletions catalyst_voices/lib/main_production.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:catalyst_voices/app/app.dart';
import 'package:catalyst_voices/bootstrap.dart';

void main() {
bootstrap(() => const App());
void main() async {
await bootstrap(() => const App());
}
4 changes: 2 additions & 2 deletions catalyst_voices/lib/main_staging.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:catalyst_voices/app/app.dart';
import 'package:catalyst_voices/bootstrap.dart';

void main() {
bootstrap(() => const App());
void main() async {
await bootstrap(() => const App());
}
Empty file removed catalyst_voices/packages/.gitkeep
Empty file.
43 changes: 43 additions & 0 deletions catalyst_voices/packages/catalyst_voices_assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

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

# VSCode related
.vscode/

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

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Test related
coverage
5 changes: 5 additions & 0 deletions catalyst_voices/packages/catalyst_voices_assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Catalyst Voices Assets

```sh
dart run build_runner build
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="dark_background ">#000000</color>
<color name="purple">#512DA8</color>
<color name="purple_gradient_start">#673AB7</color>
<color name="purple_gradient_stop">#512DA8</color>
<color name="dark_card">#222126</color>
<color name="green">#7CAE7A</color>
<color name="red">#B02E0C</color>
<color name="today">#565656</color>
</resources>
Binary file not shown.
Binary file not shown.
43 changes: 43 additions & 0 deletions catalyst_voices/packages/catalyst_voices_assets/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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
.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
30 changes: 30 additions & 0 deletions catalyst_voices/packages/catalyst_voices_assets/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 and should not be manually edited.

version:
revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: web
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a

# 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'
47 changes: 47 additions & 0 deletions catalyst_voices/packages/catalyst_voices_assets/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Catalyst Voices Assets Example

This is an example of how to use the Catalyst Voices Assets package.

## Usage

```dart
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:flutter/material.dart';
void main() => runApp(Example());
final class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Catalyst Assets',
style: TextStyle(
color: VoicesColors.purpleGradientStart,
fontFamily: VoicesFonts.sFPro,
fontSize: 32,
),
),
const SizedBox(height: 20),
SizedBox(
height: 200,
width: 200,
child: CatalystImage.asset(
VoicesAssets.images.dummyCatalystVoices.path,
),
),
],
),
),
),
);
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:flutter/material.dart';

void main() => runApp(Example());

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

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Catalyst Assets',
style: TextStyle(
color: VoicesColors.purpleGradientStart,
fontFamily: VoicesFonts.sFPro,
fontSize: 32,
),
),
const SizedBox(height: 20),
SizedBox(
height: 200,
width: 200,
child: CatalystImage.asset(
VoicesAssets.images.dummyCatalystVoices.path,
),
),
],
),
),
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: catalyst_voices_assets_example
description: A Catalyst Voices Assets Example.
version: 0.1.0+1
publish_to: none

environment:
sdk: ">=3.2.0 <4.0.0"
flutter: 3.16.0

dependencies:
catalyst_voices_assets:
path: ../
flutter:
sdk: flutter

flutter:
uses-material-design: true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e82e3c8

Please sign in to comment.