diff --git a/lib/enums/api_call_state.dart b/lib/enums/api_call_state.dart new file mode 100644 index 0000000..ccf39fc --- /dev/null +++ b/lib/enums/api_call_state.dart @@ -0,0 +1,6 @@ +enum ApiCallState { + idle, + loading, + success, + error, +} diff --git a/lib/pages/home/page/home_v2.dart b/lib/pages/home/page/home_v2.dart index c29c596..d53707d 100644 --- a/lib/pages/home/page/home_v2.dart +++ b/lib/pages/home/page/home_v2.dart @@ -7,6 +7,7 @@ import 'package:clashbot_flutter/pages/errorPages/whoops_page.dart'; import 'package:clashbot_flutter/pages/home/page/widgets/calendar_widget.dart'; import 'package:clashbot_flutter/pages/home/page/widgets/events_widget.dart'; import 'package:clashbot_flutter/pages/home/page/widgets/server_chip_list.dart'; +import 'package:clashbot_flutter/stores/application_details.store.dart'; import 'package:clashbot_flutter/stores/discord_details.store.dart'; import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; @@ -94,66 +95,74 @@ class _HomeV2State extends State { ClashStore clashStore = context.read(); DiscordDetailsStore discordDetailsStore = context.read(); - ErrorHandlerStore errorHandlerStore = context.read(); + ApplicationDetailsStore applicationDetailsStore = + context.read(); return Scaffold( - body: Observer( - builder: (_) => errorHandlerStore.irreconcilable - ? const WhoopsPage() - : LayoutBuilder( - builder: (context, constraints) { - if (constraints.maxWidth > 500) { - return Row( - children: [ - Flexible( - flex: 1, - child: Flex(direction: Axis.vertical, children: [ - const ServerChipList(), - CalendarWidget( - focusedDay: _focusedDay, - selectedDay: _selectedDay, - clashStore: clashStore, - discordDetailsStore: discordDetailsStore), - Expanded( - child: Card.filled( - color: Theme.of(context).brightness == - Brightness.dark - ? Colors.blueGrey - : Colors.blueAccent, - margin: const EdgeInsets.all(16.0), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: SvgPicture.asset( - 'svgs/ClashBot-HomePage.svg', - semanticsLabel: 'Clash Bot Home Page', - width: 100, - height: 600, - ), - ), - ), - ), - ]), + body: LayoutBuilder( + builder: (context, constraints) { + if (constraints.maxWidth > 500) { + return Row( + children: [ + Flexible( + flex: 1, + child: Flex(direction: Axis.vertical, children: [ + ServerChipList( + appStore: applicationDetailsStore, + discordDetailsStore: discordDetailsStore, + clashStore: clashStore), + CalendarWidget( + focusedDay: _focusedDay, + selectedDay: _selectedDay, + clashStore: clashStore, + discordDetailsStore: discordDetailsStore), + Expanded( + child: Card.filled( + color: Theme.of(context).brightness == Brightness.dark + ? Colors.blueGrey + : Colors.blueAccent, + margin: const EdgeInsets.all(16.0), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SvgPicture.asset( + 'svgs/ClashBot-HomePage.svg', + semanticsLabel: 'Clash Bot Home Page', + width: 100, + height: 600, + ), ), - const Flexible( - flex: 2, - child: EventsListWidget(), - ), - ], - ); - } else { - return Column( - children: [ - ServerChipList(), - CalendarWidget( - focusedDay: _focusedDay, - selectedDay: _selectedDay, - clashStore: clashStore, - discordDetailsStore: discordDetailsStore), - EventsListWidget(), - ], - ); - } - }, - ), + ), + ), + ]), + ), + Flexible( + flex: 2, + child: EventsListWidget( + clashStore: clashStore, + applicationDetailsStore: applicationDetailsStore, + discordDetailStore: discordDetailsStore), + ), + ], + ); + } else { + return Column( + children: [ + ServerChipList( + appStore: applicationDetailsStore, + discordDetailsStore: discordDetailsStore, + clashStore: clashStore), + CalendarWidget( + focusedDay: _focusedDay, + selectedDay: _selectedDay, + clashStore: clashStore, + discordDetailsStore: discordDetailsStore), + EventsListWidget( + clashStore: clashStore, + applicationDetailsStore: applicationDetailsStore, + discordDetailStore: discordDetailsStore), + ], + ); + } + }, ), floatingActionButton: Observer( builder: (_) => clashStore.canCreateTeam diff --git a/lib/pages/home/page/widgets/calendar_widget.dart b/lib/pages/home/page/widgets/calendar_widget.dart index 9619844..29cb5e6 100644 --- a/lib/pages/home/page/widgets/calendar_widget.dart +++ b/lib/pages/home/page/widgets/calendar_widget.dart @@ -1,3 +1,4 @@ +import 'package:clashbot_flutter/enums/api_call_state.dart'; import 'package:clashbot_flutter/pages/home/page/home_v2.dart'; import 'package:clashbot_flutter/pages/shimmer_loading_page.dart'; import 'package:clashbot_flutter/stores/discord_details.store.dart'; @@ -5,7 +6,10 @@ import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:intl/intl.dart'; +import 'package:mobx/mobx.dart'; +import 'package:provider/provider.dart'; import 'package:table_calendar/table_calendar.dart'; +import 'dart:developer' as developer; /// This widget requires the following providers: /// @@ -61,36 +65,39 @@ class _CalendarWidgetState extends State { Widget build(BuildContext context) { bool isDarkMode = Theme.of(context).brightness == Brightness.dark; return Observer( - builder: (_) => widget.clashStore.isRefreshingData - ? SizedBox( - width: 1000.0, child: LoadingCalendar(focusedDay: _focusedDay)) - : SizedBox( - width: 1000.0, - child: Container( - padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - CalendarHeader( - focusedDay: _focusedDay, - onMonthChanged: onMonthChanged, - ), - CalendarBody( - focusedDay: _focusedDay, - hoveredDay: _hoveredDay, - isDarkMode: isDarkMode, - discordDetailsStore: widget.discordDetailsStore, - clashStore: widget.clashStore, - onDaySelected: onDaySelected, - onHoveredDayChanged: (day) { - setState(() { - _hoveredDay = day; - }); - }, + builder: (_) => + widget.clashStore.tournamentsApiCallState == ApiCallState.loading + ? SizedBox( + width: 1000.0, + child: LoadingCalendar(focusedDay: _focusedDay)) + : SizedBox( + width: 1000.0, + child: Container( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + CalendarHeader( + focusedDay: _focusedDay, + onMonthChanged: onMonthChanged, + clashStore: widget.clashStore, + ), + CalendarBody( + focusedDay: _focusedDay, + hoveredDay: _hoveredDay, + isDarkMode: isDarkMode, + discordDetailsStore: widget.discordDetailsStore, + clashStore: widget.clashStore, + onDaySelected: onDaySelected, + onHoveredDayChanged: (day) { + setState(() { + _hoveredDay = day; + }); + }, + ), + ], ), - ], - ), - ), - )); + ), + )); } } @@ -142,36 +149,83 @@ class LoadingCalendar extends StatelessWidget { class CalendarHeader extends StatelessWidget { final DateTime focusedDay; final ValueChanged onMonthChanged; + final ClashStore clashStore; const CalendarHeader({ Key? key, required this.focusedDay, required this.onMonthChanged, + required this.clashStore, }) : super(key: key); @override Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - icon: Icon(Icons.arrow_back), - onPressed: () { - onMonthChanged(DateTime(focusedDay.year, focusedDay.month - 1)); - }, - ), - Text( - DateFormat('MMMM yyyy').format(focusedDay), - style: const TextStyle(fontSize: 20.0), - ), - IconButton( - icon: const Icon(Icons.arrow_forward), - onPressed: () { - onMonthChanged(DateTime(focusedDay.year, focusedDay.month + 1)); - }, - ), - ], - ); + return Observer(builder: (_) { + developer.log( + "CalendarHeader: Api Status${clashStore.tournamentsApiCallState}"); + InputChip chip; + switch (clashStore.tournamentsApiCallState) { + case ApiCallState.loading: + chip = InputChip( + label: const CircularProgressIndicator(), + backgroundColor: Theme.of(context).colorScheme.secondary, + tooltip: 'Loading...', + ); + case ApiCallState.success: + chip = InputChip( + label: const Icon(Icons.check), + backgroundColor: Theme.of(context).colorScheme.primary, + tooltip: "Data up to date", + ); + break; + case ApiCallState.error: + chip = InputChip( + label: const Icon(Icons.refresh), + onPressed: () { + clashStore + .refreshClashTournaments(clashStore.clashBotUser.discordId!); + }, + backgroundColor: Theme.of(context).colorScheme.error, + tooltip: 'Data failed to load, tap to retry', + ); + break; + default: + chip = InputChip( + label: const Text('N/A'), + onPressed: () {}, + backgroundColor: Theme.of(context).colorScheme.onSurface, + tooltip: 'N/A', + ); + break; + } + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + icon: Icon(Icons.arrow_back), + onPressed: () { + onMonthChanged(DateTime(focusedDay.year, focusedDay.month - 1)); + }, + ), + Wrap( + spacing: 10, + children: [ + Text( + DateFormat('MMMM yyyy').format(focusedDay), + style: const TextStyle(fontSize: 20.0), + ), + chip, + ], + ), + IconButton( + icon: const Icon(Icons.arrow_forward), + onPressed: () { + onMonthChanged(DateTime(focusedDay.year, focusedDay.month + 1)); + }, + ), + ], + ); + }); } } diff --git a/lib/pages/home/page/widgets/events_widget.dart b/lib/pages/home/page/widgets/events_widget.dart index 848d72f..a49ab44 100644 --- a/lib/pages/home/page/widgets/events_widget.dart +++ b/lib/pages/home/page/widgets/events_widget.dart @@ -1,46 +1,96 @@ +import 'package:clashbot_flutter/enums/api_call_state.dart'; import 'package:clashbot_flutter/models/clash_team.dart'; import 'package:clashbot_flutter/pages/home/page/widgets/team_card.dart'; +import 'package:clashbot_flutter/stores/application_details.store.dart'; +import 'package:clashbot_flutter/stores/discord_details.store.dart'; import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; class EventsListWidget extends StatelessWidget { - const EventsListWidget({super.key}); + const EventsListWidget( + {super.key, + required this.clashStore, + required this.applicationDetailsStore, + required this.discordDetailStore}); + final ClashStore clashStore; + final ApplicationDetailsStore applicationDetailsStore; + final DiscordDetailsStore discordDetailStore; @override Widget build(BuildContext context) { - ClashStore clashStore = context.read(); final DateFormat formatter = DateFormat('yyyy-MM-ddTHH:mm:ssZ'); return Observer(builder: (_) { + if (clashStore.teamsApiCallState == ApiCallState.error) { + return Flex( + direction: Axis.vertical, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Center( + child: IconButton.filled( + onPressed: () { + clashStore.refreshClashTeams( + clashStore.clashBotUser.discordId!, + clashStore.selectedServers); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('Retrying to load teams...'), + ), + ); + }, + icon: const Icon(Icons.refresh), + color: Theme.of(context).colorScheme.error, + tooltip: 'Failed to load teams. Click to retry.', + ), + ), + ), + ]); + } else if (clashStore.teamsApiCallState == ApiCallState.loading) { + return const Flex( + direction: Axis.vertical, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Center( + child: CircularProgressIndicator(), + ), + ) + ]); + } var events = clashStore.tournamentsToTeamsFilteredToADayIfActive.entries.toList(); - return SingleChildScrollView( - child: ListView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: clashStore.tournamentsToTeams.entries.length, - itemBuilder: (context, index) { - if (clashStore.filterByDay && events[index].value.isEmpty) { - return SizedBox.shrink(); - } - return EventTile( - event: { - 'title': events[index].key.tournamentName + - events[index].key.tournamentDay, - 'date': formatter.format(events[index].key.startTime.toLocal()), - 'startTime': - formatter.format(events[index].key.startTime.toLocal()), - 'endTime': - formatter.format(events[index].key.startTime.toLocal()), - 'description': "Some description.", - 'registrationOpenDateTime': - formatter.format(events[index].key.startTime.toLocal()) - }, - eventTeams: events[index].value, - ); - }, + return Flexible( + child: SingleChildScrollView( + child: ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemCount: clashStore.tournamentsToTeams.entries.length, + itemBuilder: (context, index) { + if (clashStore.filterByDay && events[index].value.isEmpty) { + return const SizedBox.shrink(); + } + return EventTile( + event: { + 'title': events[index].key.tournamentName, + 'day': events[index].key.tournamentDay, + 'date': + formatter.format(events[index].key.startTime.toLocal()), + 'startTime': + formatter.format(events[index].key.startTime.toLocal()), + 'endTime': + formatter.format(events[index].key.startTime.toLocal()), + 'description': "Some description.", + 'registrationOpenDateTime': + formatter.format(events[index].key.startTime.toLocal()) + }, + eventTeams: events[index].value, + applicationDetailsStore: applicationDetailsStore, + discordDetailStore: discordDetailStore, + ); + }, + ), ), ); }); @@ -48,14 +98,17 @@ class EventsListWidget extends StatelessWidget { } class EventTile extends StatelessWidget { - const EventTile({ - super.key, - required this.event, - required this.eventTeams, - }); + const EventTile( + {super.key, + required this.event, + required this.eventTeams, + required this.applicationDetailsStore, + required this.discordDetailStore}); final Map event; final List eventTeams; + final ApplicationDetailsStore applicationDetailsStore; + final DiscordDetailsStore discordDetailStore; @override Widget build(BuildContext context) { @@ -64,7 +117,11 @@ class EventTile extends StatelessWidget { event['title']!, style: Theme.of(context).textTheme.headlineSmall, ), - initiallyExpanded: true, + initiallyExpanded: eventTeams.isNotEmpty, + trailing: Text( + event['day']!, + style: Theme.of(context).textTheme.headlineSmall, + ), subtitle: Wrap( spacing: 10, direction: Axis.horizontal, @@ -101,7 +158,7 @@ class EventTile extends StatelessWidget { ), Row( children: [ - const Icon(Icons.app_registration), + const Icon(Icons.how_to_reg), Padding( padding: const EdgeInsets.only(left: 8.0), child: Text(DateFormat('h:mm a Z').format( @@ -118,7 +175,10 @@ class EventTile extends StatelessWidget { direction: Axis.horizontal, alignment: WrapAlignment.center, children: eventTeams.map((team) { - return TeamCard(team: team); + return TeamCard( + team: team, + applicationDetailsStore: applicationDetailsStore, + discordDetailsStore: discordDetailStore); }).toList(), ), ) diff --git a/lib/pages/home/page/widgets/server_chip_list.dart b/lib/pages/home/page/widgets/server_chip_list.dart index 8f025df..78c9881 100644 --- a/lib/pages/home/page/widgets/server_chip_list.dart +++ b/lib/pages/home/page/widgets/server_chip_list.dart @@ -8,27 +8,31 @@ import 'package:provider/provider.dart'; import 'dart:developer' as developer; class ServerChipList extends StatelessWidget { - const ServerChipList({super.key}); + final ApplicationDetailsStore appStore; + final DiscordDetailsStore discordDetailsStore; + final ClashStore clashStore; + + const ServerChipList({ + super.key, + required this.appStore, + required this.discordDetailsStore, + required this.clashStore, + }); @override Widget build(BuildContext context) { - ApplicationDetailsStore appStore = context.read(); - DiscordDetailsStore discordDetailsStore = - context.read(); - ClashStore clashStore = context.read(); return Padding( padding: const EdgeInsets.all(8.0), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Observer( builder: (_) { - developer.log("Preferred servers: ${appStore.preferredServers}"); return Row( children: appStore.preferredServers.map((serverId) { bool isSelected = clashStore.selectedServers.contains(serverId); return Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), - child: FilterChip( + child: FilterChip.elevated( avatar: CircleAvatar( backgroundImage: discordDetailsStore .discordGuildMap[serverId]?.iconURL != diff --git a/lib/pages/home/page/widgets/team_card.dart b/lib/pages/home/page/widgets/team_card.dart index c457cd6..2671ff5 100644 --- a/lib/pages/home/page/widgets/team_card.dart +++ b/lib/pages/home/page/widgets/team_card.dart @@ -6,6 +6,7 @@ import 'package:clashbot_flutter/stores/application_details.store.dart'; import 'package:clashbot_flutter/stores/discord_details.store.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'dart:developer' as developer; @@ -14,8 +15,13 @@ class TeamCard extends StatelessWidget { TeamCard({ super.key, required this.team, + required this.applicationDetailsStore, + required this.discordDetailsStore, }); + final ApplicationDetailsStore applicationDetailsStore; + final DiscordDetailsStore discordDetailsStore; + final ClashTeam team; final Map roleToImage = { Role.TOP: 'images/TopIcon.webp', @@ -27,10 +33,7 @@ class TeamCard extends StatelessWidget { @override Widget build(BuildContext context) { - ApplicationDetailsStore applicationDetailsStore = - context.read(); - DiscordDetailsStore discordDetailsStore = - context.read(); + final DateFormat formatter = DateFormat('yyyy-MM-ddTHH:mm:ssZ'); return Card( surfaceTintColor: Theme.of(context).brightness == Brightness.dark ? const Color.fromARGB( @@ -59,12 +62,31 @@ class TeamCard extends StatelessWidget { : null, ); }), - Text( - team.name.length > 20 - ? '${team.name.substring(0, 20)}...' - : team.name, - style: Theme.of(context).textTheme.titleLarge, - ), + Observer(builder: (_) { + var formattedDate = DateFormat.yMd().add_jm().format( + DateTime.parse( + formatter.format(team.lastUpdatedAt.toLocal()))); + return Column( + children: [ + Text( + team.name.length > 20 + ? '${team.name.substring(0, 20)}...' + : team.name, + style: Theme.of(context).textTheme.titleLarge, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 5, + children: [ + Icon(Icons.update), + Text(formattedDate, + style: Theme.of(context).textTheme.bodySmall), + ], + ), + ], + ); + }), const IconButton.filledTonal( tooltip: 'Coming soon...', icon: Icon(Icons.fullscreen), diff --git a/lib/stores/application_details.store.dart b/lib/stores/application_details.store.dart index 39c4aea..483d5ad 100644 --- a/lib/stores/application_details.store.dart +++ b/lib/stores/application_details.store.dart @@ -38,18 +38,7 @@ abstract class _ApplicationDetailsStore with Store { .refreshClashTournaments(_clashStore.clashBotUser.discordId!); _clashStore.refreshClashTeams(_clashStore.clashBotUser.discordId!, _clashStore.clashBotUser.selectedServers); - } - }); - - reaction( - (_) => (_discordDetailsStore.failedToLoad, _clashStore.failedToLoad), - (failedToLoad) { - if (failedToLoad.$1 && failedToLoad.$2) { - _errorHandlerStore.setIrreconcilable(); - } else if (failedToLoad.$2) { - _errorHandlerStore.setIrreconcilable(); - } else { - _errorHandlerStore.clearIrreconcilable(); + setPreferredServers(_clashStore.clashBotUser.selectedServers); } }); } @@ -60,6 +49,9 @@ abstract class _ApplicationDetailsStore with Store { @observable ObservableList notifications = ObservableList(); + @observable + ObservableList preferredServers = ObservableList(); + @computed bool get isLoggedIn => _discordDetailsStore.userHasLoggedIn && clashBotUser.discordId != '0'; @@ -77,10 +69,6 @@ abstract class _ApplicationDetailsStore with Store { ObservableList get sortedSelectedServers => ObservableList.of(clashBotUser.selectedServers.sorted()); - @computed - ObservableList get preferredServers => - ObservableList.of(_clashStore.selectedServers); - @computed List get sortedNotifications => notifications.sortedBy((element) => element.timestamp); @@ -89,6 +77,13 @@ abstract class _ApplicationDetailsStore with Store { List get unreadNotifications => notifications.where((notification) => !notification.read).toList(); + @action + void setPreferredServers(List servers) { + developer.log( + "ApplicationDetailsStore: setPreferredServers $servers"); + preferredServers = ObservableList.of(servers); + } + @action void refreshDiscordUser() { _discordDetailsStore.fetchCurrentUserDetails(); diff --git a/lib/stores/discord_details.store.dart b/lib/stores/discord_details.store.dart index 5a5d7da..cbcf4b9 100644 --- a/lib/stores/discord_details.store.dart +++ b/lib/stores/discord_details.store.dart @@ -28,9 +28,6 @@ abstract class _DiscordDetailsStore with Store { @observable ObservableList callsInProgress = ObservableList(); - @observable - bool failedToLoad = false; - @computed bool get loadingData => callsInProgress.isNotEmpty; @@ -44,22 +41,6 @@ abstract class _DiscordDetailsStore with Store { Map get discordGuildMap => {for (var guild in discordGuilds) guild.id: guild}; - @computed - bool get irreconcilableError => failedToLoad && discordUser.id == '0'; - - @action - void loadingUserDetailsFailed() { - developer.log("loadingUserDetailsFailed"); - developer.log("failedToLoad: ${failedToLoad}"); - failedToLoad = true; - developer.log("failedToLoad: ${failedToLoad}"); - } - - @action - void userDetailsSuccessfullyLoaded() { - failedToLoad = false; - } - @action void addCallInProgress(String call) { callsInProgress.add(call); @@ -80,7 +61,6 @@ abstract class _DiscordDetailsStore with Store { addCallInProgress('fetchUserDetails'); var foundUser; try { - userDetailsSuccessfullyLoaded(); foundUser = await _discordService.fetchUserDetails(discordId); discordIdToName.putIfAbsent(discordId, () => foundUser.username); } on Exception catch (error) { @@ -95,14 +75,12 @@ abstract class _DiscordDetailsStore with Store { addCallInProgress('fetchCurrentUserDetails'); final future = _discordService.fetchCurrentUserDetails(); try { - userDetailsSuccessfullyLoaded(); DiscordUser updatedUser = await future; discordUser = updatedUser.copy(); discordIdToName.putIfAbsent(updatedUser.id, () => updatedUser.username); } on Exception catch (error) { _errorHandlerStore.errorMessage = 'Failed to fetch Discord User details due to ${error.toString()}'; - loadingUserDetailsFailed(); } removeCallInProgress('fetchCurrentUserDetails'); } @@ -112,13 +90,11 @@ abstract class _DiscordDetailsStore with Store { addCallInProgress('fetchUserGuilds'); final future = _discordService.fetchUserGuilds(); try { - userDetailsSuccessfullyLoaded(); List guilds = await future; discordGuilds.clear(); discordGuilds.addAll(guilds); } on Exception catch (error) { _errorHandlerStore.errorMessage = error.toString(); - loadingUserDetailsFailed(); } removeCallInProgress('fetchUserGuilds'); } diff --git a/lib/stores/v2-stores/clash.store.dart b/lib/stores/v2-stores/clash.store.dart index 16fd807..6e756ae 100644 --- a/lib/stores/v2-stores/clash.store.dart +++ b/lib/stores/v2-stores/clash.store.dart @@ -1,4 +1,5 @@ import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; import 'package:clashbot_flutter/models/clash_team.dart'; import 'package:clashbot_flutter/models/clash_tournament.dart'; import 'package:clashbot_flutter/models/clashbot_user.dart'; @@ -57,16 +58,27 @@ abstract class _ClashStore with Store { callsInProgress.contains(_ClashStore.refreshClashTeamsCall); @observable - bool failedToLoad = false; + ApiCallState tournamentsApiCallState = ApiCallState.idle; + + @observable + ApiCallState teamsApiCallState = ApiCallState.idle; + + @observable + ApiCallState userApiCallState = ApiCallState.idle; + + @action + void setTournamentsApiCallState(ApiCallState state) { + tournamentsApiCallState = state; + } @action - void loadingUserDetailsFailed() { - failedToLoad = true; + void setTeamsApiCallState(ApiCallState state) { + teamsApiCallState = state; } @action - void userDetailsSuccessfullyLoaded() { - failedToLoad = false; + void setUserApiCallState(ApiCallState state) { + userApiCallState = state; } @action @@ -87,13 +99,14 @@ abstract class _ClashStore with Store { @action Future refreshClashBotUser(String id) async { refreshingUser = true; - userDetailsSuccessfullyLoaded(); addCallInProgress(_ClashStore.refreshClashBotUserCall); + setUserApiCallState(ApiCallState.loading); try { clashBotUser = await _clashService.getPlayer(id); setSelectedServer(clashBotUser.selectedServers); + setUserApiCallState(ApiCallState.success); } catch (e) { - loadingUserDetailsFailed(); + setUserApiCallState(ApiCallState.error); } removeCallInProgress(_ClashStore.refreshClashBotUserCall); refreshingUser = false; @@ -205,8 +218,14 @@ abstract class _ClashStore with Store { @action Future refreshClashTournaments(String id) async { addCallInProgress(_ClashStore.refreshClashTournamentsCall); - tournaments = - ObservableList.of(await _clashService.retrieveTournaments(id)); + setTournamentsApiCallState(ApiCallState.loading); + try { + tournaments = + ObservableList.of(await _clashService.retrieveTournaments(id)); + } catch (e) { + setTournamentsApiCallState(ApiCallState.error); + } + setTournamentsApiCallState(ApiCallState.success); removeCallInProgress(_ClashStore.refreshClashTournamentsCall); } @@ -214,8 +233,15 @@ abstract class _ClashStore with Store { Future refreshClashTeams( String id, List preferredServers) async { addCallInProgress(_ClashStore.refreshClashTeamsCall); - var futureClashTeams = - await _clashService.getClashTeams(id, preferredServers); + setTeamsApiCallState(ApiCallState.loading); + var futureClashTeams; + try { + futureClashTeams = + await _clashService.getClashTeams(id, preferredServers); + setTeamsApiCallState(ApiCallState.success); + } catch (e) { + setTeamsApiCallState(ApiCallState.error); + } clashTeams = ObservableList.of(futureClashTeams); removeCallInProgress(_ClashStore.refreshClashTeamsCall); } diff --git a/lib/stores/v2-stores/error_handler.store.dart b/lib/stores/v2-stores/error_handler.store.dart index c800414..9d5caaa 100644 --- a/lib/stores/v2-stores/error_handler.store.dart +++ b/lib/stores/v2-stores/error_handler.store.dart @@ -8,19 +8,6 @@ abstract class _ErrorHandlerStore with Store { @observable String errorMessage = ''; - @observable - bool irreconcilable = false; - - @action - void setIrreconcilable() { - irreconcilable = true; - } - - @action - void clearIrreconcilable() { - irreconcilable = false; - } - @action void setErrorMessage(String message) { errorMessage = message; diff --git a/lib/storybook_main.dart b/lib/storybook_main.dart deleted file mode 100644 index 5ee9ca8..0000000 --- a/lib/storybook_main.dart +++ /dev/null @@ -1,355 +0,0 @@ -import 'package:clash_bot_api/api.dart'; -import 'package:clashbot_flutter/globals/global_settings.dart'; -import 'package:clashbot_flutter/models/clash_team.dart'; -import 'package:clashbot_flutter/models/clash_tournament.dart'; -import 'package:clashbot_flutter/models/clashbot_user.dart'; -import 'package:clashbot_flutter/models/discord_guild.dart'; -import 'package:clashbot_flutter/models/discord_user.dart'; -import 'package:clashbot_flutter/pages/errorPages/whoops_page.dart'; -import 'package:clashbot_flutter/pages/home/page/widgets/calendar_widget.dart'; -import 'package:clashbot_flutter/pages/home/page/widgets/team_card.dart'; -import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; -import 'package:clashbot_flutter/services/discord_service_impl.dart'; -import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; -import 'package:clashbot_flutter/stores/application_details.store.dart'; -import 'package:clashbot_flutter/stores/discord_details.store.dart'; -import 'package:clashbot_flutter/stores/riot_champion.store.dart'; -import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; -import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:storybook_flutter/storybook_flutter.dart'; - -class MockApplicationDetailsStore extends ApplicationDetailsStore { - MockApplicationDetailsStore( - ClashBotUser mockClashBotUser, - super._clashStore, - super._discordDetailsStore, - super._riotChampionStore, - super._errorHandlerStore); - - @override - ClashBotUser get clashBotUser => ClashBotUser( - discordId: '123456789', - champions: [], - role: Role.TOP, - serverId: 'server1', - selectedServers: [ - 'server1', - ], - preferredServers: ['server1', 'server2'], - ); -} - -class MockDiscordDetailsStore extends DiscordDetailsStore { - MockDiscordDetailsStore(List guilds, DiscordUser user, - super.discordService, super._errorHandlerStore); -} - -class MockClashStore extends ClashStore { - MockClashStore( - ClashBotUser clashBotUser, - List tournaments, - List clashTeams, - super._clashService, - super._errorhandlerStore); -} - -class MockRiotChampionStore extends RiotChampionStore { - MockRiotChampionStore(super._riotResourcesService, super._errorHandlerStore); -} - -void main() { - var loggedInUserId = '123456789'; - var clashUser = ClashBotUser( - discordId: loggedInUserId, - champions: [], - role: Role.TOP, - serverId: 'server1', - selectedServers: [ - 'server1', - ], - preferredServers: ['server1', 'server2'], - ); - var guilds = [ - DiscordGuild('1', 'Mock Guild 1', '123456789', false), - DiscordGuild('2', 'Mock Guild 2', '123456789', false), - ]; - var tournaments = [ - ClashTournament('1', 'Mock Tournament 1', DateTime.now(), DateTime.now()), - ClashTournament('2', 'Mock Tournament 2', DateTime.now(), DateTime.now()), - ]; - var clashTeams = [ - ClashTeam( - '1', - 'Mock Team 1', - tournaments[0].tournamentName, - tournaments[0].tournamentDay, - { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }, - '123456789', - DateTime.now(), - ), - ClashTeam( - '2', - 'Mock Team 2', - tournaments[0].tournamentName, - tournaments[0].tournamentDay, - { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }, - '123456789', - DateTime.now(), - ), - ]; - var discordUser = DiscordUser( - loggedInUserId, 'mock_username', '123456789', "mock_discriminator"); - runApp(MultiProvider(providers: [ - Provider(create: (_) => ApiClient(basePath: "http://localhost")), - Provider(create: (_) => ErrorHandlerStore()), - ProxyProvider( - update: (_, errorHandlerStore, __) { - return MockDiscordDetailsStore(guilds, discordUser, - DiscordServiceImpl(setupOauth2Helper()), errorHandlerStore); - }), - ProxyProvider( - update: (_, errorHandlerStore, __) => MockRiotChampionStore( - RiotResourceServiceImpl(), errorHandlerStore)), - ProxyProvider2( - update: (_, errorHandlerStore, apiClient, __) => MockClashStore( - clashUser, - tournaments, - clashTeams, - ClashBotServiceImpl( - UserApi(apiClient), - TeamApi(apiClient), - ChampionsApi(apiClient), - SubscriptionApi(apiClient), - TentativeApi(apiClient), - TournamentApi(apiClient), - errorHandlerStore), - errorHandlerStore)), - ProxyProvider4( - update: (_, clashStore, errorHandlerStore, discordDetailsStore, - riotChampionStore, __) => - MockApplicationDetailsStore(clashUser, clashStore, - discordDetailsStore, riotChampionStore, errorHandlerStore)), - ], child: ClashBotStorybookApp())); -} - -class ClashBotStorybookApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Storybook(initialStory: "4Filled", stories: [ - StoryCalendarWidgetWTournaments(context), - StoryCalendarWidgetWTournamentsLoading(context), - StoryTeamCard(), - WhoopsPageStory() - ]); - } - - Story StoryTeamCard() { - return Story( - name: "4Filled", - description: "A card for displaying team information", - builder: (context) { - return TeamCard( - team: ClashTeam( - '1', - 'Mock Team', - 'Tournament 1', - '1', - () { - switch (context.knobs - .text(label: '# of missing roles', initial: '0')) { - case '0': - return { - Role.TOP: PlayerDetails('123456789', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.BOT: PlayerDetails('5', 'Player 4', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }; - case '1': - return { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.BOT: PlayerDetails('5', 'Player 4', []), - Role.SUPP: null, - }; - case '2': - return { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.BOT: null, - Role.SUPP: null, - }; - case '3': - return { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.JG: null, - Role.BOT: null, - Role.SUPP: null, - }; - case '4': - return { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: null, - Role.MID: null, - Role.BOT: null, - Role.SUPP: null, - }; - case '5': - return { - Role.TOP: null, - Role.JG: null, - Role.MID: null, - Role.BOT: null, - Role.SUPP: null, - }; - default: - return { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }; - } - }(), - '123456789', - DateTime.now(), - )); - }); - } - - Story WhoopsPageStory() { - return Story( - name: "WhoopsPage", - description: "A page for that the app is not usable.", - builder: (context) { - return const WhoopsPage(); - }, - ); - } - - Story StoryCalendarWidgetWTournamentsLoading(BuildContext context) { - DiscordDetailsStore discordDetailsStore = - context.read(); - ClashStore clashStoreW5Tournies = new MockClashStore( - context.read().clashBotUser, - [ - ClashTournament('1', 'Mock Tournament 1', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('2', 'Mock Tournament 2', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('3', 'Mock Tournament 3', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('4', 'Mock Tournament 4', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('5', 'Mock Tournament 5', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ], - [ - ClashTeam( - '1', - 'Mock Team 1', - 'Mock Tournament 1', - '1', - { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }, - '123456789', - DateTime.now(), - ) - ], - new ClashBotServiceImpl( - new UserApi(context.read()), - new TeamApi(context.read()), - new ChampionsApi(context.read()), - new SubscriptionApi(context.read()), - new TentativeApi(context.read()), - new TournamentApi(context.read()), - new ErrorHandlerStore()), - context.read()); - clashStoreW5Tournies.addCallInProgress('getTournaments'); - return Story( - name: "Widgets/Calendar/loading", - description: "ClashBot's main calendar widget loading", - builder: (context) { - return CalendarWidget( - focusedDay: DateTime.now(), - selectedDay: DateTime.now(), - clashStore: clashStoreW5Tournies, - discordDetailsStore: discordDetailsStore); - }, - ); - } -} - -Story StoryCalendarWidgetWTournaments(BuildContext context) { - DiscordDetailsStore discordDetailsStore = context.read(); - ClashStore clashStoreW5Tournies = new MockClashStore( - context.read().clashBotUser, - [ - ClashTournament('1', 'Mock Tournament 1', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('2', 'Mock Tournament 2', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('3', 'Mock Tournament 3', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('4', 'Mock Tournament 4', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ClashTournament('5', 'Mock Tournament 5', DateTime.now(), - DateTime.now().add(Duration(days: 1))), - ], - [ - ClashTeam( - '1', - 'Mock Team 1', - 'Mock Tournament 1', - '1', - { - Role.TOP: PlayerDetails('1', 'Player 1', []), - Role.JG: PlayerDetails('2', 'Player 2', []), - Role.MID: PlayerDetails('3', 'Player 3', []), - Role.SUPP: PlayerDetails('5', 'Player 5', []), - }, - '460520499680641035', - DateTime.now(), - ) - ], - new ClashBotServiceImpl( - new UserApi(context.read()), - new TeamApi(context.read()), - new ChampionsApi(context.read()), - new SubscriptionApi(context.read()), - new TentativeApi(context.read()), - new TournamentApi(context.read()), - new ErrorHandlerStore()), - context.read()); - return Story( - name: "Widgets/Calendar/filled", - description: "ClashBot's main calendar widget filled", - builder: (context) { - return CalendarWidget( - focusedDay: DateTime.now(), - selectedDay: DateTime.now(), - clashStore: clashStoreW5Tournies, - discordDetailsStore: discordDetailsStore); - }, - ); -} diff --git a/widgetbook/.gitignore b/widgetbook/.gitignore new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/widgetbook/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +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 diff --git a/widgetbook/.metadata b/widgetbook/.metadata new file mode 100644 index 0000000..4387f5e --- /dev/null +++ b/widgetbook/.metadata @@ -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: "35c388afb57ef061d06a39b537336c87e0e3d1b1" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + - platform: web + create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 + + # 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' diff --git a/widgetbook/README.md b/widgetbook/README.md new file mode 100644 index 0000000..28e23a0 --- /dev/null +++ b/widgetbook/README.md @@ -0,0 +1,3 @@ +# widgetbook + +A new Flutter project. diff --git a/widgetbook/analysis_options.yaml b/widgetbook/analysis_options.yaml new file mode 100644 index 0000000..f9b3034 --- /dev/null +++ b/widgetbook/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/widgetbook/devtools_options.yaml b/widgetbook/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/widgetbook/devtools_options.yaml @@ -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: diff --git a/widgetbook/lib/calendar_widget.dart b/widgetbook/lib/calendar_widget.dart new file mode 100644 index 0000000..3db5786 --- /dev/null +++ b/widgetbook/lib/calendar_widget.dart @@ -0,0 +1,166 @@ +import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; +import 'package:clashbot_flutter/globals/global_settings.dart'; +import 'package:clashbot_flutter/models/clash_team.dart'; +import 'package:clashbot_flutter/models/clash_tournament.dart'; +import 'package:clashbot_flutter/models/clashbot_user.dart'; +import 'package:clashbot_flutter/models/discord_guild.dart'; +import 'package:clashbot_flutter/models/discord_user.dart'; +import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; +import 'package:clashbot_flutter/services/discord_service_impl.dart'; +import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; +import 'package:clashbot_flutter/stores/discord_details.store.dart'; +import 'package:clashbot_flutter/stores/riot_champion.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; +import 'package:flutter/material.dart'; +import 'package:widgetbook/widgetbook.dart'; +import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; + +// Import the widget from your app +import 'package:clashbot_flutter/pages/home/page/widgets/calendar_widget.dart'; +import 'package:widgetbook_workspace/utils/mock_utils.dart'; + +@widgetbook.UseCase(name: 'Loading', type: CalendarWidget) +Widget buildCoolButtonUseCase(BuildContext context) { + List tournaments = buildTournaments(1); + List clashTeams = buildClashTeams(2); + List guilds = buildGuilds(1); + CalendarWidgetDependencies calendarWidgetDependencies = + buildCalendarWidgetDependencies( + tournaments, + clashTeams, + guilds, + ApiCallState.loading, + ApiCallState.loading, + ApiCallState.loading, + ); + return CalendarWidget( + focusedDay: DateTime.now(), + selectedDay: DateTime.now(), + clashStore: calendarWidgetDependencies.clashStore, + discordDetailsStore: calendarWidgetDependencies.discordDetailsStore, + ); +} + +@widgetbook.UseCase(name: 'Default', type: CalendarWidget) +Widget buildCalendarStory(BuildContext context) { + int numberOfTournaments = context.knobs.int.slider( + label: 'Number of Tournaments', + min: 1, + max: 10, + initialValue: 1, + ); + List tournaments = buildTournaments(numberOfTournaments); + List clashTeams = buildClashTeams(2); + List guilds = buildGuilds(1); + CalendarWidgetDependencies calendarWidgetDependencies = + buildCalendarWidgetDependencies( + tournaments, + clashTeams, + guilds, + ApiCallState.success, + ApiCallState.loading, + ApiCallState.loading, + ); + + return CalendarWidget( + focusedDay: DateTime.now(), + selectedDay: DateTime.now(), + clashStore: calendarWidgetDependencies.clashStore, + discordDetailsStore: calendarWidgetDependencies.discordDetailsStore, + ); +} + +@widgetbook.UseCase(name: 'Error', type: CalendarWidget) +Widget buildCalendarStoryError(BuildContext context) { + int numberOfTournaments = context.knobs.int.slider( + label: 'Number of Tournaments', + min: 1, + max: 10, + initialValue: 1, + ); + List tournaments = buildTournaments(numberOfTournaments); + List clashTeams = buildClashTeams(2); + List guilds = buildGuilds(1); + CalendarWidgetDependencies calendarWidgetDependencies = + buildCalendarWidgetDependencies( + tournaments, + clashTeams, + guilds, + ApiCallState.error, + ApiCallState.loading, + ApiCallState.loading, + ); + + return CalendarWidget( + focusedDay: DateTime.now(), + selectedDay: DateTime.now(), + clashStore: calendarWidgetDependencies.clashStore, + discordDetailsStore: calendarWidgetDependencies.discordDetailsStore, + ); +} + +class CalendarWidgetDependencies { + final ClashStore clashStore; + final DiscordDetailsStore discordDetailsStore; + final RiotChampionStore riotChampionStore; + final ErrorHandlerStore errorHandlerStore; + + CalendarWidgetDependencies( + this.clashStore, + this.discordDetailsStore, + this.riotChampionStore, + this.errorHandlerStore, + ); +} + +CalendarWidgetDependencies buildCalendarWidgetDependencies( + List tournaments, + List clashTeams, + List guilds, + ApiCallState tournamentsApiCallState, + ApiCallState teamsApiCallState, + ApiCallState userApiCallState, +) { + DiscordDetailsStore discordDetailsStore = MockDiscordDetailsStore( + guilds, + DiscordUser('1', 'Mock User', 'icon', '1'), + DiscordServiceImpl(setupOauth2Helper()), + ErrorHandlerStore(), + ); + var clashUser = ClashBotUser( + discordId: "1", + champions: [], + role: Role.TOP, + serverId: 'server1', + selectedServers: ['server1'], + preferredServers: ['server1', 'server2'], + ); + var apiClient = ApiClient(); + ClashStore clashStore = MockClashStore( + clashUser, + tournaments, + clashTeams, + tournamentsApiCallState, + teamsApiCallState, + userApiCallState, + ClashBotServiceImpl( + UserApi(apiClient), + TeamApi(apiClient), + ChampionsApi(apiClient), + SubscriptionApi(apiClient), + TentativeApi(apiClient), + TournamentApi(apiClient), + ErrorHandlerStore(), + ), + ErrorHandlerStore(), + ); + clashStore.addCallInProgress('getTournaments'); + return CalendarWidgetDependencies( + clashStore, + discordDetailsStore, + MockRiotChampionStore(RiotResourceServiceImpl(), ErrorHandlerStore()), + ErrorHandlerStore(), + ); +} diff --git a/widgetbook/lib/event_list_widget.dart b/widgetbook/lib/event_list_widget.dart new file mode 100644 index 0000000..c6efc9b --- /dev/null +++ b/widgetbook/lib/event_list_widget.dart @@ -0,0 +1,121 @@ +import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; +import 'package:clashbot_flutter/globals/global_settings.dart'; +import 'package:clashbot_flutter/models/clash_team.dart'; +import 'package:clashbot_flutter/models/clash_tournament.dart'; +import 'package:clashbot_flutter/models/clashbot_user.dart'; +import 'package:clashbot_flutter/models/discord_user.dart'; +import 'package:clashbot_flutter/pages/home/page/widgets/events_widget.dart'; +import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; +import 'package:clashbot_flutter/services/discord_service_impl.dart'; +import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; +import 'package:clashbot_flutter/stores/application_details.store.dart'; +import 'package:clashbot_flutter/stores/riot_champion.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; +import 'package:flutter/material.dart'; +import 'package:widgetbook_annotation/widgetbook_annotation.dart'; +import 'package:widgetbook_workspace/utils/mock_utils.dart'; + +@UseCase(name: "Default", type: EventsListWidget) +Widget buildEventListWidget(BuildContext context) { + var apiClient = ApiClient(); + var clashBotUser = ClashBotUser( + discordId: "1", + champions: [], + role: Role.TOP, + serverId: 'server1', + selectedServers: ['server1'], + preferredServers: ['server1', 'server2'], + ); + ClashStore clashStoreW5Tournies = new MockClashStore( + clashBotUser, + [ + ClashTournament( + 'ARAM Clash', + '1', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ClashTournament( + 'ARAM Clash', + '2', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ClashTournament( + 'Summoner\'s Cup', + '1', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ClashTournament( + 'Summoner\'s Cup', + '2', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ClashTournament( + 'Summoner\'s Cup', + '3', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ClashTournament( + 'Summoner\'s Cup', + '4', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ], + [ + ClashTeam( + '1', + 'Mock Team 1', + 'Mock Tournament 1', + '1', + { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.JG: PlayerDetails('2', 'Player 2', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.SUPP: PlayerDetails('5', 'Player 5', []), + }, + '460520499680641035', + DateTime.now(), + ), + ], + ApiCallState.error, + ApiCallState.success, + ApiCallState.success, + ClashBotServiceImpl( + UserApi(apiClient), + TeamApi(apiClient), + ChampionsApi(apiClient), + SubscriptionApi(apiClient), + TentativeApi(apiClient), + TournamentApi(apiClient), + ErrorHandlerStore(), + ), + ErrorHandlerStore(), + ); + var mockDiscordDetailsStore = MockDiscordDetailsStore( + buildGuilds(2), + DiscordUser('1', 'Mock User', 'Mock#0001', 'avatar'), + DiscordServiceImpl(setupOauth2Helper()), + ErrorHandlerStore(), + ); + var mockServers = buildMockServers(2); + var applicationDetailsStore = MockApplicationDetailsStore( + clashBotUser, + mockServers, + clashStoreW5Tournies, + mockDiscordDetailsStore, + RiotChampionStore(RiotResourceServiceImpl(), ErrorHandlerStore()), + ErrorHandlerStore(), + ); + return EventsListWidget( + clashStore: clashStoreW5Tournies, + applicationDetailsStore: applicationDetailsStore, + discordDetailStore: mockDiscordDetailsStore, + ); +} diff --git a/widgetbook/lib/main.dart b/widgetbook/lib/main.dart new file mode 100644 index 0000000..e246239 --- /dev/null +++ b/widgetbook/lib/main.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:widgetbook/widgetbook.dart'; +import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; + +import 'main.directories.g.dart'; + +void main() { + runApp(const MainApp()); +} + +@widgetbook.App() +class MainApp extends StatelessWidget { + const MainApp({super.key}); + + @override + Widget build(BuildContext context) { + return Widgetbook.material( + directories: directories, + lightTheme: ThemeData.light(), + darkTheme: ThemeData.dark(), + addons: [ + MaterialThemeAddon( + themes: [ + WidgetbookTheme(name: 'Light', data: ThemeData.light()), + WidgetbookTheme(name: 'Dark', data: ThemeData.dark()), + ], + ), + ], + ); + } +} diff --git a/widgetbook/lib/server_list_widget.dart b/widgetbook/lib/server_list_widget.dart new file mode 100644 index 0000000..05fa2ea --- /dev/null +++ b/widgetbook/lib/server_list_widget.dart @@ -0,0 +1,125 @@ +import 'package:clashbot_flutter/pages/home/page/widgets/server_chip_list.dart'; +import 'package:flutter/widgets.dart'; +import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; +import 'package:clashbot_flutter/globals/global_settings.dart'; +import 'package:clashbot_flutter/services/discord_service_impl.dart'; +import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; +import 'package:clashbot_flutter/models/clash_team.dart'; +import 'package:clashbot_flutter/models/clash_tournament.dart'; +import 'package:clashbot_flutter/models/clashbot_user.dart'; +import 'package:clashbot_flutter/models/discord_guild.dart'; +import 'package:clashbot_flutter/models/discord_user.dart'; +import 'package:clashbot_flutter/pages/home/page/home_v2.dart'; +import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; +import 'package:clashbot_flutter/stores/application_details.store.dart'; +import 'package:clashbot_flutter/stores/discord_details.store.dart'; +import 'package:clashbot_flutter/stores/riot_champion.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; +import 'package:flutter/material.dart'; +import 'package:mobx/mobx.dart'; +import 'package:provider/provider.dart'; +import 'package:widgetbook/widgetbook.dart'; +import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; +import 'package:widgetbook_workspace/utils/mock_utils.dart'; + +@widgetbook.UseCase(name: "Default", type: ServerChipList) +Widget buildServerListWidget(BuildContext context) { + int numberOfServers = context.knobs.int.slider( + label: "Number of Servers", + initialValue: 1, + max: 5, + min: 1, + ); + List servers = buildMockServers(numberOfServers); + ServerChipListDependencies serverChipListDependencies = + buildServerChipListDependencies( + clashState: ApiCallState.success, + tentativeState: ApiCallState.success, + subscriptionState: ApiCallState.success, + servers: servers, + ); + return Center( + child: ServerChipList( + appStore: serverChipListDependencies.appStore, + discordDetailsStore: serverChipListDependencies.discordDetailsStore, + clashStore: serverChipListDependencies.clashStore, + ), + ); +} + +class ServerChipListDependencies { + final ApplicationDetailsStore appStore; + final DiscordDetailsStore discordDetailsStore; + final ClashStore clashStore; + + ServerChipListDependencies({ + required this.appStore, + required this.discordDetailsStore, + required this.clashStore, + }); +} + +ServerChipListDependencies buildServerChipListDependencies({ + required ApiCallState clashState, + required ApiCallState tentativeState, + required ApiCallState subscriptionState, + required List servers, +}) { + final mockUser = ClashBotUser( + discordId: '123456789', + champions: [], + role: Role.TOP, + serverId: servers[0], + selectedServers: servers, + preferredServers: servers, + ); + + final errorHandlerStore = ErrorHandlerStore(); + final mockDiscordUser = DiscordUser( + '123456789', + 'mock_username', + '123456789', + "mock_discriminator", + ); + + final mockClashStore = MockClashStore( + mockUser, + ObservableList.of([]), + ObservableList.of([]), + clashState, + tentativeState, + subscriptionState, + ClashBotServiceImpl( + UserApi(), + TeamApi(), + ChampionsApi(), + SubscriptionApi(), + TentativeApi(), + TournamentApi(), + errorHandlerStore, + ), + errorHandlerStore, + ); + + final mockDiscordDetailsStore = MockDiscordDetailsStore( + buildMockDiscordGuilds(servers), + mockDiscordUser, + DiscordServiceImpl(setupOauth2Helper()), + errorHandlerStore, + ); + + return ServerChipListDependencies( + appStore: MockApplicationDetailsStore( + mockUser, + servers, + mockClashStore, + mockDiscordDetailsStore, + RiotChampionStore(RiotResourceServiceImpl(), errorHandlerStore), + errorHandlerStore, + ), + clashStore: mockClashStore, + discordDetailsStore: mockDiscordDetailsStore, + ); +} diff --git a/widgetbook/lib/team_card_widget.dart b/widgetbook/lib/team_card_widget.dart new file mode 100644 index 0000000..9e5f4cc --- /dev/null +++ b/widgetbook/lib/team_card_widget.dart @@ -0,0 +1,139 @@ +import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; +import 'package:clashbot_flutter/globals/global_settings.dart'; +import 'package:clashbot_flutter/models/clash_team.dart'; +import 'package:clashbot_flutter/models/clashbot_user.dart'; +import 'package:clashbot_flutter/models/discord_user.dart'; +import 'package:clashbot_flutter/pages/home/page/widgets/team_card.dart'; +import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; +import 'package:clashbot_flutter/services/discord_service_impl.dart'; +import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; +import 'package:clashbot_flutter/stores/riot_champion.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; +import 'package:flutter/material.dart'; +import 'package:widgetbook/widgetbook.dart'; +import 'package:widgetbook_annotation/widgetbook_annotation.dart'; +import 'package:widgetbook_workspace/utils/mock_utils.dart'; + +@UseCase(name: "Default", type: TeamCard) +Widget buildTeamCardWidget(BuildContext context) { + var clashUser = ClashBotUser( + discordId: "1", + champions: [], + role: Role.TOP, + serverId: 'server1', + selectedServers: ['server1'], + preferredServers: ['server1', 'server2'], + ); + var mockServers = buildMockServers(2); + var apiClient = ApiClient(); + var mockDiscordDetailsStore = MockDiscordDetailsStore( + buildGuilds(2), + DiscordUser('1', 'Mock User', 'Mock#0001', 'avatar'), + DiscordServiceImpl(setupOauth2Helper()), + ErrorHandlerStore(), + ); + var mockApplicationDetailsStore = new MockApplicationDetailsStore( + clashUser, + mockServers, + MockClashStore( + clashUser, + buildTournaments(2), + buildClashTeams(2), + ApiCallState.success, + ApiCallState.success, + ApiCallState.success, + ClashBotServiceImpl( + UserApi(apiClient), + TeamApi(apiClient), + ChampionsApi(apiClient), + SubscriptionApi(apiClient), + TentativeApi(apiClient), + TournamentApi(apiClient), + ErrorHandlerStore(), + ), + ErrorHandlerStore(), + ), + mockDiscordDetailsStore, + MockRiotChampionStore(RiotResourceServiceImpl(), ErrorHandlerStore()), + ErrorHandlerStore(), + ); + return Center( + child: TeamCard( + applicationDetailsStore: mockApplicationDetailsStore, + discordDetailsStore: mockDiscordDetailsStore, + team: ClashTeam( + '1', + 'Mock Team', + 'Tournament 1', + '1', + () { + switch (context.knobs.int.slider( + label: '# of missing roles', + initialValue: 0, + max: 5, + min: 0, + )) { + case 0: + return { + Role.TOP: PlayerDetails('123456789', 'Player 1', []), + Role.JG: PlayerDetails('2', 'Player 2', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.BOT: PlayerDetails('5', 'Player 4', []), + Role.SUPP: PlayerDetails('5', 'Player 5', []), + }; + case 1: + return { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.JG: PlayerDetails('2', 'Player 2', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.BOT: PlayerDetails('5', 'Player 4', []), + Role.SUPP: null, + }; + case 2: + return { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.JG: PlayerDetails('2', 'Player 2', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.BOT: null, + Role.SUPP: null, + }; + case 3: + return { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.JG: null, + Role.BOT: null, + Role.SUPP: null, + }; + case 4: + return { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.JG: null, + Role.MID: null, + Role.BOT: null, + Role.SUPP: null, + }; + case 5: + return { + Role.TOP: null, + Role.JG: null, + Role.MID: null, + Role.BOT: null, + Role.SUPP: null, + }; + default: + return { + Role.TOP: PlayerDetails('1', 'Player 1', []), + Role.JG: PlayerDetails('2', 'Player 2', []), + Role.MID: PlayerDetails('3', 'Player 3', []), + Role.SUPP: PlayerDetails('5', 'Player 5', []), + }; + } + }(), + '123456789', + DateTime.now(), + ), + ), + ); +} diff --git a/widgetbook/lib/utils/mock_utils.dart b/widgetbook/lib/utils/mock_utils.dart new file mode 100644 index 0000000..7521212 --- /dev/null +++ b/widgetbook/lib/utils/mock_utils.dart @@ -0,0 +1,140 @@ +import 'package:clash_bot_api/api.dart'; +import 'package:clashbot_flutter/enums/api_call_state.dart'; +import 'package:clashbot_flutter/globals/global_settings.dart'; +import 'package:clashbot_flutter/models/clash_team.dart'; +import 'package:clashbot_flutter/models/clash_tournament.dart'; +import 'package:clashbot_flutter/models/clashbot_user.dart'; +import 'package:clashbot_flutter/models/discord_guild.dart'; +import 'package:clashbot_flutter/models/discord_user.dart'; +import 'package:clashbot_flutter/pages/home/page/home_v2.dart'; +import 'package:clashbot_flutter/services/clashbot_service_impl.dart'; +import 'package:clashbot_flutter/services/discord_service_impl.dart'; +import 'package:clashbot_flutter/services/riot_resources_service_impl.dart'; +import 'package:clashbot_flutter/stores/application_details.store.dart'; +import 'package:clashbot_flutter/stores/discord_details.store.dart'; +import 'package:clashbot_flutter/stores/riot_champion.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/clash.store.dart'; +import 'package:clashbot_flutter/stores/v2-stores/error_handler.store.dart'; +import 'package:flutter/material.dart'; +import 'package:mobx/mobx.dart'; + +List buildTournaments(int count) { + return List.generate( + count, + (index) => ClashTournament( + 'Tournament $index', + '$index', + DateTime.now(), + DateTime.now().add(Duration(days: 1)), + ), + ); +} + +List buildClashTeams(int count) { + return List.generate( + count, + (index) => ClashTeam( + '$index', + 'Mock Team $index', + 'Mock Tournament $index', + '$index', + { + Role.TOP: PlayerDetails('$index', 'Player $index', []), + Role.JG: PlayerDetails('${index + 1}', 'Player ${index + 1}', []), + Role.MID: PlayerDetails('${index + 2}', 'Player ${index + 2}', []), + Role.SUPP: PlayerDetails('${index + 3}', 'Player ${index + 3}', []), + }, + '123456789', + DateTime.now(), + ), + ); +} + +List buildGuilds(int count) { + return List.generate( + count, + (index) => DiscordGuildWColor( + id: '$index', + name: 'Mock Guild $index', + icon: 'icon', + owner: index == 0, + color: Colors.primaries[index % Colors.primaries.length], + ), + ); +} + +class MockApplicationDetailsStore extends ApplicationDetailsStore { + MockApplicationDetailsStore( + ClashBotUser mockClashBotUser, + List mockPreferredServers, + super._clashStore, + super._discordDetailsStore, + super._riotChampionStore, + super._errorHandlerStore, + ) { + clashBotUser = mockClashBotUser; + clashBotUser.preferredServers = ObservableList.of(mockPreferredServers); + } +} + +class MockDiscordDetailsStore extends DiscordDetailsStore { + MockDiscordDetailsStore( + List guilds, + DiscordUser discordUser, + super.discordService, + super._errorHandlerStore, + ) { + discordGuilds = ObservableList.of(guilds); + this.discordUser = discordUser; + } +} + +class MockClashStore extends ClashStore { + ApiCallState originalTournamentsApiCallState = ApiCallState.success; + MockClashStore( + ClashBotUser clashBotUser, + List tournaments, + List clashTeams, + ApiCallState tournamentsApiCallStateToBeSet, + ApiCallState teamsApiCallState, + ApiCallState userApiCallState, + super._clashService, + super._errorhandlerStore, + ) { + this.tournamentsApiCallState = tournamentsApiCallStateToBeSet; + this.originalTournamentsApiCallState = tournamentsApiCallStateToBeSet; + this.teamsApiCallState = teamsApiCallState; + this.userApiCallState = userApiCallState; + this.clashBotUser = clashBotUser; + this.tournaments = ObservableList.of(tournaments); + this.clashTeams = ObservableList.of(clashTeams); + } + + @override + Future refreshClashTournaments(String id) async { + setTournamentsApiCallState(ApiCallState.loading); + await Future.delayed(Duration(seconds: 1), () { + setTournamentsApiCallState(originalTournamentsApiCallState); + }); + } +} + +class MockRiotChampionStore extends RiotChampionStore { + MockRiotChampionStore(super._riotResourcesService, super._errorHandlerStore); +} + +List buildMockServers(int numberOfServers) { + List servers = []; + for (var i = 0; i < numberOfServers; i++) { + servers.add('$i'); + } + return servers; +} + +List buildMockDiscordGuilds(List servers) { + List guilds = []; + for (var i = 0; i < servers.length; i++) { + guilds.add(DiscordGuild(servers[i], 'Mock Guild $i', '123456789', false)); + } + return guilds; +} diff --git a/widgetbook/pubspec.lock b/widgetbook/pubspec.lock new file mode 100644 index 0000000..8cca6da --- /dev/null +++ b/widgetbook/pubspec.lock @@ -0,0 +1,1277 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + url: "https://pub.dev" + source: hosted + version: "76.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "7fd72d77a7487c26faab1d274af23fb008763ddc10800261abbfb2c067f183d5" + url: "https://pub.dev" + source: hosted + version: "1.3.53" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" + accessibility_tools: + dependency: transitive + description: + name: accessibility_tools + sha256: "1ee3612b9439ca315f92dcc31c6a4828e95b96c1aa64ac3a7776c149722deca8" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + url: "https://pub.dev" + source: hosted + version: "6.11.0" + animated_text_kit: + dependency: "direct main" + description: + name: animated_text_kit + sha256: adba517adb7e6adeb1eb5e1c8a147dd7bc664dfdf2f5e92226b572a91393a93d + url: "https://pub.dev" + source: hosted + version: "4.2.3" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" + url: "https://pub.dev" + source: hosted + version: "2.4.14" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + url: "https://pub.dev" + source: hosted + version: "8.0.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 + url: "https://pub.dev" + source: hosted + version: "8.9.5" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clash_bot_api: + dependency: "direct main" + description: + path: "../clash-bot-api" + relative: true + source: path + version: "1.0.1" + clashbot_flutter: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "1.0.0+1" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: "direct main" + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" + url: "https://pub.dev" + source: hosted + version: "2.3.8" + dev: + dependency: "direct main" + description: + name: dev + sha256: e7e806af20d53e293a7878212d2246d3e9fccd2b49d597600f9898ed83501cb4 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + device_frame: + dependency: transitive + description: + name: device_frame + sha256: d031a06f5d6f4750009672db98a5aa1536aa4a231713852469ce394779a23d75 + url: "https://pub.dev" + source: hosted + version: "1.2.0" + envied: + dependency: "direct main" + description: + name: envied + sha256: a4e2b1d0caa479b5d61332ae516518c175a6d09328a35a0bc0a53894cc5d7e4d + url: "https://pub.dev" + source: hosted + version: "1.1.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + sha256: "81a582e9348216fcf6b30878487369325bf78b8ddd752ed176949c8e4fd4aaac" + url: "https://pub.dev" + source: hosted + version: "11.4.4" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + sha256: "5ae7bd4a551b67009cd0676f5407331b202eaf16e0a80dcf7b40cd0a34a18746" + url: "https://pub.dev" + source: hosted + version: "4.3.4" + firebase_analytics_web: + dependency: "direct main" + description: + name: firebase_analytics_web + sha256: "15fd7459fea2a00958dbf9b86cd8ad14d3ce2db13950308af7c7717e89ccc5c2" + url: "https://pub.dev" + source: hosted + version: "0.5.10+10" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: f4d8f49574a4e396f34567f3eec4d38ab9c3910818dec22ca42b2a467c685d8b + url: "https://pub.dev" + source: hosted + version: "3.12.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: d7253d255ff10f85cfd2adaba9ac17bae878fa3ba577462451163bd9f1d1f0bf + url: "https://pub.dev" + source: hosted + version: "5.4.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: faa5a76f6380a9b90b53bc3bdcb85bc7926a382e0709b9b5edac9f7746651493 + url: "https://pub.dev" + source: hosted + version: "2.21.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_animate: + dependency: "direct main" + description: + name: flutter_animate + sha256: "7befe2d3252728afb77aecaaea1dec88a89d35b9b1d2eea6d04479e8af9117b5" + url: "https://pub.dev" + source: hosted + version: "4.5.2" + flutter_highlight: + dependency: transitive + description: + name: flutter_highlight + sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_mobx: + dependency: "direct main" + description: + name: flutter_mobx + sha256: ba5e93467866a2991259dc51cffd41ef45f695c667c2b8e7b087bf24118b50fe + url: "https://pub.dev" + source: hosted + version: "2.3.0" + flutter_neat_and_clean_calendar: + dependency: "direct main" + description: + name: flutter_neat_and_clean_calendar + sha256: cfdd57bdd9b8b60109e6ceeb436782084fd4c467ae193109f2c9b2770e644c41 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + flutter_platform_widgets: + dependency: transitive + description: + name: flutter_platform_widgets + sha256: "84f39540cf433aa44b235b7fca6518d1bd30aa281d8196f00be60bc76cac96f4" + url: "https://pub.dev" + source: hosted + version: "7.0.1" + flutter_secure_storage: + dependency: transitive + description: + name: flutter_secure_storage + sha256: "22dbf16f23a4bcf9d35e51be1c84ad5bb6f627750565edd70dab70f3ff5fff8f" + url: "https://pub.dev" + source: hosted + version: "8.1.0" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: "38f9501c7cb6f38961ef0e1eacacee2b2d4715c63cc83fe56449c4d3d0b47255" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + flutter_shaders: + dependency: transitive + description: + name: flutter_shaders + sha256: "34794acadd8275d971e02df03afee3dee0f98dbfb8c4837082ad0034f612a3e2" + url: "https://pub.dev" + source: hosted + version: "0.1.3" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.dev" + source: hosted + version: "2.0.9" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_auth_2: + dependency: transitive + description: + name: flutter_web_auth_2 + sha256: "0da41e631a368e02366fc1a9b79dd8da191e700a836878bc54466fff51c07df2" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + flutter_web_auth_2_platform_interface: + dependency: transitive + description: + name: flutter_web_auth_2_platform_interface + sha256: f6fa7059ff3428c19cd756c02fef8eb0147131c7e64591f9060c90b5ab84f094 + url: "https://pub.dev" + source: hosted + version: "2.1.4" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + gestures: + dependency: transitive + description: + name: gestures + sha256: "6e75e4ba1ad033a8be9a682974dfe6a2be96ab07b4aa8335ed37bbecb75b7770" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: bd7e671d26fd39c78cba82070fa34ef1f830b0e7ed1aeebccabc6561302a7ee5 + url: "https://pub.dev" + source: hosted + version: "6.5.9" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + highlight: + dependency: transitive + description: + name: highlight + sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + inspector: + dependency: transitive + description: + name: inspector + sha256: "40ba0ac1c819c85139bfec9d1e283804581a8985c91f19d00e93212cf29226b1" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" + source: hosted + version: "0.18.1" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + url: "https://pub.dev" + source: hosted + version: "10.0.8" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.dev" + source: hosted + version: "0.1.3-main.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + markdown_widget: + dependency: "direct main" + description: + name: markdown_widget + sha256: "216dced98962d7699a265344624bc280489d739654585ee881c95563a3252fac" + url: "https://pub.dev" + source: hosted + version: "2.3.2+6" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mobx: + dependency: "direct main" + description: + name: mobx + sha256: bf1a90e5bcfd2851fc6984e20eef69557c65d9e4d0a88f5be4cf72c9819ce6b0 + url: "https://pub.dev" + source: hosted + version: "2.5.0" + mobx_codegen: + dependency: "direct main" + description: + name: mobx_codegen + sha256: "990da80722f7d7c0017dec92040b31545d625b15d40204c36a1e63d167c73cdc" + url: "https://pub.dev" + source: hosted + version: "2.7.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + oauth2: + dependency: "direct main" + description: + name: oauth2 + sha256: c4013ef62be37744efdc0861878fd9e9285f34db1f9e331cc34100d7674feb42 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + oauth2_client: + dependency: "direct main" + description: + name: oauth2_client + sha256: "9dbbe72548d769d7e37fdfe571d09094a7635449ad8a54c31b64003935e76330" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + sha256: adf7a637f97c077041d36801b43be08559fd4322d2127b3f20bb7be1b9eebc22 + url: "https://pub.dev" + source: hosted + version: "0.9.3+7" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + provider: + dependency: "direct main" + description: + name: provider + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" + source: hosted + version: "6.1.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + random_string: + dependency: transitive + description: + name: random_string + sha256: "03b52435aae8cbdd1056cf91bfc5bf845e9706724dd35ae2e99fa14a1ef79d02" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + recase: + dependency: transitive + description: + name: recase + sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 + url: "https://pub.dev" + source: hosted + version: "4.1.0" + resizable_widget: + dependency: transitive + description: + name: resizable_widget + sha256: db2919754b93f386b9b3fb15e9f48f6c9d6d41f00a24397629133c99df86606a + url: "https://pub.dev" + source: hosted + version: "1.0.5" + retry: + dependency: "direct main" + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + scroll_to_index: + dependency: transitive + description: + name: scroll_to_index + sha256: b707546e7500d9f070d63e5acf74fd437ec7eeeb68d3412ef7b0afada0b4f176 + url: "https://pub.dev" + source: hosted + version: "3.0.1" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" + url: "https://pub.dev" + source: hosted + version: "2.5.2" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "3ec7210872c4ba945e3244982918e502fa2bfb5230dff6832459ca0e1879b7ad" + url: "https://pub.dev" + source: hosted + version: "2.4.8" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + simple_gesture_detector: + dependency: transitive + description: + name: simple_gesture_detector + sha256: ba2cd5af24ff20a0b8d609cec3f40e5b0744d2a71804a2616ae086b9c19d19a3 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stomp_dart_client: + dependency: "direct main" + description: + name: stomp_dart_client + sha256: "8779d1383f0a6faa0623af27ab6d4b228ab76c75020d9a83ade5ee204eac5153" + url: "https://pub.dev" + source: hosted + version: "0.4.4" + storybook_flutter: + dependency: "direct main" + description: + name: storybook_flutter + sha256: "68f07d2caf16bd34e9cfbc479d60298a6568abfac552ea1998ef724344c6cc13" + url: "https://pub.dev" + source: hosted + version: "0.14.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + table_calendar: + dependency: "direct main" + description: + name: table_calendar + sha256: "1e3521a3e6d3fc7f645a58b135ab663d458ab12504f1ea7f9b4b81d47086c478" + url: "https://pub.dev" + source: hosted + version: "3.0.9" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4" + url: "https://pub.dev" + source: hosted + version: "6.3.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + url: "https://pub.dev" + source: hosted + version: "6.3.2" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + url: "https://pub.dev" + source: hosted + version: "3.2.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.dev" + source: hosted + version: "3.1.4" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + validators: + dependency: "direct main" + description: + name: validators + sha256: "884515951f831a9c669a41ed6c4d3c61c2a0e8ec6bca761a4480b28e99cecf5d" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752" + url: "https://pub.dev" + source: hosted + version: "1.1.10+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33 + url: "https://pub.dev" + source: hosted + version: "1.1.10+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a" + url: "https://pub.dev" + source: hosted + version: "1.1.10+1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 + url: "https://pub.dev" + source: hosted + version: "0.4.0+2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + widgetbook: + dependency: "direct main" + description: + name: widgetbook + sha256: "43fb5d65e5617cae47aeb5b25d6c8c51ee44bb5296b9a72df7bd60dbc6c51877" + url: "https://pub.dev" + source: hosted + version: "3.11.0" + widgetbook_annotation: + dependency: "direct main" + description: + name: widgetbook_annotation + sha256: b6f1da292c20a6238d973a640d253ce3ebddbe1f9fa8f2afd72624797a38e7cc + url: "https://pub.dev" + source: hosted + version: "3.3.0" + widgetbook_generator: + dependency: "direct dev" + description: + name: widgetbook_generator + sha256: ac59f4208daf449c104fccfab77d210e53e92b8a52b74f51a81666418c9a6023 + url: "https://pub.dev" + source: hosted + version: "3.10.0" + window_to_front: + dependency: transitive + description: + name: window_to_front + sha256: "7aef379752b7190c10479e12b5fd7c0b9d92adc96817d9e96c59937929512aee" + url: "https://pub.dev" + source: hosted + version: "0.0.3" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/widgetbook/pubspec.yaml b/widgetbook/pubspec.yaml new file mode 100644 index 0000000..2755f9d --- /dev/null +++ b/widgetbook/pubspec.yaml @@ -0,0 +1,65 @@ +name: widgetbook_workspace +description: "A new Flutter project." +publish_to: 'none' +version: 0.1.0 + +environment: + sdk: ^3.7.0 + +dependencies: + flutter: + sdk: flutter + widgetbook: ^3.11.0 + widgetbook_annotation: ^3.3.0 + cupertino_icons: ^1.0.2 + table_calendar: ^3.0.9 + go_router: ^6.2.0 + shared_preferences: ^2.0.18 + provider: ^6.0.5 + oauth2: ^2.0.1 + dev: ^1.0.0 + mobx_codegen: ^2.1.1 + mobx: ^2.1.4 + flutter_mobx: ^2.0.6+5 + http: ^0.13.5 + oauth2_client: ^3.2.1 + clash_bot_api: + path: ../clash-bot-api + animated_text_kit: ^4.2.2 + storybook_flutter: ^0.14.1 + validators: ^3.0.0 + retry: ^3.1.1 + stomp_dart_client: ^0.4.4 + collection: ^1.17.0 + flutter_animate: ^4.1.1+1 + uuid: ^3.0.7 + envied: ^1.1.1 + markdown_widget: ^2.3.2+6 + url_launcher: ^6.3.1 + firebase_analytics: ^11.4.4 + firebase_analytics_web: ^0.5.10+10 + intl: ^0.18.1 + flutter_neat_and_clean_calendar: ^0.4.16 + flutter_svg: ^2.0.9 + clashbot_flutter: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + widgetbook_generator: ^3.10.0 + build_runner: ^2.3.3 + +flutter: + uses-material-design: true + + +assets: + - ../assets/markdown/privacy-policy.md + - ../images/TopIcon.webp + - ../images/BotIcon.webp + - ../images/MidIcon.webp + - ../images/JGIcon.webp + - ../images/SuppIcon.webp + - ../svgs/ClashBot-HomePage.svg \ No newline at end of file diff --git a/widgetbook/web/favicon.png b/widgetbook/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/widgetbook/web/favicon.png differ diff --git a/widgetbook/web/icons/Icon-192.png b/widgetbook/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/widgetbook/web/icons/Icon-192.png differ diff --git a/widgetbook/web/icons/Icon-512.png b/widgetbook/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/widgetbook/web/icons/Icon-512.png differ diff --git a/widgetbook/web/icons/Icon-maskable-192.png b/widgetbook/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/widgetbook/web/icons/Icon-maskable-192.png differ diff --git a/widgetbook/web/icons/Icon-maskable-512.png b/widgetbook/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/widgetbook/web/icons/Icon-maskable-512.png differ diff --git a/widgetbook/web/index.html b/widgetbook/web/index.html new file mode 100644 index 0000000..4ffb957 --- /dev/null +++ b/widgetbook/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + widgetbook + + + + + + diff --git a/widgetbook/web/manifest.json b/widgetbook/web/manifest.json new file mode 100644 index 0000000..6bd71b6 --- /dev/null +++ b/widgetbook/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "widgetbook", + "short_name": "widgetbook", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +}