Skip to content

Commit

Permalink
Merge pull request #2 from caio-deiro/feature/project_changes
Browse files Browse the repository at this point in the history
project changes into main
  • Loading branch information
caio-deiro authored Jun 7, 2023
2 parents 85f9eb5 + bbe35e4 commit e327aa4
Show file tree
Hide file tree
Showing 15 changed files with 205 additions and 155 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/ci.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "dev debug",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"program": "lib/main_dev.dart",
"args": [
"--flavor",
"dev",
]
},

{
"name": "prod debug",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"args": [
"--flavor",
"prod",
]
},

{
"name": "prod release",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": [
"--flavor",
"prod",
]
}
]
}
19 changes: 19 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ android {
signingConfig signingConfigs.debug
}
}

flavorDimensions "default"

productFlavors {
dev {
dimension "default"
resValue "string", "app_name", "devflavor"
applicationIdSuffix ".dev"
}

prod {
dimension "default"
resValue "string", "app_name", "flavor"
applicationIdSuffix ""
}
}



}

flutter {
Expand Down
18 changes: 18 additions & 0 deletions lib/main_dev.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:app_miscelanea/src/app_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'src/shared/service/theme_service.dart';

void main() {
runApp(
MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => ThemeService(),
),
],
child: AppWidget(),
),
);
}
50 changes: 23 additions & 27 deletions lib/src/pages/repos_page/repos_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,34 @@ class _RepoPageState extends State<RepoPage> {
child: controller.loading == true
? Center(child: CircularProgressIndicator())
: ListView.separated(
separatorBuilder: (context, _) => Divider(),
separatorBuilder: (context, _) => Divider(
height: 25,
thickness: 2,
color: Theme.of(context).highlightColor,
),
itemCount: controller.repoList.length,
itemBuilder: (context, index) {
var gitRepos = controller.repoList[index];
return Container(
height: 80,
width: double.infinity,
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(5),
return ListTile(
title: Text(
gitRepos.name ?? '',
style: Theme.of(context).textTheme.displayMedium,
),
leading: CircleAvatar(
backgroundImage:
AssetImage('assets/images/profile.jpg'),
),
child: ListTile(
title: Text(
gitRepos.name ?? '',
style: Theme.of(context).textTheme.displayMedium,
),
leading: CircleAvatar(
backgroundImage:
AssetImage('assets/images/profile.jpg'),
),
trailing: Text(gitRepos.language ?? ''),
subtitle: Text(
gitRepos.description ?? '',
style: Theme.of(context).textTheme.bodyMedium,
),
onTap: () {
launchUrl(
Uri.parse(gitRepos.html_url ?? ''),
mode: LaunchMode.externalApplication,
);
},
trailing: Text(gitRepos.language ?? ''),
subtitle: Text(
gitRepos.description ?? '',
style: Theme.of(context).textTheme.bodyMedium,
),
onTap: () {
launchUrl(
Uri.parse(gitRepos.html_url ?? ''),
mode: LaunchMode.externalApplication,
);
},
);
})),
);
Expand Down
12 changes: 7 additions & 5 deletions lib/src/pages/splash/splash_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:flutter/material.dart';

class SplashPage extends StatefulWidget {
Expand All @@ -19,11 +21,11 @@ class _SplashPageState extends State<SplashPage>
controller =
AnimationController(vsync: this, duration: Duration(seconds: 2));

Future.delayed(const Duration(seconds: 3)).then(
(_) {
Navigator.of(context).pushReplacementNamed('/profile');
},
);
Timer.periodic(Duration(seconds: 2), (timer) {
timer.cancel();
Navigator.of(context).pushReplacementNamed('/profile');
});

final curve = CurvedAnimation(parent: controller, curve: Curves.bounceIn);
animationPadding = Tween<double>(begin: 0, end: 250).animate(curve)
..addListener(() {
Expand Down
102 changes: 38 additions & 64 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
name: app_miscelanea
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
publish_to: 'none'
version: 1.0.0+1

environment:
sdk: ">=2.17.1 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.






dependencies:

mockito: ^5.4.0
Expand All @@ -35,20 +21,18 @@ dependencies:
sdk: flutter
flutter_launcher_icons: ^0.13.1


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
url_launcher: ^6.1.10
dio: ^5.1.1
http_mock_adapter: ^0.4.4
nock: ^1.2.2


flutter_launcher_icons:
image_path_android: 'assets/icons/app_icon.png'
android: true
min_sdk_android: 21
adaptive_icon_background: #ffffff
adaptive_icon_background:

dev_dependencies:

Expand All @@ -57,52 +41,42 @@ dev_dependencies:
flutter_test:
sdk: flutter

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec


# The following section is specific to Flutter packages.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
- assets/icons/
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages



























File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions test/pages/splash/splash_page_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:app_miscelanea/src/pages/profile/profile_routes.dart';
import 'package:app_miscelanea/src/pages/splash/splash_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('should load image', (tester) async {
await tester.pumpWidget(MaterialApp(
routes: <String, WidgetBuilder>{
...splashRoute,
...devPageRoute,
},
));
await tester.pumpAndSettle(Duration(seconds: 2));
final Finder imageFind = find.byType(Image).first;
expect(imageFind, findsOneWidget);
});
}
Loading

0 comments on commit e327aa4

Please sign in to comment.