diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart deleted file mode 100644 index 942320f..0000000 --- a/lib/firebase_options.dart +++ /dev/null @@ -1,82 +0,0 @@ -// File generated by FlutterFire CLI. -// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members -import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; -import 'package:flutter/foundation.dart' - show defaultTargetPlatform, kIsWeb, TargetPlatform; - -/// Default [FirebaseOptions] for use with your Firebase apps. -/// -/// Example: -/// ```dart -/// import 'firebase_options.dart'; -/// // ... -/// await Firebase.initializeApp( -/// options: DefaultFirebaseOptions.currentPlatform, -/// ); -/// ``` -class DefaultFirebaseOptions { - static FirebaseOptions get currentPlatform { - if (kIsWeb) { - return web; - } - switch (defaultTargetPlatform) { - case TargetPlatform.android: - return android; - case TargetPlatform.iOS: - return ios; - case TargetPlatform.macOS: - return macos; - case TargetPlatform.windows: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for windows - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - case TargetPlatform.linux: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for linux - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - default: - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); - } - } - - static const FirebaseOptions web = FirebaseOptions( - apiKey: 'AIzaSyB6eFpKM-FX31cZPRPbNwlj6VCoc1G3SeU', - appId: '1:655141330055:web:b262dc3d240a32a81a2c22', - messagingSenderId: '655141330055', - projectId: 'gdev-annuaire', - authDomain: 'gdev-annuaire.firebaseapp.com', - storageBucket: 'gdev-annuaire.appspot.com', - ); - - static const FirebaseOptions android = FirebaseOptions( - apiKey: 'AIzaSyAxFULgOFom_Dsx6AVmcZdHGetDvtjGzbk', - appId: '1:655141330055:android:db10532c8a73cc9d1a2c22', - messagingSenderId: '655141330055', - projectId: 'gdev-annuaire', - storageBucket: 'gdev-annuaire.appspot.com', - ); - - static const FirebaseOptions ios = FirebaseOptions( - apiKey: 'AIzaSyB6u7EpW4pvrR9gJGq4B7LrzesBV-sIq1I', - appId: '1:655141330055:ios:82c8fec7ae27b2951a2c22', - messagingSenderId: '655141330055', - projectId: 'gdev-annuaire', - storageBucket: 'gdev-annuaire.appspot.com', - iosClientId: '655141330055-e3uim74419qgvjlt7svqk763q758qfak.apps.googleusercontent.com', - iosBundleId: 'com.example.gdevAnnuaire', - ); - - static const FirebaseOptions macos = FirebaseOptions( - apiKey: 'AIzaSyB6u7EpW4pvrR9gJGq4B7LrzesBV-sIq1I', - appId: '1:655141330055:ios:82c8fec7ae27b2951a2c22', - messagingSenderId: '655141330055', - projectId: 'gdev-annuaire', - storageBucket: 'gdev-annuaire.appspot.com', - iosClientId: '655141330055-e3uim74419qgvjlt7svqk763q758qfak.apps.googleusercontent.com', - iosBundleId: 'com.example.gdevAnnuaire', - ); -} diff --git a/lib/main.dart b/lib/main.dart index cd0ac5b..ef51618 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,55 +1,57 @@ // ignore_for_file: avoid_print -import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:gdev_annuaire/queries.dart'; +import 'package:graphql_flutter/graphql_flutter.dart'; // import 'package:hive_flutter/hive_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:truncate/truncate.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'firebase_options.dart'; -import 'package:firebase_auth/firebase_auth.dart'; // late Box addressBox; -late FirebaseFirestore db; bool canAdd = false; List profiles = []; +bool showAll = false; Future main() async { WidgetsFlutterBinding.ensureInitialized(); + const indexerEndpoint = "https://duniter-indexer.coinduf.eu/v1/graphql"; + // await Hive.initFlutter(); - await Firebase.initializeApp( - options: DefaultFirebaseOptions.currentPlatform, - ); - db = FirebaseFirestore.instance; - // await eraseDB(); - await FirebaseAuth.instance.signInAnonymously(); - FirebaseAuth.instance.authStateChanges().listen((User? user) { - if (user == null) { - print('User is currently signed out!'); - } else { - print('User is signed in!'); - } - }); // addressBox = await Hive.openBox("addressBox"); // await addressBox.clear(); - runApp(const MyApp()); + runApp(const MyApp(indexerEndpoint)); } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp(this.indexerEndpoint, {Key? key}) : super(key: key); + final String? indexerEndpoint; @override Widget build(BuildContext context) { - return MaterialApp( - title: 'ĞDev annuaire', - theme: ThemeData( - primarySwatch: Colors.blue, + final httpLink = HttpLink( + indexerEndpoint!, + ); + + final client = ValueNotifier( + GraphQLClient( + cache: GraphQLCache(), + link: httpLink, + ), + ); + + return GraphQLProvider( + client: client, + child: MaterialApp( + title: 'ĞDev annuaire', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'ĞDev annuaire'), ), - home: const MyHomePage(title: 'ĞDev annuaire'), ); } } @@ -69,6 +71,12 @@ class _MyHomePageState extends State { } @override + void initState() { + // showAll = false; + super.initState(); + } + + @override Widget build(BuildContext context) { // profiles.clear(); // addressBox.toMap().forEach((key, value) { @@ -76,7 +84,7 @@ class _MyHomePageState extends State { // }); return Scaffold( - backgroundColor: Colors.orange[200], + backgroundColor: yellowC, body: profileTiles(context, refresh), ); } @@ -85,9 +93,6 @@ class _MyHomePageState extends State { Widget profileTiles(BuildContext context, refresh) { final double screenWidth = MediaQuery.of(context).size.width; int nbrColumn = 9; - TextEditingController nameController = TextEditingController(); - TextEditingController addressController = TextEditingController(); - if (screenWidth <= 600) { nbrColumn = 1; } else if (screenWidth <= 900) { @@ -106,120 +111,111 @@ Widget profileTiles(BuildContext context, refresh) { nbrColumn = 8; } - return CustomScrollView(slivers: [ - const SliverToBoxAdapter(child: SizedBox(height: 20)), - SliverToBoxAdapter( - child: Row( - children: [ - const SizedBox(width: 20), - SizedBox( - width: 150, - child: TextField( - controller: nameController, - onChanged: (a) { - canAddProfile(nameController.text, addressController.text); - // refresh(); - }, - decoration: const InputDecoration( - hintText: "Nom", + return Query( + options: QueryOptions( + document: gql(showAll ? getAllAccountsQ : getAllIdentitiesQ), + // pollInterval: const Duration(seconds: 10), + ), + builder: (QueryResult resultQ, + {VoidCallback? refetch, FetchMore? fetchMore}) { + if (resultQ.hasException) { + return Text(resultQ.exception.toString()); + } + + if (resultQ.isLoading) { + return const Text('Loading'); + } + + final List listProfiles = resultQ.data?['account'] ?? []; + + return CustomScrollView( + slivers: [ + const SliverToBoxAdapter(child: SizedBox(height: 15)), + SliverToBoxAdapter( + child: InkWell( + onTap: () { + showAll = !showAll; + refresh(); + }, + child: Row(children: [ + const SizedBox(width: 10), + Icon( + showAll ? Icons.check_box : Icons.check_box_outline_blank, + color: orangeC, + ), + const SizedBox(width: 8), + Text( + 'Afficher tous les comptes existants', + style: TextStyle(fontSize: 16, color: Colors.grey[700]), + ), + ]), + ), ), - ), - ), - const SizedBox(width: 20), - SizedBox( - width: 470, - child: TextField( - controller: addressController, - onChanged: (a) { - canAddProfile(nameController.text, addressController.text); - // refresh(); - }, - decoration: const InputDecoration( - hintText: "Adresse", - ), - ), - ), - const SizedBox(width: 20), - IconButton( - icon: const Icon(Icons.add_reaction_outlined), - onPressed: (() async { - if (canAdd) { - await addProfile(nameController.text, addressController.text); - refresh(); - canAdd = false; - } - }), - ), - const Spacer(), - const Text( - 'Annuaire ĞDev', - style: TextStyle(fontSize: 20), - ), - const SizedBox(width: 80), - ], - )), - const SliverToBoxAdapter(child: SizedBox(height: 30)), - FutureBuilder( - future: getDbData(), - builder: (context, AsyncSnapshot? snapshot) { - List result = snapshot?.data ?? []; - result.sort(); - return SliverGrid.count( - key: const Key('listWallets'), - crossAxisCount: nbrColumn, - childAspectRatio: 1, - crossAxisSpacing: 0, - mainAxisSpacing: 0, - children: [ - for (String profile in result) - Container( - color: Colors.orange[200], - child: Padding( - padding: const EdgeInsets.all(10), - child: Container( - color: Colors.orange[100], - child: Padding( - padding: const EdgeInsets.all(10), - child: tile(context, profile.split(':')[0], - profile.split(':')[1], refresh), + const SliverToBoxAdapter(child: SizedBox(height: 15)), + SliverGrid.count( + key: const Key('listWallets'), + crossAxisCount: nbrColumn, + childAspectRatio: 1, + crossAxisSpacing: 0, + mainAxisSpacing: 0, + children: [ + for (Map profile in listProfiles) + Container( + color: yellowC, + child: Padding( + padding: const EdgeInsets.all(0), + child: Container( + // color: Colors.orange[100], + decoration: BoxDecoration( + // shape: BoxShape.circle, + gradient: RadialGradient( + radius: 1.3, + colors: [ + // yellowC, + Colors.white, + Colors.orange[300]!, + ], + ), + ), + child: Padding( + padding: const EdgeInsets.all(10), + child: tile( + context, + profile['id'], + profile['identity']?['name'] ?? '', + profile['identity']?['validated_at'] == null + ? false + : true), + ), ), ), ), - ), - ]); - }, - ), - ]); + ], + ), + ], + ); + }); } -Widget tile(BuildContext context, String name, String address, refresh) { - int lastTap = DateTime.now().millisecondsSinceEpoch; - int consecutiveTaps = 0; +Widget tile(BuildContext context, String address, String name, bool isMember) { return Container( - color: Colors.orange[50], + decoration: BoxDecoration( + color: Colors.orange[50], + shape: BoxShape.circle, + ), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ GestureDetector( - onTap: () { - int now = DateTime.now().millisecondsSinceEpoch; - if (now - lastTap < 400) { - consecutiveTaps++; - if (consecutiveTaps > 8) { - print("DELETE PROFILE"); - deleteAddress(address, refresh); - } - } else { - consecutiveTaps = 0; - } - lastTap = now; - }, + onTap: () {}, child: Text( name, - style: - const TextStyle(fontWeight: FontWeight.w600, fontSize: 17), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 17, + color: isMember ? orangeC : Colors.black), ), ), const SizedBox(height: 3), @@ -262,52 +258,10 @@ snackCopyKey(BuildContext context, String address) { ScaffoldMessenger.of(context).showSnackBar(snackBar); } -Future addProfile(String name, String address) async { - final newProfile = {"name": name, "address": address}; - - db.collection("profiles").add(newProfile).then((DocumentReference doc) => - print('DocumentSnapshot added with ID: ${doc.id}')); -} - Future getDbData() async { - await db.collection("profiles").get().then((event) { - profiles.clear(); - for (var doc in event.docs) { - final name = doc.data()['name']; - final address = doc.data()['address']; - profiles.add('$name:$address'); - print("${doc.id} => ${doc.data()}"); - } - }); - return profiles; } -Future eraseDB() async { - var collection = FirebaseFirestore.instance.collection('profiles'); - var snapshots = await collection.get(); - for (var doc in snapshots.docs) { - await doc.reference.delete(); - } -} - -Future deleteAddress(String address, refresh) async { - await db.collection("profiles").get().then((event) async { - profiles.clear(); - for (var doc in event.docs) { - if (address == doc.data()['address']) { - await FirebaseFirestore.instance - .runTransaction((Transaction myTransaction) async { - myTransaction.delete(doc.reference); - }); - refresh(); - return; - } - } - // await doc.reference.delete(); - }); -} - bool isAddress(address) { final RegExp regExp = RegExp( r'^[a-zA-Z0-9]+$', @@ -327,17 +281,8 @@ bool isAddress(address) { } } -bool canAddProfile(String name, String address) { - if (name == '' || !isAddress(address)) { - return false; - } - - for (var profile in profiles) { - final nameStored = profile.split(':')[0]; - final addressStored = profile.split(':')[1]; - if (address == addressStored || name == nameStored) return false; - } - - canAdd = true; - return true; -} +// Colors +Color orangeC = const Color(0xffd07316); +Color yellowC = const Color(0xffFFD68E); +Color floattingYellow = const Color(0xffEFEFBF); +Color backgroundColor = const Color(0xFFF5F5F5); diff --git a/lib/queries.dart b/lib/queries.dart new file mode 100644 index 0000000..8612daa --- /dev/null +++ b/lib/queries.dart @@ -0,0 +1,105 @@ +const String getAllAccountsQ = r''' +query { + account(order_by: {identity: {name: asc}}) { + id + identity { + name + validated_at + } + } +} +'''; + +const String getAllIdentitiesQ = r''' +query { + account(where: {identity: {name: {_is_null: false}}}, order_by: {identity: {name: asc}}) { + id + identity { + name + validated_at + } + } +} +'''; + +const String getNameByAddressQ = r''' +query ($address: String!) { + account_by_pk(id: $address) { + identity { + name + } + } +} +'''; + +const String searchAddressByNameQ = r''' +query ($name: String!) { + search_identity(args: {name: $name}) { + id + name + } +} +'''; + +const String getHistoryByAddressQ = r''' +query ($address: String!) { + account_by_pk(id: "5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn") { + transactions_issued { + receiver_id + amount + created_at + created_on + } + transactions_received { + issuer_id + amount + created_at + created_on + } + } +} +'''; + +const String getHistoryByAddressQ2 = r''' +query ($address: String!) { + { + transaction(where: {_or: [{issuer_id: {_eq: $address}}, + {receiver_id: {_eq: $address}}]}, order_by: {created_at: desc}) + { + amount + created_at + issuer_id + receiver_id + } + } +} +'''; + +const String getHistoryByAddressQ3 = r''' +query ($address: String!) { + transaction_connection(where: + {_or: [ + {issuer_id: {_eq: $address}}, + {receiver_id: {_eq: $address}} + ]}, + order_by: {created_at: desc}) { + edges { + node { + amount + created_at + issuer_id + receiver_id + } + } + pageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor + } + } +} +'''; + +// To parse indexer date format +// log.d(DateTime.parse("2022-06-13T16:51:24.001+00:00").toString()); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e27042d..79818f9 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,14 +5,10 @@ import FlutterMacOS import Foundation -import cloud_firestore -import firebase_auth -import firebase_core +import connectivity_plus_macos import path_provider_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) - FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) - FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 4b567fa..6a0301a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" async: dependency: transitive description: @@ -36,27 +43,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.17" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "5.5.7" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.6.16" collection: dependency: transitive description: @@ -64,6 +50,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.16.0" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.4" + connectivity_plus_linux: + dependency: transitive + description: + name: connectivity_plus_linux + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + connectivity_plus_macos: + dependency: transitive + description: + name: connectivity_plus_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.3" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + connectivity_plus_web: + dependency: transitive + description: + name: connectivity_plus_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2" + connectivity_plus_windows: + dependency: transitive + description: + name: connectivity_plus_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2" crypto: dependency: transitive description: @@ -78,6 +106,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.5" + dbus: + dependency: transitive + description: + name: dbus + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.5" fake_async: dependency: transitive description: @@ -99,53 +134,18 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.2" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - url: "https://pub.dartlang.org" - source: hosted - version: "3.3.19" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "6.2.7" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - url: "https://pub.dartlang.org" - source: hosted - version: "3.3.16" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.17.1" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.4.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.4" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_hooks: + dependency: transitive + description: + name: flutter_hooks + url: "https://pub.dartlang.org" + source: hosted + version: "0.18.4" flutter_lints: dependency: "direct dev" description: @@ -163,6 +163,69 @@ packages: description: flutter source: sdk version: "0.0.0" + gql: + dependency: transitive + description: + name: gql + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.1" + gql_dedupe_link: + dependency: transitive + description: + name: gql_dedupe_link + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + gql_error_link: + dependency: transitive + description: + name: gql_error_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" + gql_exec: + dependency: transitive + description: + name: gql_exec + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + gql_http_link: + dependency: transitive + description: + name: gql_http_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + gql_link: + dependency: transitive + description: + name: gql_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + gql_transform_link: + dependency: transitive + description: + name: gql_transform_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" + graphql: + dependency: transitive + description: + name: graphql + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.2-beta.2" + graphql_flutter: + dependency: "direct main" + description: + name: graphql_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1-beta.3" hive: dependency: "direct main" description: @@ -177,6 +240,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" http_parser: dependency: transitive description: @@ -184,13 +254,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.1" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" js: dependency: transitive description: @@ -226,6 +289,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + nm: + dependency: transitive + description: + name: nm + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + normalize: + dependency: transitive + description: + name: normalize + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.0+1" path: dependency: transitive description: @@ -282,6 +359,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" platform: dependency: transitive description: @@ -319,6 +403,13 @@ packages: url: "https://github.com/insinfo/qr.flutter.git" source: git version: "4.0.0" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.4" sky_engine: dependency: transitive description: flutter @@ -380,6 +471,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" vector_math: dependency: transitive description: @@ -387,6 +485,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" win32: dependency: transitive description: @@ -401,6 +506,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0+1" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.0" sdks: dart: ">=2.17.1 <3.0.0" flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index f60b6a8..509fd07 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: gdev_annuaire description: gdev_annuaire publish_to: 'none' -version: 0.0.0+1 +version: 0.0.0+2 environment: sdk: ">=2.17.1 <3.0.0" @@ -10,6 +10,7 @@ environment: dependencies: flutter: sdk: flutter + cupertino_icons: ^1.0.2 qr_flutter: #^4.0.0 git: url: https://github.com/insinfo/qr.flutter.git @@ -17,11 +18,7 @@ dependencies: truncate: ^3.0.1 hive: ^2.0.4 hive_flutter: ^1.1.0 - - cupertino_icons: ^1.0.2 - firebase_core: ^1.17.1 - cloud_firestore: ^3.1.17 - firebase_auth: ^3.3.19 + graphql_flutter: ^5.1.1-beta.3 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index dc6d987..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:gdev_annuaire/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..8083d74 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..8cf5d42 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST