Joe Little - [email protected]
Kawan Little - [email protected]
Joe Little - [email protected]
Kawan Little - [email protected]
| final class DirUri extends PathUri { | |
| DirUri(String path) | |
| : _uri = _parsePathUri(path: '$path/'), | |
| super._(); | |
| final Uri _uri; | |
| @override | |
| String? get filename => _uri.filename; | |
| @override |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_hooks/flutter_hooks.dart'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { |
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
| import 'package:web_socket_channel/web_socket_channel.dart'; | |
| final _wsProvider = FutureProvider((ref) async { | |
| final ws = YourWebsocket(Uri(/** ... */)); | |
| ref.onDispose(ws.dispose); | |
| await ws.connect(); |
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| // could use flutter_riverpod | |
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | |
| import 'mutation_state.dart'; | |
| part 'main.g.dart'; |
| import 'package:meta/meta.dart'; | |
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | |
| import 'package:stack_trace/stack_trace.dart'; | |
| part 'mutation_provider.g.dart'; | |
| // generic mutation | |
| @riverpod | |
| MutationState<void> mutation(MutationRef ref, Object mutationKey) { | |
| return MutationState._initial(ref); |
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | |
| part 'mutation_provider.g.dart'; | |
| class ExampleWidget extends ConsumerWidget { | |
| const ExampleWidget({super.key}); |
| void main() { | |
| print('Wont pass null into a copy'); | |
| final e1 = Example1(id: 1, name: 'hello 1'); | |
| final e1Copy = e1.copyWith(name: null); | |
| print('e1: ${e1.id}, ${e1.name}'); | |
| print('e1Copy: ${e1Copy.id}, ${e1Copy.name}'); | |
| print('\nSubclassing method'); | |
| void main() { | |
| final isIdentical = identical(Singleton(), Singleton()); | |
| print(isIdentical); | |
| assert(isIdentical == true); | |
| } | |
| class Singleton { | |
| static final Singleton _instance = Singleton._(); | |
| const Singleton._(); |