Skip to content

Commit

Permalink
Merge pull request #19 from Avila-Tek/FCL-SendDataBloc
Browse files Browse the repository at this point in the history
feat: SendDataBloc
  • Loading branch information
andrespd99 authored Apr 10, 2024
2 parents afa8403 + 85ad28d commit 19728ad
Show file tree
Hide file tree
Showing 17 changed files with 975 additions and 353 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ SPEC CHECKSUMS:
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f

PODFILE CHECKSUM: d080214342236ffc72197a414adc2a47f117f9dc

COCOAPODS: 1.14.2
COCOAPODS: 1.15.2
289 changes: 129 additions & 160 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:example/pages/adaptive_dialog/adaptive_dialog_example.dart';
import 'package:example/pages/avila_snackbar/avila_snackar_example_page.dart';
import 'package:example/pages/constants_showcase/constants_showcase_page.dart';
import 'package:example/pages/custom_loading_indicator/custom_loading_indicator_example.dart';
import 'package:example/pages/custom_tag/custom_tags_page.dart';
import 'package:example/pages/developed_by_logo/developed_by_logo_example.dart';
import 'package:example/pages/field_with_title/title_wrapper_example_page.dart';
import 'package:example/pages/file_uploader/file_uploader_page.dart';
Expand All @@ -11,8 +12,29 @@ import 'package:example/pages/permission_handler_example_page.dart';
import 'package:example/pages/remote_data/remote_data_fetch_example_page.dart';
import 'package:example/pages/remote_data_paginated/view/rainbow_page.dart';
import 'package:example/pages/selector_sheet/selector_sheet_example_page.dart';
import 'package:example/pages/send_data/send_data_page.dart';
import 'package:flutter/material.dart';

class ExampleMenuItem {
const ExampleMenuItem({
required this.title,
required this.child,
});

final String title;
final Widget child;
}

class ExampleMenuCategory {
const ExampleMenuCategory({
required this.title,
required this.children,
});

final String title;
final List<ExampleMenuItem> children;
}

void main() {
runApp(const MyApp());
}
Expand All @@ -27,6 +49,12 @@ class MyApp extends StatelessWidget {
titleWrapperStyle: TitleWrapperStyle(),
selectorButtonStyle: SelectorButtonStyle(),
avilaSnackBarTheme: AvilaSnackBarTheme(),
customTagStyle: CustomTagStyle(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
),
);

return MaterialApp(
Expand Down Expand Up @@ -75,6 +103,75 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
final widgetItems = const [
ExampleMenuItem(
title: 'Title Wrapper Example',
child: TitleWrapperExample(),
),
ExampleMenuItem(
title: 'Adaptive dialog',
child: AdaptiveDialogExample(),
),
ExampleMenuItem(
title: 'Developed By Logo',
child: DevelopedByLogoExample(),
),
ExampleMenuItem(
title: 'Avila Snackbar Example',
child: AvilaSnackbarExamplePage(),
),
ExampleMenuItem(
title: 'Selector Sheet Example',
child: SelectorSheetExamplePage(),
),
ExampleMenuItem(
title: 'Custom Loading Indicator Example',
child: CustomLoadingIndicatorExample(),
),
ExampleMenuItem(
title: 'Custom Tags Example',
child: CustomTagsPage(),
),
];
final blocItems = const [
ExampleMenuItem(
title: 'Remote Data Fetch Bloc Example',
child: RemoteDataFetchExamplePage(),
),
ExampleMenuItem(
title: 'Permission Handler Bloc Example',
child: PermissionHandlerExamplePage(),
),
ExampleMenuItem(
title: 'Pending Notifications Bloc Example',
child: PendingNotificationsExamplePage(),
),
ExampleMenuItem(
title: 'Paged Remote Data Bloc Example',
child: RainbowPage(),
),
ExampleMenuItem(
title: 'Upload File Bloc Example',
child: FileUploaderPage(),
),
ExampleMenuItem(
title: 'Send Data Bloc',
child: SendDataPage(),
),
];
final otherItems = const [
ExampleMenuItem(
title: 'Constants Showcase',
child: ConstantsShowcasePage(),
),
];

late final categories = [
ExampleMenuCategory(title: 'Blocs', children: blocItems),
ExampleMenuCategory(title: 'Widgets', children: widgetItems),
ExampleMenuCategory(title: 'Others', children: otherItems),
];

@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
Expand All @@ -96,167 +193,39 @@ class _MyHomePageState extends State<MyHomePage> {
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
//
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
// action in the IDE, or press "p" in the console), to see the
// wireframe for each widget.
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const PermissionHandlerExamplePage(),
),
);
},
child: const Text('Permission Handler Bloc Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RemoteDataFetchExamplePage(),
),
);
},
child: const Text('Remote Data Fetch Bloc Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const TitleWrapperExample(),
),
);
},
child: const Text('Title Wrapper Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AdaptiveDialogExample(),
),
);
},
child: const Text('Adaptive dialog'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DevelopedByLogoExample(),
),
);
},
child: const Text('Developed By Logo'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AvilaSnackbarExamplePage(),
),
);
},
child: const Text('Avila Snackbar Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const PendingNotificationsExamplePage(),
),
);
},
child: const Text('Pending Notifications Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SelectorSheetExamplePage(),
),
);
},
child: const Text('Selector Sheet Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CustomLoadingIndicatorExample(),
),
);
},
child: const Text('Custom Loading Indicator Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ConstantsShowcasePage(),
),
);
},
child: const Text('Constants Showcase'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RainbowPage(),
),
);
},
child: const Text('Paged Remote Data Bloc Example'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const FileUploaderPage(),
child: ListView.separated(
itemCount: categories.length,
padding: const EdgeInsets.all(24),
itemBuilder: (context, index) {
final category = categories[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
category.title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 12),
ListView.separated(
shrinkWrap: true,
itemCount: category.children.length,
itemBuilder: (context, index) => ListTile(
title: Text(category.children[index].title),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => category.children[index].child,
),
);
},
),
);
},
child: const Text('Upload File Bloc Example'),
),
],
separatorBuilder: (_, __) => const Divider(height: 0),
),
],
);
},
separatorBuilder: (_, __) => const SizedBox(height: 24),
),
),
);
Expand Down
49 changes: 49 additions & 0 deletions example/lib/pages/custom_tag/custom_tags_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:avilatek_ui/avilatek_ui.dart';
import 'package:flutter/material.dart';

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Custom Tags'),
),
body: Align(
alignment: Alignment.center,
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
children: [
CustomTag.primaryOne(
context,
child: const Text('Primary color tag'),
),
const SizedBox(height: 16),
CustomTag.green(
context,
child: const Text('Green tag'),
),
const SizedBox(height: 16),
CustomTag.yellow(
context,
child: const Text('Yellow tag'),
),
const SizedBox(height: 16),
CustomTag.red(
context,
child: const Text('Red tag'),
),
const SizedBox(height: 16),
CustomTag.grey(
context,
child: const Text('Neutral tag'),
),
],
),
),
),
);
}
}
Loading

0 comments on commit 19728ad

Please sign in to comment.