Basic Mobile App Framework
This commit is contained in:
parent
997806b7f0
commit
28649bda73
@ -1,2 +1,8 @@
|
|||||||
# Imagini
|
# Imagini
|
||||||
|
|
||||||
|
## Running Server
|
||||||
|
|
||||||
|
## Server Build
|
||||||
|
|
||||||
|
## Flutter Build
|
||||||
|
flutter run
|
||||||
|
@ -1,21 +1,80 @@
|
|||||||
PODS:
|
PODS:
|
||||||
|
- DKImagePickerController/Core (4.3.2):
|
||||||
|
- DKImagePickerController/ImageDataManager
|
||||||
|
- DKImagePickerController/Resource
|
||||||
|
- DKImagePickerController/ImageDataManager (4.3.2)
|
||||||
|
- DKImagePickerController/PhotoGallery (4.3.2):
|
||||||
|
- DKImagePickerController/Core
|
||||||
|
- DKPhotoGallery
|
||||||
|
- DKImagePickerController/Resource (4.3.2)
|
||||||
|
- DKPhotoGallery (0.0.17):
|
||||||
|
- DKPhotoGallery/Core (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Model (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Preview (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Resource (= 0.0.17)
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Core (0.0.17):
|
||||||
|
- DKPhotoGallery/Model
|
||||||
|
- DKPhotoGallery/Preview
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Model (0.0.17):
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Preview (0.0.17):
|
||||||
|
- DKPhotoGallery/Model
|
||||||
|
- DKPhotoGallery/Resource
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Resource (0.0.17):
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- file_picker (0.0.1):
|
||||||
|
- DKImagePickerController/PhotoGallery
|
||||||
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- integration_test (0.0.1):
|
- integration_test (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- SDWebImage (5.10.2):
|
||||||
|
- SDWebImage/Core (= 5.10.2)
|
||||||
|
- SDWebImage/Core (5.10.2)
|
||||||
|
- SwiftyGif (5.3.0)
|
||||||
|
- url_launcher (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
|
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- integration_test (from `.symlinks/plugins/integration_test/ios`)
|
- integration_test (from `.symlinks/plugins/integration_test/ios`)
|
||||||
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- DKImagePickerController
|
||||||
|
- DKPhotoGallery
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
file_picker:
|
||||||
|
:path: ".symlinks/plugins/file_picker/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
integration_test:
|
integration_test:
|
||||||
:path: ".symlinks/plugins/integration_test/ios"
|
:path: ".symlinks/plugins/integration_test/ios"
|
||||||
|
url_launcher:
|
||||||
|
:path: ".symlinks/plugins/url_launcher/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
|
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
|
||||||
|
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||||
|
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
|
||||||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||||
integration_test: 5ed24a436eb7ec17b6a13046e9bf7ca4a404e59e
|
integration_test: 5ed24a436eb7ec17b6a13046e9bf7ca4a404e59e
|
||||||
|
SDWebImage: b969dcfc02c40a5da71eac0b03b8f1a0c794a86f
|
||||||
|
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
|
||||||
|
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||||
|
|
||||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||||
|
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:imagini/screens/photo/photoscreen.dart';
|
import 'package:imagini/screens/splash/splashscreen.dart';
|
||||||
|
import 'package:imagini/screens/me/mescreen.dart';
|
||||||
|
import 'package:imagini/screens/login/loginscreen.dart';
|
||||||
import 'package:imagini/screens/upload/uploadscreen.dart';
|
import 'package:imagini/screens/upload/uploadscreen.dart';
|
||||||
import 'package:imagini/screens/example2/examplescreen2.dart';
|
import 'package:imagini/screens/gallery/galleryscreen.dart';
|
||||||
|
import 'package:imagini/screens/settings/settingsscreen.dart';
|
||||||
|
|
||||||
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
||||||
"/": (BuildContext context) => PhotoScreen(),
|
"/": (BuildContext context) => SplashScreen(),
|
||||||
"/Upload": (BuildContext context) => UploadScreen(),
|
"/Me": (BuildContext context) => MeScreen(),
|
||||||
"/ExScreen2": (BuildContext context) => ExScreen2(),
|
"/Login": (BuildContext context) => LoginScreen(),
|
||||||
|
"/Upload": (BuildContext context) => UploadScreen(),
|
||||||
|
"/Gallery": (BuildContext context) => GalleryScreen(),
|
||||||
|
"/Settings": (BuildContext context) => SettingsScreen(),
|
||||||
};
|
};
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:imagini/screens/example2/components/body.dart';
|
|
||||||
import 'package:imagini/screens/example2/example2-bloc.dart';
|
|
||||||
import 'package:imagini/bloc/bloc-prov.dart';
|
|
||||||
|
|
||||||
class ExScreen2 extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_ExScreen2State createState() => _ExScreen2State();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ExScreen2State extends State<ExScreen2> {
|
|
||||||
Example2Bloc example2Bloc;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
example2Bloc = Example2Bloc();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
example2Bloc.dispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BlocProvider(
|
|
||||||
bloc: Example2Bloc(),
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text("Second Screen"),
|
|
||||||
),
|
|
||||||
body: Body(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,14 +5,14 @@ import 'package:imagini/models/contact.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:imagini/bloc/bloc.dart';
|
import 'package:imagini/bloc/bloc.dart';
|
||||||
|
|
||||||
class Example2Bloc extends Bloc {
|
class GalleryBloc extends Bloc {
|
||||||
StreamSubscription _audioPlayerStateSubscription;
|
StreamSubscription _audioPlayerStateSubscription;
|
||||||
|
|
||||||
Stream<String> get example => _exampleSubject.stream;
|
Stream<String> get example => _exampleSubject.stream;
|
||||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||||
|
|
||||||
Example2Bloc();
|
GalleryBloc();
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_exampleSubject.close();
|
_exampleSubject.close();
|
45
web_native/lib/screens/gallery/galleryscreen.dart
Normal file
45
web_native/lib/screens/gallery/galleryscreen.dart
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:imagini/screens/gallery/components/body.dart';
|
||||||
|
import 'package:imagini/screens/gallery/gallery-bloc.dart';
|
||||||
|
import 'package:imagini/bloc/bloc-prov.dart';
|
||||||
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class GalleryScreen extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_GalleryScreenState createState() => _GalleryScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _GalleryScreenState extends State<GalleryScreen> {
|
||||||
|
GalleryBloc exampleBloc;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
exampleBloc = GalleryBloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
exampleBloc.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocProvider(
|
||||||
|
bloc: exampleBloc,
|
||||||
|
child: PlatformScaffold(
|
||||||
|
appBar: PlatformAppBar(
|
||||||
|
title: Text('Gallerys'),
|
||||||
|
cupertino: (_, __) => CupertinoNavigationBarData(
|
||||||
|
// Issue with cupertino where a bar with no transparency
|
||||||
|
// will push the list down. Adding some alpha value fixes it (in a hacky way)
|
||||||
|
backgroundColor: Colors.lightGreen.withAlpha(254),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Body(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -6,10 +6,11 @@ class Body extends StatelessWidget {
|
|||||||
return Center(
|
return Center(
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
// Go to Login Screen
|
||||||
|
Navigator.pushNamed(context, '/Gallery');
|
||||||
},
|
},
|
||||||
child: Text('Go back!'),
|
child: Text('Login'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,14 @@ import 'package:imagini/models/contact.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:imagini/bloc/bloc.dart';
|
import 'package:imagini/bloc/bloc.dart';
|
||||||
|
|
||||||
class Example2Bloc extends Bloc {
|
class LoginBloc extends Bloc {
|
||||||
StreamSubscription _audioPlayerStateSubscription;
|
StreamSubscription _audioPlayerStateSubscription;
|
||||||
|
|
||||||
Stream<String> get example => _exampleSubject.stream;
|
Stream<String> get example => _exampleSubject.stream;
|
||||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||||
|
|
||||||
Example2Bloc();
|
LoginBloc();
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_exampleSubject.close();
|
_exampleSubject.close();
|
||||||
|
@ -1,37 +1,35 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:imagini/screens/example2/components/body.dart';
|
import 'package:imagini/screens/login/components/body.dart';
|
||||||
import 'package:imagini/screens/example2/example2-bloc.dart';
|
import 'package:imagini/screens/login/login-bloc.dart';
|
||||||
import 'package:imagini/bloc/bloc-prov.dart';
|
import 'package:imagini/bloc/bloc-prov.dart';
|
||||||
|
|
||||||
class ExScreen2 extends StatefulWidget {
|
class LoginScreen extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_ExScreen2State createState() => _ExScreen2State();
|
_LoginScreenState createState() => _LoginScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ExScreen2State extends State<ExScreen2> {
|
class _LoginScreenState extends State<LoginScreen> {
|
||||||
Example2Bloc example2Bloc;
|
LoginBloc loginBloc;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
loginBloc = LoginBloc();
|
||||||
example2Bloc = Example2Bloc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
example2Bloc.dispose();
|
loginBloc.dispose();
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocProvider(
|
return BlocProvider(
|
||||||
bloc: Example2Bloc(),
|
bloc: LoginBloc(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("Second Screen"),
|
title: Text("Login"),
|
||||||
),
|
),
|
||||||
body: Body(),
|
body: Body(),
|
||||||
),
|
),
|
||||||
|
@ -6,10 +6,10 @@ class Body extends StatelessWidget {
|
|||||||
return Center(
|
return Center(
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pushNamed(context, '/Upload');
|
||||||
},
|
},
|
||||||
child: Text('Go back!'),
|
child: Text('Page Two!'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,14 +5,14 @@ import 'package:imagini/models/contact.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:imagini/bloc/bloc.dart';
|
import 'package:imagini/bloc/bloc.dart';
|
||||||
|
|
||||||
class PhotoBloc extends Bloc {
|
class MeBloc extends Bloc {
|
||||||
StreamSubscription _audioPlayerStateSubscription;
|
StreamSubscription _audioPlayerStateSubscription;
|
||||||
|
|
||||||
Stream<String> get example => _exampleSubject.stream;
|
Stream<String> get example => _exampleSubject.stream;
|
||||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||||
|
|
||||||
PhotoBloc();
|
MeBloc();
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_exampleSubject.close();
|
_exampleSubject.close();
|
@ -1,22 +1,22 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:imagini/screens/photo/components/body.dart';
|
import 'package:imagini/screens/me/components/body.dart';
|
||||||
import 'package:imagini/screens/photo/photo-bloc.dart';
|
import 'package:imagini/screens/me/me-bloc.dart';
|
||||||
import 'package:imagini/bloc/bloc-prov.dart';
|
import 'package:imagini/bloc/bloc-prov.dart';
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
|
|
||||||
|
|
||||||
class PhotoScreen extends StatefulWidget {
|
class MeScreen extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_PhotoScreenState createState() => _PhotoScreenState();
|
_MeScreenState createState() => _MeScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PhotoScreenState extends State<PhotoScreen> {
|
class _MeScreenState extends State<MeScreen> {
|
||||||
PhotoBloc exampleBloc;
|
MeBloc exampleBloc;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
exampleBloc = PhotoBloc();
|
exampleBloc = MeBloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -31,7 +31,7 @@ class _PhotoScreenState extends State<PhotoScreen> {
|
|||||||
bloc: exampleBloc,
|
bloc: exampleBloc,
|
||||||
child: PlatformScaffold(
|
child: PlatformScaffold(
|
||||||
appBar: PlatformAppBar(
|
appBar: PlatformAppBar(
|
||||||
title: Text('Photos'),
|
title: Text('Mes'),
|
||||||
cupertino: (_, __) => CupertinoNavigationBarData(
|
cupertino: (_, __) => CupertinoNavigationBarData(
|
||||||
// Issue with cupertino where a bar with no transparency
|
// Issue with cupertino where a bar with no transparency
|
||||||
// will push the list down. Adding some alpha value fixes it (in a hacky way)
|
// will push the list down. Adding some alpha value fixes it (in a hacky way)
|
15
web_native/lib/screens/settings/components/body.dart
Normal file
15
web_native/lib/screens/settings/components/body.dart
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Body extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Center(
|
||||||
|
child: RaisedButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pushNamed(context, '/Upload');
|
||||||
|
},
|
||||||
|
child: Text('Page Two!'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
20
web_native/lib/screens/settings/settings-bloc.dart
Normal file
20
web_native/lib/screens/settings/settings-bloc.dart
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:imagini/models/contact.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:imagini/bloc/bloc.dart';
|
||||||
|
|
||||||
|
class SettingsBloc extends Bloc {
|
||||||
|
StreamSubscription _audioPlayerStateSubscription;
|
||||||
|
|
||||||
|
Stream<String> get example => _exampleSubject.stream;
|
||||||
|
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||||
|
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||||
|
|
||||||
|
SettingsBloc();
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
_exampleSubject.close();
|
||||||
|
}
|
||||||
|
}
|
45
web_native/lib/screens/settings/settingsscreen.dart
Normal file
45
web_native/lib/screens/settings/settingsscreen.dart
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:imagini/screens/settings/components/body.dart';
|
||||||
|
import 'package:imagini/screens/settings/settings-bloc.dart';
|
||||||
|
import 'package:imagini/bloc/bloc-prov.dart';
|
||||||
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class SettingsScreen extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_SettingsScreenState createState() => _SettingsScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
|
SettingsBloc exampleBloc;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
exampleBloc = SettingsBloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
exampleBloc.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocProvider(
|
||||||
|
bloc: exampleBloc,
|
||||||
|
child: PlatformScaffold(
|
||||||
|
appBar: PlatformAppBar(
|
||||||
|
title: Text('Settings'),
|
||||||
|
cupertino: (_, __) => CupertinoNavigationBarData(
|
||||||
|
// Issue with cupertino where a bar with no transparency
|
||||||
|
// will push the list down. Adding some alpha value fixes it (in a hacky way)
|
||||||
|
backgroundColor: Colors.lightGreen.withAlpha(254),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Body(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
19
web_native/lib/screens/splash/components/body.dart
Normal file
19
web_native/lib/screens/splash/components/body.dart
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Body extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Center(
|
||||||
|
child: RaisedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// Back (popping)
|
||||||
|
// Navigator.pop(context);
|
||||||
|
|
||||||
|
// Go to Login Screen
|
||||||
|
Navigator.pushNamed(context, '/Login');
|
||||||
|
},
|
||||||
|
child: Text('Login'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
20
web_native/lib/screens/splash/splash-bloc.dart
Normal file
20
web_native/lib/screens/splash/splash-bloc.dart
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:imagini/models/contact.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:imagini/bloc/bloc.dart';
|
||||||
|
|
||||||
|
class SplashBloc extends Bloc {
|
||||||
|
StreamSubscription _audioPlayerStateSubscription;
|
||||||
|
|
||||||
|
Stream<String> get example => _exampleSubject.stream;
|
||||||
|
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||||
|
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||||
|
|
||||||
|
SplashBloc();
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
_exampleSubject.close();
|
||||||
|
}
|
||||||
|
}
|
38
web_native/lib/screens/splash/splashscreen.dart
Normal file
38
web_native/lib/screens/splash/splashscreen.dart
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:imagini/screens/splash/components/body.dart';
|
||||||
|
import 'package:imagini/screens/splash/splash-bloc.dart';
|
||||||
|
import 'package:imagini/bloc/bloc-prov.dart';
|
||||||
|
|
||||||
|
class SplashScreen extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_SplashScreenState createState() => _SplashScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SplashScreenState extends State<SplashScreen> {
|
||||||
|
SplashBloc splashBloc;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
splashBloc = SplashBloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
splashBloc.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocProvider(
|
||||||
|
bloc: SplashBloc(),
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text("First Screen"),
|
||||||
|
),
|
||||||
|
body: Body(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user