Skip to content

Commit

Permalink
feat: main files
Browse files Browse the repository at this point in the history
  • Loading branch information
OldMetalmind committed Oct 5, 2024
1 parent 3f41608 commit 691204b
Show file tree
Hide file tree
Showing 14 changed files with 694 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# 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
macos/Flutter/ephemeral/flutter_export_environment.sh
macos/Flutter/ephemeral/Flutter-Generated.xcconfig
pubspec.lock
macos/Flutter/GeneratedPluginRegistrant.swift
web/favicon.png
web/index.html
web/manifest.json
web/icons/Icon-192.png
web/icons/Icon-512.png
web/icons/Icon-maskable-192.png
web/icons/Icon-maskable-512.png
android/.gitignore
android/build.gradle
android/gradle.properties
android/settings.gradle
android/app/build.gradle
android/app/src/debug/AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
android/app/src/main/kotlin/com/example/flutter_portugal_scheduler/MainActivity.kt
android/app/src/main/res/drawable/launch_background.xml
android/app/src/main/res/drawable-v21/launch_background.xml
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
android/app/src/main/res/values/styles.xml
android/app/src/main/res/values-night/styles.xml
android/app/src/profile/AndroidManifest.xml
android/gradle/wrapper/gradle-wrapper.properties
ios/.gitignore
ios/Flutter/AppFrameworkInfo.plist
ios/Flutter/Debug.xcconfig
ios/Flutter/Release.xcconfig
ios/Runner/AppDelegate.swift
ios/Runner/Info.plist
ios/Runner/Runner-Bridging-Header.h
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]
ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
ios/Runner/Base.lproj/LaunchScreen.storyboard
ios/Runner/Base.lproj/Main.storyboard
ios/Runner.xcodeproj/project.pbxproj
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
ios/Runner.xcworkspace/contents.xcworkspacedata
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
ios/RunnerTests/RunnerTests.swift
39 changes: 39 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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: "2663184aa79047d0a33a14a3b607954f8fdd8730"
channel: "stable"

project_type: app

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

# 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'
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# flutter_portugal_scheduler


This is the root project used in the workshop of Flutter Portugal, a community-driven initiative aimed at teaching and promoting the use of Flutter for building natively compiled applications for mobile, web, and desktop.

The project is an ongoing effort to provide a comprehensive learning resource for individuals looking to get started with Flutter. It contains the source files, configurations, and other essential components necessary for building a Flutter application.

To get started with this project, follow these steps:

1. Clone the repository to your local machine using your preferred version control system.
2. Navigate to the root directory of the project in your terminal or command prompt.
3. Run the command `flutter create .` to set up the project and generate the necessary files and configurations.

Note: Running `flutter create .` will overwrite any existing files in the project directory. Make sure to commit any changes you've made to the project before running this command.

By following these steps, you'll be able to get started with the project and begin exploring the world of Flutter development.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml
19 changes: 19 additions & 0 deletions assets/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"events": [
{
"speaker": "John Doe",
"description": "Introduction to Flutter Development",
"time": "2023-10-01T10:00:00Z"
},
{
"speaker": "Jane Smith",
"description": "Advanced State Management in Flutter",
"time": "2023-10-01T11:30:00Z"
},
{
"speaker": "Alice Johnson",
"description": "Building Responsive UIs with Flutter",
"time": "2023-10-01T13:00:00Z"
}
]
}
17 changes: 17 additions & 0 deletions lib/agenda_controller_cubit.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:bloc/bloc.dart';
import 'package:flutter_portugal_scheduler/agenda_controller_state.dart';
import 'package:flutter_portugal_scheduler/data_repository.dart';

class AgendaControllerCubit extends Cubit<AgendaControllerState> {
final DataRepository _dataRepository;

AgendaControllerCubit({
required DataRepository dataRepository,
}) : _dataRepository = dataRepository,
super(AgendaControllerState(events: null));

Future<void> loadEvents() async {
final events = await _dataRepository.loadEvents();
emit(state.copyWith(events: events));
}
}
11 changes: 11 additions & 0 deletions lib/agenda_controller_state.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:dart_mappable/dart_mappable.dart';
import 'package:flutter_portugal_scheduler/data.dart';

part 'agenda_controller_state.mapper.dart';

@MappableClass()
final class AgendaControllerState with AgendaControllerStateMappable {
final Events? events;

AgendaControllerState({required this.events});
}
123 changes: 123 additions & 0 deletions lib/agenda_controller_state.mapper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member
// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter

