Skip to content

Instantly share code, notes, and snippets.

@berkanaslan
Last active May 31, 2021 17:24
Show Gist options
  • Select an option

  • Save berkanaslan/060ce4be7f1c41aea674b3d092032a02 to your computer and use it in GitHub Desktop.

Select an option

Save berkanaslan/060ce4be7f1c41aea674b3d092032a02 to your computer and use it in GitHub Desktop.

Revisions

  1. berkanaslan revised this gist May 31, 2021. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions main.dart
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,8 @@ MultiProvider setupProviders() {
    return MultiProvider(
    providers: [
    ...
    StreamProvider<ConnectivityResult>(
    initialData: ConnectivityResult.mobile,
    create: (context) => ConnectivityViewModel().connectivity,
    ChangeNotifierProvider<ConnectivityViewModel>(
    create: (context) => ConnectivityViewModel(),
    lazy: false,
    ),
    ...
  2. berkanaslan created this gist May 29, 2021.
    14 changes: 14 additions & 0 deletions main.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    MultiProvider setupProviders() {
    return MultiProvider(
    providers: [
    ...
    StreamProvider<ConnectivityResult>(
    initialData: ConnectivityResult.mobile,
    create: (context) => ConnectivityViewModel().connectivity,
    lazy: false,
    ),
    ...
    ],
    child: MaterialApp(),
    );
    }