Skip to content

Commit

Permalink
cleanuo and upgrade project & add custom_carousel example
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianojung committed Apr 27, 2024
1 parent 058d939 commit 469298b
Show file tree
Hide file tree
Showing 17 changed files with 559 additions and 101 deletions.
Binary file added assets/flutter_packages_logo_grey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
40 changes: 26 additions & 14 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:package_examples/service/MyTheme.dart';
import 'package:package_examples/service/route_generator.dart';
Expand All @@ -19,16 +20,27 @@ class MyApp extends StatelessWidget {
final themeProvider = Provider.of<ThemeProvider>(context);

return MaterialApp(
scrollBehavior: AppScrollBehavior(),
debugShowCheckedModeBanner: false,
themeMode: themeProvider.themeMode,
theme: MyTheme.lightTheme,
darkTheme: MyTheme.darkTheme,
onGenerateRoute: RouteGenerator.generateRoute,
initialRoute: '/',
initialRoute: '/flutter_custom_carousel',
);
});
}

// Create a subclass of ScrollBehavior that enables scrolling via mouse drag.
class AppScrollBehavior extends ScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices {
final devices = Set<PointerDeviceKind>.from(super.dragDevices);
devices.add(PointerDeviceKind.mouse);
return devices;
}
}

class HomeView extends StatefulWidget {
@override
_HomeViewState createState() => _HomeViewState();
Expand All @@ -39,17 +51,19 @@ class _HomeViewState extends State<HomeView> {

List<CustomListTile> listTileList = <CustomListTile>[
CustomListTile(
Icons.email_outlined, 'Email Validator', '2.0.1', '/email_validator', 0),
Icons.email_outlined, 'Email Validator', '2.1.17', '/email_validator', 0),
CustomListTile(Icons.facebook, 'Flutter Signin Button', '2.0.0',
'/flutter_signin_button', 1),
CustomListTile(Icons.view_agenda_outlined, 'Convex BottomAppBar', '3.0.0',
CustomListTile(Icons.view_agenda_outlined, 'Convex BottomAppBar', '3.2.0',
'/convex_bottom_bar', 2),
CustomListTile(
Icons.calendar_today, 'Date Format', '2.0.4', '/date_format', 3),
CustomListTile(Icons.launch, 'Url Launcher', '6.0.17', '/url_launcher', 4),
Icons.calendar_today, 'Date Format', '2.0.7', '/date_format', 3),
CustomListTile(Icons.launch, 'Url Launcher', '6.2.6', '/url_launcher', 4),
CustomListTile(
Icons.font_download_outlined, 'Google Fonts', '2.2.0', '/google_fonts', 5),
CustomListTile(Icons.lock_outline, 'Crypto', '3.0.1', '/crypto', 6),
Icons.font_download_outlined, 'Google Fonts', '6.2.1', '/google_fonts', 5),
CustomListTile(Icons.lock_outline, 'Crypto', '3.0.3', '/crypto', 6),
//CustomListTile(Icons.search, 'Widget Decompiler', '0.9.1', '/widget_decompiler', 7),
CustomListTile(Icons.view_carousel, 'Flutter Custom Carousel', '0.1.0+1', '/flutter_custom_carousel', 8),
];

@override
Expand Down Expand Up @@ -104,7 +118,7 @@ class _HomeViewState extends State<HomeView> {
subtitle: Text('...'),
onTap: () {
setState(() {
_launchUrl('https://lucianojung.medium.com/');
_launchUrl(Uri.parse('https://lucianojung.medium.com/'));
});
},
),
Expand All @@ -115,11 +129,9 @@ class _HomeViewState extends State<HomeView> {
);
}

Future<void> _launchUrl(String url) async {
if (await canLaunch(url)) {
launch(url);
} else {
throw 'Could not launch $url';
Future<void> _launchUrl(Uri _url) async {
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}

Expand Down
1 change: 0 additions & 1 deletion lib/packages/convex_bottom_bar/convex_bottom_bar_main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:convex_bottom_bar/convex_bottom_bar.dart';
import 'package:package_examples/shared/appbar.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/packages/crypto/crypto_main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';

import 'package:crypto/crypto.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:package_examples/shared/appbar.dart';
import 'package:package_examples/shared/package_weblink_view.dart';
Expand Down
Loading

0 comments on commit 469298b

Please sign in to comment.