part of 'agenda_controller_state.dart';

class AgendaControllerStateMapper
extends ClassMapperBase<AgendaControllerState> {
AgendaControllerStateMapper._();

static AgendaControllerStateMapper? _instance;
static AgendaControllerStateMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = AgendaControllerStateMapper._());
EventsMapper.ensureInitialized();
}
return _instance!;
}

@override
final String id = 'AgendaControllerState';

static Events? _$events(AgendaControllerState v) => v.events;
static const Field<AgendaControllerState, Events> _f$events =
Field('events', _$events);

@override
final MappableFields<AgendaControllerState> fields = const {
#events: _f$events,
};

static AgendaControllerState _instantiate(DecodingData data) {
return AgendaControllerState(events: data.dec(_f$events));
}

@override
final Function instantiate = _instantiate;

static AgendaControllerState fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<AgendaControllerState>(map);
}

static AgendaControllerState fromJson(String json) {
return ensureInitialized().decodeJson<AgendaControllerState>(json);
}
}

mixin AgendaControllerStateMappable {
String toJson() {
return AgendaControllerStateMapper.ensureInitialized()
.encodeJson<AgendaControllerState>(this as AgendaControllerState);
}

Map<String, dynamic> toMap() {
return AgendaControllerStateMapper.ensureInitialized()
.encodeMap<AgendaControllerState>(this as AgendaControllerState);
}

AgendaControllerStateCopyWith<AgendaControllerState, AgendaControllerState,
AgendaControllerState>
get copyWith => _AgendaControllerStateCopyWithImpl(
this as AgendaControllerState, $identity, $identity);
@override
String toString() {
return AgendaControllerStateMapper.ensureInitialized()
.stringifyValue(this as AgendaControllerState);
}

@override
bool operator ==(Object other) {
return AgendaControllerStateMapper.ensureInitialized()
.equalsValue(this as AgendaControllerState, other);
}

@override
int get hashCode {
return AgendaControllerStateMapper.ensureInitialized()
.hashValue(this as AgendaControllerState);
}
}

extension AgendaControllerStateValueCopy<$R, $Out>
on ObjectCopyWith<$R, AgendaControllerState, $Out> {
AgendaControllerStateCopyWith<$R, AgendaControllerState, $Out>
get $asAgendaControllerState =>
$base.as((v, t, t2) => _AgendaControllerStateCopyWithImpl(v, t, t2));
}

abstract class AgendaControllerStateCopyWith<
$R,
$In extends AgendaControllerState,
$Out> implements ClassCopyWith<$R, $In, $Out> {
EventsCopyWith<$R, Events, Events>? get events;
$R call({Events? events});
AgendaControllerStateCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t);
}

class _AgendaControllerStateCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, AgendaControllerState, $Out>
implements AgendaControllerStateCopyWith<$R, AgendaControllerState, $Out> {
_AgendaControllerStateCopyWithImpl(super.value, super.then, super.then2);

@override
late final ClassMapperBase<AgendaControllerState> $mapper =
AgendaControllerStateMapper.ensureInitialized();
@override
EventsCopyWith<$R, Events, Events>? get events =>
$value.events?.copyWith.$chain((v) => call(events: v));
@override
$R call({Object? events = $none}) =>
$apply(FieldCopyWithData({if (events != $none) #events: events}));
@override
AgendaControllerState $make(CopyWithData data) =>
AgendaControllerState(events: data.get(#events, or: $value.events));

@override
AgendaControllerStateCopyWith<$R2, AgendaControllerState, $Out2>
$chain<$R2, $Out2>(Then<$Out2, $R2> t) =>
_AgendaControllerStateCopyWithImpl($value, $cast, t);
}
43 changes: 43 additions & 0 deletions lib/agenda_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_portugal_scheduler/agenda_controller_cubit.dart';
import 'package:flutter_portugal_scheduler/agenda_controller_state.dart';

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

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter Portugal Agenda'),
),
body: const AgendaListView(),
);
}
}

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

@override
Widget build(BuildContext context) {
return BlocBuilder<AgendaControllerCubit, AgendaControllerState>(
builder: (context, state) {
if (state.events == null) {
return const Center(
child: Text('No events'),
);
}
return ListView.builder(
itemCount: state.events!.events.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(state.events!.events[index].speaker),
);
},
);
},
);
}
}
Loading

0 comments on commit 691204b

Please sign in to comment.